look 1 年間 前
コミット
bb5573e68d

+ 7 - 3
ERPUpload/upload.html

@@ -96,7 +96,6 @@
             url='/apis/upload/orderAttachFile'
         }
         document.title = title
-
         $('.title_span').html(title)
         $('#fileType').html(title)
         $('#orderName').val(orderName)
@@ -106,12 +105,17 @@
             runtimes: 'html5,flash,silverlight,html4',//这里可以不写,plupload默认支持
             url: url,//上传后台请求路径
             browse_button: 'uploader',
-            max_file_size: '3000mb',//用来限制单个文件大小的
+            filters: {
+              mime_types: [
+                {title: "图片文件", extensions: "jpg,jpeg,png,bmp,cdr"}
+              ],
+              max_file_size: '5mb'//用来限制单个文件大小的
+            },
             multi_selection: false,//默认支持多文件上传,false不支持 multi_selection: false,
             flash_swf_url: '/swf/Moxie.swf',
             silverlight_xap_url: '/swf/Moxie.xap', //silverlight文件,当需要使用silverlight方式进行上传时需要配置该参数
             dragdrop: true,
-            chunk_size: '2mb',//是否将上传文件进行分片,0代表是不分
+            chunk_size: '1mb',//是否将上传文件进行分片,0代表是不分
             init: {
                 BeforeUpload(up, file) {
                     console.log(file);

+ 6 - 6
src/components/orderDetail/orderDetail.vue

@@ -115,13 +115,13 @@
         <el-col :span="6">
           <div class="detailItem">
             <label class="item_label">单价:</label>
-            <div class="item_content">{{ form.printPrice }}</div>
+            <div class="item_content">{{ form.printPrice.toFixed(2) }}</div>
           </div>
         </el-col>
           <el-col :span="6">
             <div class="detailItem">
               <label class="item_label">金额:</label>
-              <div class="item_content">{{ form.printMoneyTotal }}</div>
+              <div class="item_content">{{ form.printMoneyTotal.toFixed(2) }}</div>
             </div>
           </el-col>
         </el-row>
@@ -182,13 +182,13 @@
           <el-col :span="6">
             <div class="detailItem">
               <label class="item_label">外发单价:</label>
-              <div class="item_content">{{ form.outPrice }}</div>
+              <div class="item_content">{{ form.outPrice.toFixed(2) }}</div>
             </div>
           </el-col>
           <el-col :span="6">
             <div class="detailItem">
               <label class="item_label">外发金额:</label>
-              <div class="item_content">{{ form.outMoneyTotal }}</div>
+              <div class="item_content">{{ form.outMoneyTotal.toFixed(2) }}</div>
             </div>
           </el-col>
           <el-col :span="6">
@@ -216,13 +216,13 @@
           <el-col :span="6">
             <div class="detailItem">
               <label class="item_label">毛利:</label>
-              <div class="item_content">{{ form.orderGrossProfit }}</div>
+              <div class="item_content">{{ form.orderGrossProfit.toFixed(2) }}</div>
             </div>
           </el-col>
           <el-col :span="6">
             <div class="detailItem">
               <label class="item_label">毛利率:</label>
-              <div class="item_content">{{ form.orderGrossProfitRate }}%</div>
+              <div class="item_content">{{ form.orderGrossProfitRate.toFixed(0) }}%</div>
             </div>
           </el-col>
         </el-row>

+ 73 - 26
src/views/order/orderList/component/ordermis.vue

@@ -154,23 +154,29 @@
       <el-row :gutter="24" type="flex" justify="left">
         <el-col :span="5">
           <el-form-item size="small" label="数量">
-            <el-input type="number"  v-model="form.printQty" placeholder="数量" style="width: 53%" @input="calculatePrintMoneyTotal"></el-input>
+            <el-input type="number"  v-model="form.printQty" placeholder="数量" style="width: 53%"
+                      @keydown.native="clearInput"
+                      @input="calculatePrintMoneyTotal"></el-input>
             <el-input v-model="form.printQtyUnit" placeholder="单位" style="width: 20%"></el-input>
           </el-form-item>
         </el-col>
         <el-col :span="3">
           <el-form-item size="small" label="单价">
-            <el-input type="number" v-model="form.printPrice" @input="calculatePrintMoneyTotal"></el-input>
+            <el-input type="number" v-model="form.printPrice"
+                      @keydown.native="clearInput"
+                      @input="calculatePrintMoneyTotal"></el-input>
           </el-form-item>
         </el-col>
         <el-col :span="3">
           <el-form-item size="small" label="总金额">
-            <el-input type="number" v-model="form.printMoneyTotal" @input="calculatePrintPrice"></el-input>
+            <el-input type="number" v-model="form.printMoneyTotal"
+                      @keydown.native="clearInput"
+                      @input="calculatePrintPrice"></el-input>
           </el-form-item>
         </el-col>
         <el-col :span="3">
           <el-form-item size="small" label="已收金额" class="item">
-            <el-input type="number" v-model="form.payMoney"></el-input>
+            <el-input type="number" v-model="form.payMoney" @keydown.native="clearInput"></el-input>
           </el-form-item>
         </el-col>
       </el-row>
@@ -259,23 +265,31 @@
       </el-row>
       <el-row :gutter="24" type="flex">
         <el-col :span="3">
-          <el-form-item size="small" label="数量">
-            <el-input type="number" v-model="form.outQty" @input="calculateOutMoneyTotal"></el-input>
+          <el-form-item size="small" label="外发数量">
+            <el-input type="number" v-model="form.outQty"
+                      @keydown.native="clearInput"
+                      @input="calculateOutMoneyTotal"></el-input>
           </el-form-item>
         </el-col>
         <el-col :span="3">
-          <el-form-item size="small" label="单价">
-            <el-input type="number" v-model="form.outPrice" @input="calculateOutMoneyTotal"></el-input>
+          <el-form-item size="small" label="外发单价">
+            <el-input type="number" v-model="form.outPrice"
+                      @keydown.native="clearInput"
+                      @input="calculateOutMoneyTotal"></el-input>
           </el-form-item>
         </el-col>
         <el-col :span="3">
-          <el-form-item size="small" label="金额">
-            <el-input type="number" v-model="form.outMoneyTotal" @input="calculateOutPrice"></el-input>
+          <el-form-item size="small" label="外发金额">
+            <el-input type="number" v-model="form.outMoneyTotal"
+                      @keydown.native="clearInput"
+                      @input="calculateOutPrice"></el-input>
           </el-form-item>
         </el-col>
         <el-col :span="3">
           <el-form-item size="small" label="运费">
-            <el-input type="number" v-model="form.outSendMoney" @input="calculateOrderGrossProfitRate"></el-input>
+            <el-input type="number" v-model="form.outSendMoney"
+                      @keydown.native="clearInput"
+                      @input="calculateOrderGrossProfitRate"></el-input>
           </el-form-item>
         </el-col>
 <!--        <el-col :span="4">-->
@@ -387,8 +401,8 @@ const form = {
   outAddress: '',
   outMemo: '',
   orderCost: '',
-  orderGrossProfit: '',
-  orderGrossProfitRate: '',
+  orderGrossProfit: 0,
+  orderGrossProfitRate: 0,
   versionCode: ''
 }
 
@@ -606,6 +620,14 @@ export default {
       }
 
     },
+    clearInput(e) {
+      const key = e.key;
+      if (key === 'e' || key === 'E' || key === '+' || key === '-') {
+        e.returnValue = false;
+        return false;
+      }
+      return true;
+    },
     calculatePrintMoneyTotal() {
       const _that = this;
       let printQty = _that.form.printQty;
@@ -617,18 +639,33 @@ export default {
         printMoneyTotal = printQty * printPrice;
         _that.form.printMoneyTotal = printMoneyTotal.toFixed(2);
         if (_that.form.printMoneyTotal <= 0 ) {
+          _that.form.orderGrossProfit = 0;
+          _that.form.orderGrossProfitRate = 0;
         this.$message.warning('请注意,订单总金额是0');
-          }
-        _that.calculateOrderGrossProfitRate();
+        return;
+          } else {
+          _that.calculateOrderGrossProfitRate();
+        }
       }
     },
     calculatePrintPrice() {
       const _that = this;
       let printQty = _that.form.printQty;
       let printPrice = 0;
-      printPrice = _that.form.printMoneyTotal / printQty;
-      _that.form.printPrice = printPrice.toFixed(2);
-      _that.calculateOrderGrossProfitRate();
+      if (printQty === 0) {
+        printPrice = 0;
+      } else {
+        printPrice = _that.form.printMoneyTotal / printQty;
+      }
+      if (_that.form.printMoneyTotal <=0 ) {
+        _that.form.orderGrossProfit = 0;
+        _that.form.orderGrossProfitRate = 0;
+        this.$message.warning('请注意,订单总金额是0');
+        return;
+      } else {
+        _that.form.printPrice = printPrice.toFixed(2);
+        _that.calculateOrderGrossProfitRate();
+      }
     },
     calculateOutMoneyTotal() {
       const _that = this;
@@ -648,22 +685,31 @@ export default {
       const _that = this;
       let outQty = _that.form.outQty;
       let outPrice = 0;
-      outPrice = _that.form.outMoneyTotal / outQty;
+      if (outQty === 0) {
+          outPrice = 0;
+      } else {
+        outPrice = _that.form.outMoneyTotal / outQty;
+      }
       _that.form.outPrice = outPrice.toFixed(2);
       _that.calculateOrderGrossProfitRate();
     },
     calculateOrderGrossProfitRate() {
       const _that = this;
       let outSendMoney = _that.form.outSendMoney;
-      let orderGrossProfitRate = '';
+      let orderGrossProfitRate = 0;
       if (_that.form.printMoneyTotal === null || _that.form.printMoneyTotal === '' || _that.form.outMoneyTotal ===null || _that.form.outMoneyTotal ==='') {
         return;
       } else {
-      _that.form.orderGrossProfit = _that.form.printMoneyTotal - _that.form.outMoneyTotal - outSendMoney;
-      orderGrossProfitRate = _that.form.orderGrossProfit / _that.form.printMoneyTotal;
-      orderGrossProfitRate = orderGrossProfitRate.toFixed(2);
-      orderGrossProfitRate = (orderGrossProfitRate * 100).toFixed(0);
-      _that.form.orderGrossProfitRate = orderGrossProfitRate;
+      _that.form.orderGrossProfit = (_that.form.printMoneyTotal - _that.form.outMoneyTotal - outSendMoney).toFixed(2);
+      if (_that.form.printMoneyTotal <= 0 ) {
+        _that.form.orderGrossProfitRate = 0;
+        return;
+      } else {
+        orderGrossProfitRate = _that.form.orderGrossProfit / _that.form.printMoneyTotal;
+        orderGrossProfitRate = orderGrossProfitRate.toFixed(2);
+        orderGrossProfitRate = (orderGrossProfitRate * 100).toFixed(0);
+        _that.form.orderGrossProfitRate = orderGrossProfitRate;
+      }
       }
     },
     chooseClient(data) {
@@ -788,7 +834,8 @@ export default {
     getDictInfo(typeText) {
       const _that = this
       var data = {
-        'dictTypeText': typeText
+        'dictTypeText': typeText,
+        'voidFlag': 0
       }
 
       // console.log(data)

+ 44 - 22
src/views/order/orderList/orderList.vue

@@ -127,7 +127,7 @@
         :data="tableData"
         v-loading="listLoading"
         row-key="id"
-        max-height="720"
+        max-height="700"
         show-summary
         :summary-method="getSummaries"
         border
@@ -305,8 +305,17 @@
             show-overflow-tooltip
           >
             <template slot-scope="{row}">
-              <el-link :href="row.printFileUrlLink" target="_blank" style="color: #20a0ff">{{ row[column.field] }}
-              </el-link>
+              <div style="line-height: 30px">
+                <el-image
+                  v-show="row.printFileUrlLink != null"
+                  style="width: 25px; height: 25px"
+                  :src="row.printFileUrlLink"
+                  :preview-src-list="srcList">
+                </el-image>
+                <a  v-if="row.printFileUrlLink!=null" style="color: #1363C2;vertical-align: text-bottom;display: inline-block;" :href="row.printFileUrlLink">下载</a>
+              </div>
+              <!--              <el-link :href="row.attachFileLink" target="_blank" style="color: #1363C2">{{ row[column.field] }}-->
+              <!--              </el-link>-->
             </template>
           </el-table-column>
           <el-table-column
@@ -515,10 +524,10 @@ const lifeForm = {
 
 const defaultItems = [
   {
-    name: '制单人', id: 24, field: 'createManUser', width: '70'
+    name: '制单人', id: 24, field: 'createManUser', width: '60'
   },
   {
-    name: '订单编号', id: 1, field: 'orderCode', width: '110'
+    name: '订单编号', id: 1, field: 'orderCode', width: '100'
   },
   {
     name: '客户名称', id: 3, field: 'clientName', width: '100'
@@ -527,49 +536,55 @@ const defaultItems = [
     name: '印品名称', id: 2, field: 'orderName', width: '100'
   },
   {
-    name: '产品类型', id: 4, field: 'productName', width: '80'
+    name: '产品类型', id: 4, field: 'productName', width: '70'
   },
   {
-    name: '订单数量', id: 5, field: 'printQty', width: '80'
+    name: '订单数量', id: 5, field: 'printQty', width: '75'
   },
   {
     name: '单价', id: 6, field: 'printPrice', width: '70'
   },
   {
-    name: '订单金额', id: 7, field: 'printMoneyTotal', width: '80'
+    name: '订单金额', id: 7, field: 'printMoneyTotal', width: '70'
   },
   {
-    name: '已收金额', id: 18, field: 'payMoney', width: '80'
+    name: '已收金额', id: 18, field: 'payMoney', width: '70'
   },
   {
-    name: '欠款金额', id: 19, field: 'chargeMoney', width: '80'
+    name: '欠款金额', id: 19, field: 'chargeMoney', width: '70'
   },
   {
-    name: '外发金额', id: 20, field: 'outMoneyTotal', width: '80'
+    name: '外发金额', id: 20, field: 'outMoneyTotal', width: '70'
   },
   {
-    name: '外发运费', id: 21, field: 'outSendMoney', width: '70'
+    name: '外发运费', id: 21, field: 'outSendMoney', width: '60'
   },
   {
     name: '毛利', id: 22, field: 'orderGrossProfit', width: '70'
   },
   {
-    name: '毛利率(%)', id: 23, field: 'orderGrossProfitRate', width: '70'
+    name: '毛利率(%)', id: 23, field: 'orderGrossProfitRate', width: '65'
   },
   // {
   //   name: '联数', id: 8, field: 'receiptsCount', width: '100'
   // },
   {
+    name: '原图文件', id: 16, field: 'printFileName', width: '80'
+  },
+  {
+    name: '附件', id: 17, field: 'attachFileName', width: '100'
+  },
+  {
     name: '送货地址', id: 13, field: 'sendAddress', width: '100'
   },
   {
-    name: '材料类型', id: 9, field: 'paperName', width: '90'
+    name: '材料类型', id: 9, field: 'paperName', width: '70'
   },
   {
-    name: '每本页数', id: 10, field: 'pageCount', width: '90'
+    name: '每本页数', id: 10, field: 'pageCount', width: '70'
   },
   {
-    name: '印刷颜色', id: 11, field: 'printColor', width: '90'
+    name: '印刷颜色', id: 11, field: 'printColor', width: '70'
   },
   // {
   //   name: '生产工艺', id: 12, field: 'printAllCoverFlag', width: '100'
@@ -578,12 +593,6 @@ const defaultItems = [
     name: '制单时间', id: 14, field: 'createTime', width: '130'
   },
   {
-    name: '原图文件', id: 16, field: 'printFileName', width: '100'
-  },
-  {
-    name: '附件', id: 17, field: 'attachFileName', width: '100'
-  },
-  {
     name: '订单状态', id: 15, field: 'orderState', width: ''
   }
 ]
@@ -652,6 +661,7 @@ export default {
       dialogVisible: false,
       queryType: 1, // 1模糊搜索,2组合搜索
       searchTime: [],
+      srcList:[],
       search: {
         keyWord: '',
         orderState: '0'
@@ -880,11 +890,23 @@ export default {
       // return;
       getOrderList(data).then(response => {
         // console.log(response)
+        _that.srcList = [];
         const data = response.data
         // //  组合表单数据
         _that.tableData = data
         _that.tableCollection = response.collection
         _that.listData.total = response.total
+        for (let i = 0; i <_that.tableData.length; i++) {
+          var dataItem = _that.tableData[i];
+          var printFileUrlLinkex = '';
+          if (dataItem.printFileUrlLink != null ) {
+            printFileUrlLinkex = dataItem.printFileUrlLink;
+            // printFileUrlLinkex = printFileUrlLinkex.split("?")[0];
+            _that.srcList.push(printFileUrlLinkex)
+          }
+
+        }
+        // console.log("1",_that.srcList);
         // console.log(_that.tableData)
         _that.listLoading = false
       }).catch(err => {