Browse Source

bug修复

fenghaifu 2 years ago
parent
commit
8f7ba29f96

+ 1 - 1
src/utils/myutil.js

@@ -75,4 +75,4 @@ export function getDotValidExpress(dot){
   }
   return {};
 
-}
+}

+ 11 - 3
src/views/reportForms/order-statistics/chart/external/departmentChart.vue

@@ -37,6 +37,7 @@ export default {
   methods: {
     // 初次加载
     firstDepData() {
+      var that = this;
       this.$nextTick(() => {
         //let nowDate = new Date()
         //let date = {
@@ -53,8 +54,8 @@ export default {
         // this.queryParam.vendorType = '内部'
         depChart(this.queryParam).then(res => {
           if (res.result) {
-            // console.log('部门统计图数据', res.result)
-            res.result.forEach(item => {
+            var dataList = res.result.sort(that.sortByDep);
+            dataList.forEach(item => {
               this.cdepNameArr.push(item.cdepName)
               this.iquantityArr.push(parseFloat(item.iquantity))
               this.inatMoneyArr.push(parseFloat(item.inatMoney))
@@ -72,11 +73,13 @@ export default {
 
     // 1、查询 重置方法 先获取 chart 数据
     getDepChartData() {
+      var that = this;
       this.queryParam.vendorType = '外部'
       depChart(this.queryParam).then(res => {
         if (res.result) {
+          var dataList = res.result.sort(that.sortByDep);
           // console.log('部门统计图数据', res.result)
-          res.result.forEach(item => {
+          dataList.forEach(item => {
             this.cdepNameArr.push(item.cdepName)
             this.iquantityArr.push(parseFloat(item.iquantity))
             this.inatMoneyArr.push(parseFloat(item.inatMoney))
@@ -90,6 +93,11 @@ export default {
         })
       })
     },
+    // 根据部门排序
+    sortByDep(json1,json2){
+      var ret = json1.cdepName.localeCompare(json2.cdepName)*-1;
+      return ret;
+    },
 
     initEcharts() {
       const myChart = echarts.init(document.getElementById('departmentChart')) //dark

+ 9 - 5
src/views/reportForms/order-statistics/chart/interior/departmentChart.vue

@@ -56,8 +56,8 @@ export default {
         depChart(this.queryParam).then(res => {
           // console.log('2', this.queryParam)
           if (res.result) {
-            // console.log('部门统计图数据', res.result)
-            res.result.forEach(item => {
+            var dataList = res.result.sort(that.sortByDep);
+            dataList.forEach(item => {
               this.cdepNameArr.push(item.cdepName)
               this.iquantityArr.push(item.iquantity)
               this.inatMoneyArr.push(item.inatMoney)
@@ -78,8 +78,8 @@ export default {
       this.queryParam.vendorType = '内部'
       depChart(this.queryParam).then(res => {
         if (res.result) {
-          // console.log('部门统计图数据', res.result)
-          res.result.forEach(item => {
+          var dataList = res.result.sort(that.sortByDep);
+          dataList.forEach(item => {
             this.cdepNameArr.push(item.cdepName)
             this.iquantityArr.push(item.iquantity)
             this.inatMoneyArr.push(item.inatMoney)
@@ -93,7 +93,11 @@ export default {
         })
       })
     },
-
+    // 根据部门排序
+    sortByDep(json1,json2){
+      var ret = json1.cdepName.localeCompare(json2.cdepName)*-1;
+      return ret;
+    },
     initEcharts() {
       const myChart = echarts.init(document.getElementById('departmentChart')) // dark
 

+ 6 - 8
src/views/reportForms/order-statistics/external-statistics.vue

@@ -7,7 +7,7 @@
         <a-form layout="inline" @keyup.enter.native="searchQuery">
           <a-row :gutter="24">
             <a-col :md="6" :sm="8">
-              <a-form-item label="起始年月">
+              <a-form-item label="预计发货月份">
                 <!-- defaultPickerValue="[moment(defaultMonth),moment(defaultMonth)]" -->
                 <a-range-picker
                   style="width: 100%"
@@ -136,7 +136,7 @@ export default {
           className: 'replacecolor'
         },
         {
-          title: '计划到货月份',
+          title: '预计发货月份',
           width: 120,
           dataIndex: 'yearMonth',
           customRender: text => {
@@ -210,11 +210,9 @@ export default {
           // 参数给 chart
           this.$refs.departmentChart.queryParam = this.queryParam
           this.$refs.customerChart.queryParam = this.queryParam
-          console.log(this.$refs.departmentChart.queryParam)
 
           if (res.success) {
-            this.extStadata = res.result.records
-            console.log('图、列表当月数据', this.extStadata)
+            this.extStadata = res.result.records;
             this.pagination = {
               total: res.result.total,
               current: res.result.current,
@@ -235,8 +233,7 @@ export default {
           this.$refs.customerChart.queryParam = this.queryParam
 
           if (res.success) {
-            this.extStadata = res.result.records
-            console.log('订单外部列表', this.extStadata)
+            this.extStadata = res.result.records;
 
             this.pagination = {
               total: res.result.total,
@@ -326,7 +323,8 @@ export default {
     handleTableChange(pagination, filters, sorter) {
       this.queryParam.pageNo = pagination.current
       this.getExternalData()
-    }
+    },
+    
   }
 }
 </script>

+ 2 - 2
src/views/reportForms/order-statistics/interior-statistics.vue

@@ -7,7 +7,7 @@
         <a-form layout="inline" @keyup.enter.native="searchQuery">
           <a-row :gutter="24">
             <a-col :md="6" :sm="8">
-              <a-form-item label="起始年月">
+              <a-form-item label="预计发货月份">
                 <a-range-picker
                   style="width: 100%"
                   :placeholder="['开始年月', '结束年月']"
@@ -139,7 +139,7 @@ export default {
           className: 'replacecolor'
         },
         {
-          title: '计划到货月份',
+          title: '预计发货月份',
           width: 120,
           dataIndex: 'yearMonth',
           customRender: text => {

+ 7 - 0
src/views/shipment-details/addShipDetDrawer.vue

@@ -664,6 +664,13 @@ export default {
         if (newObj.syShippingDetailsItemList.length == 0) {
           this.$message.error('请选择参照订单数据')
         } else {
+          for (var i=0; i<newObj.syShippingDetailsItemList.length; i++){
+            var rowData = newObj.syShippingDetailsItemList[i];
+            if (rowData.shipmentQuantity > rowData.orderRemainingQuantity){
+              this.$message.error('第'+(i+1)+'行超发货数量超过订单剩余数量,无法保存');
+              return;
+            }
+          }
           addShipmentList(newObj).then(res => {
             if (res.success) {
               this.$message.success('新增成功');

+ 7 - 36
src/views/shipment-details/detailsShipDetDrawer.vue

@@ -25,35 +25,12 @@
                 </a-form-model-item>
               </a-col>
 
-              <a-col :md="6" :sm="8">
-                <a-form-model-item label="预发货日期" prop="preDeliveryDate">
-                  {{ detailsShipDet.preDeliveryDate }}
-                </a-form-model-item>
-              </a-col>
-
-              <a-col :md="6" :sm="8">
-                <a-form-model-item label="预完工日期" prop="preCompletionDate">
-                  {{ detailsShipDet.preCompletionDate }}
-                </a-form-model-item>
-              </a-col>
-
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="订单类型" prop="orderType">
                   {{ detailsShipDet.orderType }}
                 </a-form-model-item>
               </a-col>
 
-              <a-col :md="6" :sm="8">
-                <a-form-model-item label="成衣工厂" prop="garmentFactory">
-                  {{ detailsShipDet.garmentFactory }}
-                </a-form-model-item>
-              </a-col>
-
-              <a-col :md="6" :sm="8">
-                <a-form-model-item label="整单合计" prop="wholeOrderTotal">
-                  {{ detailsShipDet.wholeOrderTotal }}
-                </a-form-model-item>
-              </a-col>
 
               <!-- U8系统适用 -->
               <a-col :md="12" :sm="12">
@@ -149,12 +126,6 @@ export default {
           width: 120,
           className: 'replacecolor'
         },
-        {
-          title: '订单主表ID',
-          dataIndex: 'syOrderDataId',
-          width: 80,
-          className: 'replacecolor'
-        },
         {
           title: '客户订单',
           dataIndex: 'customerOrder',
@@ -382,12 +353,6 @@ export default {
           customRender: t => ellipsis(t),
           className: 'replacecolor'
         },
-        {
-          title: '订单子表ID',
-          dataIndex: 'syOrderDataItemId',
-          width: 160,
-          className: 'replacecolor'
-        },
 
         {
           title: '处理方式',
@@ -400,7 +365,13 @@ export default {
           title: '是否手册纱',
           dataIndex: 'manualYarnFlag',
           width: 100,
-          scopedSlots: { customRender: 'manualYarnFlag' },
+          customRender:function(value){
+            if (value == "1")
+              return "是";
+            else if (value == "0")
+              return "否";
+            return value;
+          },
           className: 'replacecolor'
         },
         {

+ 41 - 69
src/views/shipment-details/editShipDetDrawer.vue

@@ -5,7 +5,7 @@
       <!-- 主表信息 编辑 :rules="validatorRules"-->
       <a-card :bordered="true">
         <div class="table-page-search-wrapper">
-          <a-form-model layout="inline" ref="form" :model="editShipDet">
+          <a-form-model layout="inline" ref="form" :model="editShipDet" :rules="validatorRules">
             <a-row :gutter="24">
               <a-col :md="6" :sm="8">
                 <!-- required必填项 disabled 禁用  -->
@@ -31,27 +31,6 @@
                 </a-form-model-item>
               </a-col>
 
-              <a-col :md="6" :sm="8">
-                <a-form-model-item label="预发货日期" prop="preDeliveryDate">
-                  <a-date-picker
-                    placeholder="请选择预发货时间"
-                    :format="dateFormat"
-                    style="width:100%;"
-                    v-model="editShipDet.preDeliveryDate"
-                  />
-                </a-form-model-item>
-              </a-col>
-
-              <a-col :md="6" :sm="8">
-                <a-form-model-item label="预完工日期" prop="preCompletionDate">
-                  <a-date-picker
-                    placeholder="请选择预完工日期"
-                    :format="dateFormat"
-                    style="width:100%;"
-                    v-model="editShipDet.preCompletionDate"
-                  />
-                </a-form-model-item>
-              </a-col>
 
               <a-col :md="6" :sm="8">
                 <a-form-model-item label="订单类型" prop="orderType">
@@ -59,43 +38,8 @@
                 </a-form-model-item>
               </a-col>
 
-              <a-col :md="6" :sm="8">
-                <a-form-model-item label="HScode" prop="hsCode">
-                  <a-input placeholder="HScode" v-model="editShipDet.hsCode"></a-input>
-                </a-form-model-item>
-              </a-col>
 
-              <a-col :md="6" :sm="8">
-                <a-form-model-item label="中文品名" prop="chineseName">
-                  <a-input placeholder="请输入中文品名" v-model="editShipDet.chineseName"></a-input>
-                </a-form-model-item>
-              </a-col>
-
-              <a-col :md="6" :sm="8">
-                <a-form-model-item label="英文品名" prop="englishProductName">
-                  <a-input placeholder="请输入英文品名" v-model="editShipDet.englishProductName"></a-input>
-                </a-form-model-item>
-              </a-col>
-
-              <a-col :md="6" :sm="8">
-                <a-form-model-item label="报关品名" prop="declarationName">
-                  <a-input placeholder="请输入报关品名" v-model="editShipDet.declarationName"></a-input>
-                </a-form-model-item>
-              </a-col>
-
-              <a-col :md="6" :sm="8">
-                <a-form-model-item label="成衣工厂" prop="garmentFactory">
-                  <a-input placeholder="请输入成衣工厂" v-model="editShipDet.garmentFactory"></a-input>
-                </a-form-model-item>
-              </a-col>
-
-              <a-col :md="6" :sm="8">
-                <a-form-model-item label="整单合计" prop="wholeOrderTotal">
-                  <a-input placeholder="请输入整单合计" v-model="editShipDet.wholeOrderTotal"></a-input>
-                </a-form-model-item>
-              </a-col>
-
-              <a-col :md="18" :sm="18">
+              <a-col :md="12" :sm="12">
                 <a-form-model-item label="备注" prop="memo">
                   <a-input placeholder="请输入备注" v-model="editShipDet.memo"></a-input>
                 </a-form-model-item>
@@ -282,6 +226,13 @@ export default {
     let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} />
     return {
       id: '',
+      validatorRules:{
+          documentDate:[{required: true, message: '请输入单据日期!'}],
+         // customer:[{required: true, message: '请选择客户!'}],
+         // preDeliveryDate:[{required: true, message: '请选择预发货时间!'}],
+         // preCompletionDate:[{required: true, message: '请选择预完工日期!'}],
+         // orderType:[{required: true, message: '请输入订单类型!'}],
+        },
       // 表头
       columns: [
         {
@@ -625,16 +576,35 @@ export default {
     },
     // 编辑 保存
     editSave() {
-      // console.log('提交编辑、刷新发运明细列表')
-      editById(this.editShipDet).then(res => {
-        if (res.success) {
-          this.$message.success('编辑成功');
-          this.addShipDet = {};
-          this.addShipDet.syShippingDetailsItemList = [];
-          this.close();
-          this.fatherList(); // 调用父组件的查询方法
+      const that = this;
+      // 触发表单验证
+      this.$refs.form.validate(valid => {
+      if (valid) {
+        // 必须选择子表 --- 参照订单数据
+        if (this.editShipDet.syShippingDetailsItemList.length == 0) {
+          this.$message.error('请选择参照订单数据')
+        } else {
+          for (var i=0; i<this.editShipDet.syShippingDetailsItemList.length; i++){
+            var rowData = this.editShipDet.syShippingDetailsItemList[i];
+            if (rowData.shipmentQuantity > rowData.orderRemainingQuantity){
+              this.$message.error('第'+(i+1)+'行超发货数量超过订单剩余数量,无法保存');
+              return;
+            }
+          }
+          editById(this.editShipDet).then(res => {
+            if (res.success) {
+              this.$message.success('编辑成功');
+              this.addShipDet = {};
+              this.addShipDet.syShippingDetailsItemList = [];
+              this.close();
+              this.fatherList(); // 调用父组件的查询方法
+            }
+          })
         }
-      })
+      }else{
+        return false;
+      }
+      });
     },
     // 参照订单数据
     referOrderDataOpen() {
@@ -688,12 +658,14 @@ export default {
       return this.syShippingDetailsItemList.splice(index, 1)
     },
     // 操作 复制
-    copy(record) {},
+    copy(record) {
+       var newRecord = JSON.parse(JSON.stringify(record));
+      this.syShippingDetailsItemList.push(newRecord)
+    },
 
     // --------------------------------------
     // 抽屉 取消
     handleCancel() {
-      console.log('点击抽屉取消')
       this.close()
     },
 

+ 32 - 27
src/views/shipment-details/shipmentList.vue

@@ -264,7 +264,7 @@ export default {
   },
 
   data() {
-    // let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} />
+    let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} />
     return {
       loading: false, // 表格加载
       id: '',
@@ -281,7 +281,7 @@ export default {
           title: '销售订单号',
           dataIndex: 'orderNumber',
           fixed: 'left',
-          width: 120,
+          width: 150,
           className: 'replacecolor'
         },
 
@@ -333,13 +333,16 @@ export default {
           title: '物料成分',
           dataIndex: 'materialComposition',
           width: 180,
-          className: 'replacecolor'
+          className: 'replacecolor',
+          customRender: t => ellipsis(t),
         },
         {
           title: '预发货日期',
           dataIndex: 'preDeliveryDate',
           width: 120,
           customRender: text => {
+            if (text == "" || text == null)
+              return "";
             return moment(text).format('YYYY-MM-DD')
           },
           className: 'replacecolor'
@@ -349,6 +352,8 @@ export default {
           dataIndex: 'preCompletionDate',
           width: 120,
           customRender: text => {
+            if (text == "" || text == null)
+              return "";
             return moment(text).format('YYYY-MM-DD')
           },
           className: 'replacecolor'
@@ -357,26 +362,23 @@ export default {
         {
           title: '存货名称',
           dataIndex: 'inventoryName',
-          width: 140,
-          className: 'replacecolor'
-        },
-        {
-          title: '整单(合计)',
-          dataIndex: 'wholeOrderTotal',
-          width: 120,
-          className: 'replacecolor'
+          width: 240,
+          className: 'replacecolor',
+          customRender: t => ellipsis(t),
         },
         {
           title: '英文品名',
           dataIndex: 'englishProductName',
           width: 120,
-          className: 'replacecolor'
+          className: 'replacecolor',
+          customRender: t => ellipsis(t),
         },
         {
           title: '单价(销售)',
           dataIndex: 'salesUnitPrice',
           width: 120,
-          className: 'replacecolor'
+          className: 'replacecolor',
+          
         },
 
         {
@@ -536,20 +538,23 @@ export default {
 
     //  申报要素
     declareElements(record) {
-      this.$refs.declareElementsModal.declareElementsModVis = true
-      queryDeclarationElements({
-        inventoryName: record.inventoryName,
-        itemNumber: record.itemNumber,
-        account: record.account
-      }).then(res => {
-        if (res.success) {
-          console.log('申报要素主子表数据', res.result)
-          // console.log('申报要素子表数据', res.result.syDeclarationElementsItemList)
-          this.$refs.declareElementsModal.declareElements = res.result
-          // 子表赋值
-          this.$refs.declareElementsModal.declareElementsData = res.result.syDeclarationElementsItemList
-        }
-      })
+      if (record.inventoryName == ""){
+        this.$message.error('当前行存货名称为空,无法维护报关要素');
+      }else{
+        this.$refs.declareElementsModal.declareElementsModVis = true
+        queryDeclarationElements({
+          inventoryName: record.inventoryName,
+          itemNumber: record.itemNumber,
+          account: record.account
+        }).then(res => {
+          if (res.success) {
+            // console.log('申报要素子表数据', res.result.syDeclarationElementsItemList)
+            this.$refs.declareElementsModal.declareElements = res.result
+            // 子表赋值
+            this.$refs.declareElementsModal.declareElementsData = res.result.syDeclarationElementsItemList
+          }
+        })
+      }
     },
     //  维护款号成分
     itemNumberElement(record) {