Bladeren bron

Merge branch 'purchaseDev' of http://172.16.100.139/new-business/drp-web into purchaseDev

002390 1 jaar geleden
bovenliggende
commit
72eca2606c

+ 2 - 1
src/components/popover-select-v2/index.vue

@@ -280,7 +280,8 @@ export default {
               </el-input>
             </el-form-item>
             <el-form-item>
-              <el-button icon="el-icon-refresh" @click="useReset"></el-button>
+              <el-button icon="el-icon-search" @click="useQuery">搜索</el-button>
+              <el-button icon="el-icon-refresh" @click="useReset">重置</el-button>
             </el-form-item>
           </div>
         </el-form>

+ 11 - 2
src/components/super-table/index.vue

@@ -147,6 +147,15 @@ export default {
         this.filterData = multiFilter(this.$props.value, newValue);
       },
     },
+    value:{
+      handler: function (newValue) {
+        if(this.value.length > 0){
+          this.$refs.superTable.clearSelection();
+        }
+      },
+      immediate: true,
+      deep:true
+    }
   },
   methods: {
     //
@@ -437,7 +446,7 @@ export default {
       }"
     >
       <div class="mr-4">
-        <template v-if="checkbox">
+        <!-- <template v-if="checkbox">
           <el-button
             v-if="selectState"
             size="mini"
@@ -454,7 +463,7 @@ export default {
             选择列
             {{ selectData.length ? ` :${selectData.length}` : "" }}
           </el-button>
-        </template>
+        </template> -->
         <template v-if="convenitentOperation">
           <button-hide v-model="innerColumns" @change="onHide"></button-hide>
         </template>

+ 38 - 1
src/views/WMS/historical-route/index.vue

@@ -437,12 +437,49 @@ export default {
         }
       })
       // queryAddress({})
-    }
+    },
+    //获取当前时间
+    getCurrentTime() {
+      let date = new Date();
+      return date;
+    },
+    //日期名称格式化
+    formatDateTime(date, format) {
+      const o = {
+        'M+': date.getMonth() + 1, // 月份
+        'd+': date.getDate(), // 日
+        'h+': date.getHours() % 12 === 0 ? 12 : date.getHours() % 12, // 小时
+        'H+': date.getHours(), // 小时
+        'm+': date.getMinutes(), // 分
+        's+': date.getSeconds(), // 秒
+        'q+': Math.floor((date.getMonth() + 3) / 3), // 季度
+        S: date.getMilliseconds(), // 毫秒
+        a: date.getHours() < 12 ? '上午' : '下午', // 上午/下午
+        A: date.getHours() < 12 ? 'AM' : 'PM', // AM/PM
+      };
+      if (/(y+)/.test(format)) {
+        format = format.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
+      }
+      for (let k in o) {
+        if (new RegExp('(' + k + ')').test(format)) {
+          format = format.replace(
+            RegExp.$1,
+            RegExp.$1.length === 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length)
+          );
+        }
+      }
+      return format;
+    },
   },
   created() {
     console.log(this.$route.query,'this.$route')
     this.carMessage = this.$route.query;
+    //当结束时间为空时,默认为当前时间
+    if (this.carMessage.endTime == '' || this.carMessage.endTime == null) {
+      this.carMessage.endTime = this.formatDateTime(this.getCurrentTime(), 'yyyy-MM-dd HH:mm:ss');
+    }
     this.handleGeocodeRepo(this.carMessage);
+    console.log(this.carMessage,'this.carMessage')
   }
 };
 </script>

+ 0 - 14
src/views/business/spd/bo/plan/index.vue

@@ -294,7 +294,6 @@ export default {
         isPage: true,
         title: ''
       },
-      customerOptions: [],
       personOptions: [],
       deptOptions: [],
       tableList: [],
@@ -549,12 +548,6 @@ export default {
       this.$refs.refer.init(this.referCondition)
     },
     selectionsToInput(selection) {
-      // 搜索区选择客户
-      if (this.referCondition.type == 'CUSTOMER_PARAM') {
-        this.customerOptions = selection
-        this.queryParams.customer = selection[0].id
-        this.queryParams.customerName = selection[0].name
-      }
       if (this.referCondition.type == 'CONTACTS_PARAM') {
         this.personOptions = selection
         this.queryParams.charger = selection[0].id
@@ -571,13 +564,6 @@ export default {
         this.queryParams.marketingAreaName = selection[0].name
       }
     },
-    // 搜索区树形选择
-    chooseTreeRefer(type, isPage, title) {
-      this.referCondition.type = type
-      this.referCondition.isPage = isPage
-      this.referCondition.title = title
-      this.$refs.tree.init(this.referCondition)
-    },
     selectionsToInput2(selection) {
       this.classOptions.push(selection)
       this.download.category = selection.code

+ 9 - 6
src/views/business/spd/goal_management/AnnualSaleGoal.vue

@@ -96,7 +96,7 @@
           <el-form-item label="部门" prop="dept">
             <el-popover-select-v2 v-model="queryParams.dept" title="部门" valueKey="name"
                                   referName="DEPT_PARAM"
-                                  :dataMapping="{ deptCode: 'code', dept: 'name'}"
+                                  :dataMapping="{ deptId: 'id', dept: 'name'}"
                                   :source.sync="queryParams" placeholder="请输入部门" @keyup.enter.native="handleQuery">
             </el-popover-select-v2>
           </el-form-item>
@@ -279,7 +279,7 @@
             <el-form-item label="部门" prop="dept">
               <el-popover-select-v2 v-model="form.dept" title="部门" valueKey="name"
                                     referName="DEPT_PARAM"
-                                    :dataMapping="{ deptCode: 'code', dept: 'name'}"
+                                    :dataMapping="{ deptId: 'id', dept: 'name'}"
                                     :source.sync="form" placeholder="请输入部门">
               </el-popover-select-v2>
             </el-form-item>
@@ -596,7 +596,7 @@ export default {
         saleZone: null,
         creatorCode: null,
         creator: null,
-        deptCode: null,
+        deptId: null,
         dept: null,
         goalTotal: null,
         notes: null,
@@ -644,7 +644,7 @@ export default {
         saleZone: null,
         creatorCode: null,
         creator: null,
-        deptCode: null,
+        deptId: null,
         dept: null,
         goalTotal: null,
         notes: null,
@@ -715,6 +715,7 @@ export default {
     };
   },
   created() {
+    console.log(this.$store.state.user, 'this.$store.state.user')
     this.getList();
   },
   methods: {
@@ -757,7 +758,7 @@ export default {
         saleZone: null,
         creatorCode: null,
         creator: null,
-        deptCode: null,
+        deptId: null,
         dept: null,
         goalTotal: null,
         notes: null,
@@ -786,7 +787,7 @@ export default {
         saleZone: null,
         creatorCode: null,
         creator: null,
-        deptCode: null,
+        deptId: null,
         dept: null,
         goalTotal: null,
         notes: null,
@@ -811,7 +812,9 @@ export default {
       this.open = true;
       this.form.documentDate = new Date().getFullYear().toString() + '-' + (new Date().getMonth() + 1).toString().padStart(2, '0') + '-' + new Date().getDate().toString().padStart(2, '0')
       this.form.annual = new Date().getFullYear().toString()
+      this.form.creatorCode = this.$store.state.user.name
       this.form.creator = this.$store.state.user.nickName
+      this.form.deptId = this.$store.state.user.deptId
       this.form.dept = this.$store.state.user.deptName
     },
     handleAddDetails() {

+ 6 - 6
src/views/business/spd/goal_management/AnnualSaleGoalMerge.vue

@@ -57,7 +57,7 @@
           <el-form-item label="部门" prop="dept">
             <el-popover-select-v2 v-model="queryParams.dept" title="部门" valueKey="name"
                                   referName="DEPT_PARAM"
-                                  :dataMapping="{ deptCode: 'code', dept: 'name'}"
+                                  :dataMapping="{ deptId: 'id', dept: 'name'}"
                                   :source.sync="queryParams" placeholder="请输入部门" @keyup.enter.native="handleQuery">
             </el-popover-select-v2>
           </el-form-item>
@@ -277,7 +277,7 @@
             <el-form-item label="部门" prop="dept">
               <el-popover-select-v2 v-model="form.dept" title="部门" valueKey="name"
                                     referName="DEPT_PARAM"
-                                    :dataMapping="{ deptCode: 'code', dept: 'name'}"
+                                    :dataMapping="{ deptId: 'id', dept: 'name'}"
                                     :source.sync="form" placeholder="请输入部门">
               </el-popover-select-v2>
             </el-form-item>
@@ -764,7 +764,7 @@ export default {
         annual: null,
         creatorCode: null,
         creator: null,
-        deptCode: null,
+        deptId: null,
         dept: null,
         goalCategory: null,
         goalTotal: null,
@@ -816,7 +816,7 @@ export default {
         annual: null,
         creatorCode: null,
         creator: null,
-        deptCode: null,
+        deptId: null,
         dept: null,
         goalCategory: null,
         goalTotal: null,
@@ -940,7 +940,7 @@ export default {
         annual: null,
         creatorCode: null,
         creator: null,
-        deptCode: null,
+        deptId: null,
         dept: null,
         goalCategory: null,
         goalTotal: null,
@@ -974,7 +974,7 @@ export default {
         annual: null,
         creatorCode: null,
         creator: null,
-        deptCode: null,
+        deptId: null,
         dept: null,
         goalCategory: null,
         goalTotal: null,

+ 2 - 2
src/views/business/spd/goal_management/MonthGoalMerge.vue

@@ -469,7 +469,7 @@
               </el-table-column>
             </el-table>
           </el-tab-pane>
-          <el-tab-pane label="区域目标汇总(月)" name="zoneGoalSum">
+          <el-tab-pane label="区域目标汇总(月)" name="zoneGoalSum" v-if="this.form.goalCategory == '销售区域'">
             <el-table max-height="300" :data="zoneGoalSumList">
               <el-table-column label="序号" type="index" width="55" align="center" fixed />
               <el-table-column label="销售组织" align="center" prop="saleOrg" width="180">
@@ -503,7 +503,7 @@
               </el-table-column>
             </el-table>
           </el-tab-pane>
-          <el-tab-pane label="客户目标汇总(月)" name="customGoalSum">
+          <el-tab-pane label="客户目标汇总(月)" name="customGoalSum" v-if="this.form.goalCategory == '销售区域'">
             <el-table max-height="300" :data="customGoalSumList">
               <el-table-column label="序号" type="index" width="55" align="center" fixed />
               <el-table-column label="销售组织" align="center" prop="saleOrg" width="180">

+ 4 - 0
src/views/material/basicFile/details.vue

@@ -2098,6 +2098,10 @@
             this.basicData.value['businessDepartmentName'] = '';
 
           }
+          // 物料税类materialRate
+          if (this.MoreDataDialog.target.prop == 'materialRate') {
+            this.basicData.value['rateCode'] = this.MoreDataDialog.value.code
+          }
 
           if(this.MoreDataDialog.target.prop === 'materialRate'){
             this.basicData.value.rateCode = this.MoreDataDialog.value.code;

+ 1 - 1
src/views/material/classify/index.vue

@@ -10,7 +10,7 @@
           <el-button type="primary" size="mini" plain @click="addClassify">新增</el-button>
           <el-button type="primary" size="mini" plain @click="editClassify">修改</el-button>
           <el-button type="primary" size="mini" plain @click="refreshData">{{refreshName ? '全部分类': '过滤停用'}}</el-button>
-          <el-button type="primary" size="mini" plain @click="deleteClassify">删除</el-button>
+          <!-- <el-button type="primary" size="mini" plain @click="deleteClassify">删除</el-button> -->
         </div>
       </el-row>
 

+ 3 - 1
src/views/purchase/DemandSummary/add.vue

@@ -291,7 +291,9 @@ export default {
       }).then(() => {
         this.loading = false
         this.tableList.forEach(item => {
-          item.puQtyRes = parseInt(item.puQtyRes)
+          if(item.puQtyRes) {
+            item.puQtyRes = parseFloat(item.puQtyRes).toFixed(0)
+          }
         })
       }).catch(err => {
         this.loading = false

+ 44 - 17
src/views/purchase/DemandSummary/index.vue

@@ -245,6 +245,7 @@
           height="355"
           max-height="355"
           style="font-size: 12px;"
+          :cell-class-name="cellClassName"
           @selection-change="handleSelectionChange"
           @row-click="rowSelect"
           @row-dblclick="doubleClick"
@@ -546,7 +547,12 @@ export default {
   methods: {
     reDraw() {
       this.$refs.table.doLayout();
-      console.log(111)
+    },
+    // 单元格标红
+    cellClassName({row, column, rowIndex, columnIndex}) {
+      if(column.label == "需求可用周期" && Number(row.demandCycle) > 1.5 ) {
+        return 'success-row';
+      }
     },
     // 指定列合计
     getSummaries(param) {
@@ -763,6 +769,8 @@ export default {
             this.$modal.notifySuccess("审核成功");
             this.getList(this.queryParams)
           }
+        }).catch(err => {
+          this.getList(this.queryParams)
         })
       }
     },
@@ -875,23 +883,39 @@ export default {
       this.$modal.loading("正在粘贴数据...");
       e.preventDefault() //阻止默认粘贴事件
       let source = e.clipboardData.getData("Text");
-      // 首先对源头进行解析
-      let rows = source.split("\r\n"); // 拆成一个数组
-      // 数组去除空字符串
-      rows = rows.filter(item => {
-        return item && item.trim()
-      })
-      await getRefer({ type: 'MATERIAL_PARAM', materialCodeList: rows }).then(res => {
-        this.$modal.closeLoading();
-        if (res.code === 200) {
-          let rowList = res.rows
-          console.log('粘贴的', rowList)
-          this.queryParams.materialCodeList = rowList.map(item => {return item.code})
-          this.queryParams.names = (rowList.map(item => {return item.code})).join(',')
-        }
-      }).catch(err => {
+      console.log('source', source)
+      // 这里区分普通复制和在表格内复制,判断是否包含','
+      // 没找到,就通过表格复制
+      if (source.indexOf(",") === -1) {
+        // 首先对源头进行解析
+        let rows = source.split("\r\n"); // 拆成一个数组
+        // 数组去除空字符串
+        rows = rows.filter(item => {
+          return item && item.trim()
+        })
+        await getRefer({ type: 'MATERIAL_PARAM', materialCodeList: rows }).then(res => {
+          this.$modal.closeLoading();
+          if (res.code === 200) {
+            let rowList = res.rows
+            console.log('粘贴的', rowList)
+            this.queryParams.materialCodeList = rowList.map(item => {return item.code})
+            this.queryParams.names = (rowList.map(item => {return item.code})).join(',')
+          }
+        }).catch(err => {
+          this.$modal.closeLoading();
+        })
+      } else {
+        // 找到了,按,分割
+        let codelist = source.split(',')
+        console.log('按照逗号分隔', codelist)
+        // 数组去除空字符串
+        codelist = codelist.filter(item => {
+          return item && item.trim()
+        })
+        this.queryParams.materialCodeList = codelist
+        this.queryParams.names = codelist.join(',')
         this.$modal.closeLoading();
-      })
+      }
     },
         // 明细行选择业务部门参照带出业务部门数据
     chooseSon(index, type, isPage, title) {
@@ -938,6 +962,9 @@ export default {
  ::v-deep .el-card .el-form-item {
   margin-bottom: 3px;
 }
+::v-deep .el-table__row .success-row {
+  background-color: #ff8a8a!important;
+}
 </style>
 <style>
 .exporttable {

+ 20 - 11
src/views/purchase/PurchaseDemandList/add.vue

@@ -292,7 +292,7 @@
           </ux-table-column>
           <ux-table-column resizable title="预留数量" align="center"  field="reservedQty" width="120px" edit-render>
             <template v-slot:edit="scope">
-                <el-input type="number" min="0" oninput="value=value.replace(/^(0+)|[^\d]+/g, '')" clearable :disabled="sonDisable" size="mini" v-model="scope.row.reservedQty"></el-input>
+                <el-input type="number" min="0" @input="scope.row.reservedQty=Math.ceil(scope.row.reservedQty)" clearable :disabled="sonDisable" size="mini" v-model="scope.row.reservedQty"></el-input>
             </template>
           </ux-table-column>
           <ux-table-column resizable title="集团预测分类" align="center"  field="forecastClassify" width="120px"/>
@@ -967,9 +967,12 @@ export default {
                       this.back()
                     }
                   }).catch(err => {
-                    let errorList = JSON.parse(err.message).rowList
-                    console.log(errorList)
-                    this.gainRed(errorList)
+                    // 加入定时器防止报错关不掉遮罩
+                    setTimeout(() => {
+                      let errorList = JSON.parse(err.message).rowList
+                      console.log(errorList)
+                      this.gainRed(errorList)
+                    }, 500)
                     this.$modal.closeLoading();
                   })
                 } else if (this.sonPageStu == 'edit') {
@@ -987,9 +990,12 @@ export default {
                       this.back()
                     }
                   }).catch(err => {
-                    let errorList = JSON.parse(err.message).rowList
-                    console.log(errorList)
-                    this.gainRed(errorList)
+                    // 加入定时器防止报错关不掉遮罩
+                    setTimeout(() => {
+                      let errorList = JSON.parse(err.message).rowList
+                      // console.log(errorList)
+                      this.gainRed(errorList)
+                    },500)
                     this.$modal.closeLoading();
                   })
                 }
@@ -1077,9 +1083,12 @@ export default {
           this.back()
         }
       }).catch(err => {
-        let errorList = JSON.parse(err.message).rowList
-        console.log(errorList)
-        this.gainRed(errorList)
+        // 加入定时器防止报错关不掉遮罩
+        setTimeout(() => {
+          let errorList = JSON.parse(err.message).rowList
+          console.log(errorList)
+          this.gainRed(errorList)
+        }, 500)
         this.$modal.closeLoading();
       })
     },
@@ -1845,7 +1854,7 @@ export default {
 //   top: 70%
 // }
 ::v-deep .elx-body--row .success-row {
-  background-color: #f11616!important;
+  background-color: #ff8a8a!important;
 }
 ::v-deep .uxbeautifyTableClass .elx-table--header-wrapper {
   color: #606266;

+ 2 - 0
src/views/purchase/PurchaseDemandList/index.vue

@@ -429,6 +429,8 @@ export default {
           return '已完成'
         case '3':
           return '已驳回'
+        case '9':
+          return '已回退'
       }
     },
     formatterBillType(row) {

+ 1 - 1
src/views/purchase/apply/add/columns.js

@@ -189,7 +189,7 @@ export default function useColumns() {
           item: { key: "taxPrice", title: "含税单价", required: true },
           attr: {
             is: "el-input-number",
-            min: 0,
+            min: 0.01,
             precision: CONFIG.precision,
           },
         },

+ 1 - 0
src/views/purchase/apply/add/index.vue

@@ -152,6 +152,7 @@
         const {TabColumns, TableColumns} = useColumns();
         this.visible = false;
         this.params = this.$init.params([...TabColumns, ...TableColumns]);
+        this.$emit("success");
       },
       //
       async onRowAdd(prop, pushParams = {}) {

+ 1 - 1
src/views/purchase/apply/copy/columns.js

@@ -189,7 +189,7 @@ export default function useColumns() {
           item: { key: "taxPrice", title: "含税单价", required: true },
           attr: {
             is: "el-input-number",
-            min: 0,
+            min: 0.01,
             precision: CONFIG.precision,
           },
         },

+ 1 - 0
src/views/purchase/apply/copy/index.vue

@@ -203,6 +203,7 @@ export default {
       const { TabColumns, TableColumns } = useColumns();
       this.visible = false;
       this.params = this.$init.params([...TabColumns, ...TableColumns]);
+      this.$emit("success");
     },
     //
     async onRowAdd(prop, pushParams = {}) {

+ 1 - 1
src/views/purchase/apply/edit/columns.js

@@ -189,7 +189,7 @@ export default function useColumns() {
           item: { key: "taxPrice", title: "含税单价", required: true },
           attr: {
             is: "el-input-number",
-            min: 0,
+            min: 0.01,
             precision: CONFIG.precision,
           },
         },

+ 1 - 1
src/views/purchase/apply/edit/index.vue

@@ -153,7 +153,6 @@
             updateByName: createByName,
             id: null,
           });
-          console.log('isPriceAdjustment', isPriceAdjustment)
         }
       },
       // 
@@ -215,6 +214,7 @@
         const {TabColumns, TableColumns} = useColumns();
         this.visible = false;
         this.params = this.$init.params([...TabColumns, ...TableColumns]);
+        this.$emit("success");
       },
       //
       async onRowAdd(prop, pushParams = {}) {

+ 1 - 0
src/views/purchase/apply/see/index.vue

@@ -101,6 +101,7 @@ export default {
       } = useColumns();
       this.visible = false;
       this.tabName = tabName;
+      this.$emit("success");
     },
     async jumpOA() {
       toOA(this.$store.state.user.name, this.params.flowId).then(res => {

+ 1 - 1
src/views/purchase/purchase-order/add/index.vue

@@ -70,7 +70,7 @@ export default {
     "params.billType":{
       handler(nVal, oVal){
 
-        if((nVal === '21-Cxx-02' || nVal === '21-Cxx-04'  || nVal === '21-Cxx-10')){
+        if((nVal === '21-Cxx-02' || nVal === '21-Cxx-04'  || nVal === '21-Cxx-10' || nVal === '21-Cxx-14')){
 
           this.rules.warehouseName = [
             { required: true, message: "WMS入库仓库不能为空", trigger: "change" },

+ 1 - 1
src/views/purchase/purchase-order/edit/index.vue

@@ -60,7 +60,7 @@ export default {
     "params.billType":{
       handler(nVal, oVal){
 
-        if((nVal === '21-Cxx-02' || nVal === '21-Cxx-04'  || nVal === '21-Cxx-10')){
+        if((nVal === '21-Cxx-02' || nVal === '21-Cxx-04'  || nVal === '21-Cxx-10' || nVal === '21-Cxx-14')){
 
           this.rules.warehouseName = [
             { required: true, message: "WMS入库仓库不能为空", trigger: "change" },

+ 1 - 1
src/views/purchase/workSpace/index.vue

@@ -31,7 +31,7 @@
       </div>
 
       <div class="btn_grooup">
-        <el-button type="primary" size="mini" @click="audits">批量审批</el-button>
+        <!-- <el-button type="primary" size="mini" @click="audits">批量审批</el-button> -->
       </div>
 
       <el-table