Explorar o código

Merge branch 'dev' into 'purchaseDev'

Dev20240103

See merge request new-business/drp-web!639
李园 hai 1 ano
pai
achega
81f12b9d7b

+ 7 - 0
src/api/business/spd/goal_management/monthSaleGoalDetails.js

@@ -62,4 +62,11 @@ export function getMaterialRangeList(data) {
     method: 'post',
     data: data
   })
+}
+
+export function getDeptIds() {
+  return request({
+    url: `/goal_management/monthSaleGoalDetails/getDeptIds`,
+    method: 'post'
+  })
 }

+ 7 - 3
src/views/business/ehr/ehrpm-entrance.vue

@@ -1,19 +1,22 @@
 <template>
-	<div>
+	<div v-loading="loading">
 		正在前往DRP绩效...
 	</div>
 </template>
 <script>
 	import {getWxworkUser_ehrpm,getDrpUser} from "@/api/business/ehr/wxworklogin";
-	import {setToken} from '@/utils/auth'
+	import {setToken,getToken} from '@/utils/auth'
 	export default {
 		data() {
 			return {
+				//遮罩
+      			loading: false
 			}
 		},
 		methods: {
 		},
 		async created() {
+			this.loading = true;
 			let query = this.$route.query;
 			console.log("query",query);
 			let res = await getWxworkUser_ehrpm(query.code);
@@ -27,8 +30,9 @@
 					this.$store.commit('SET_TOKEN', token)
 					this.$store.dispatch("GetInfo").then(() => {})
 					this.$store.dispatch("GenerateRoutes").then(
-						this.$router.push({ path: '/business/ehr/pm/myPm' }).catch(()=>{})
+						this.$router.push({ path: '/business/ehr/pm/myPm',replace:true}).catch(()=>{})
 					)
+					this.loading = false;
 				}
 			}
 		}

+ 1 - 1
src/views/business/ehr/pm/adjustMark/index.vue

@@ -7,7 +7,7 @@
       </div>
     </div>
     <div class="app-container" v-if="isList">
-      <el-form :model="queryParams" ref="queryForm" size="mini" :inline="true">
+      <el-form :model="queryParams" ref="queryForm" size="mini" :inline="true" @submit.native.prevent>
         <el-form-item label="员工" prop="staffName">
           <el-input
             v-model="queryParams.staffName"

+ 3 - 1
src/views/business/ehr/pm/myPm/detail.vue

@@ -298,6 +298,9 @@ export default {
     //单行明细确认
     btnRowConfirm(){
       this.rowData.asItem = this.rowData.asItem ? true : false;
+      if(this.rowData.asItem){
+        this.rowData.weight = 0;
+      }
       if(this.rowData.asItem && this.rowData.weight > 0){
         this.$modal.msgWarning("已勾选加减分项,不允许有权重!");
         return;
@@ -437,7 +440,6 @@ export default {
     },
     //选择加减分项后
     handleCheckedChange(value){
-      this.rowData.weight = 0;
     },
     //必选标识
     addRedStar(h, { column }) {

+ 15 - 3
src/views/business/ehr/pm/psnrelation/detail.vue

@@ -29,9 +29,16 @@
           <el-table-column width="300" label="评估人编码" align="center" prop="staff" />
           <el-table-column width="300" label="评估人名称" align="center">
             <template slot-scope="scope">
-              <el-popover-select-v2 size="mini" v-model="form.psnrelationItem[scope.$index].staffName" title="员工" valueKey="name"
-                referName="CONTACTS_PARAM" :dataMapping="{staff:'code',staffName: 'name'}"
-                :source.sync="form.psnrelationItem[scope.$index]">
+              <el-popover-select-v2 
+                size="mini" 
+                v-model="form.psnrelationItem[scope.$index].staffName" 
+                title="员工" 
+                valueKey="name"
+                referName="CONTACTS_PARAM" 
+                :dataMapping="{staff:'code',staffName: 'name'}"
+                :source.sync="form.psnrelationItem[scope.$index]" 
+                @change="aa"
+              >
               </el-popover-select-v2>
             </template>
           </el-table-column>
@@ -195,6 +202,11 @@ export default {
         this.$modal.msgSuccess("已经是当前页最后一条了!");
       }
     },
+    aa(val,val1){
+      console.log('val',val);
+      console.log('val1',val1);
+      console.log(this.form.psnrelationItem);
+    }
   }
 }
 </script>

+ 4 - 2
src/views/business/ehr/pm/psnrelation/index.vue

@@ -6,7 +6,7 @@
           <el-col :span="18">
             <el-form-item label="员工" prop="staffName">
               <el-input
-                v-model="queryParams.staffName"
+                v-model="queryParams.params.staffCodeOrName"
                 clearable
                 @keyup.enter.native="btnSearch"
               />
@@ -72,7 +72,9 @@ export default {
       queryParams: {
         pageNum: 1,
         pageSize: 10,
-        staffName: null,
+        params:{
+          staffCodeOrName: null,
+        },
       },
       //页面显示
       isList: true,

+ 1 - 1
src/views/business/spd/cm/customers/index.vue

@@ -529,7 +529,7 @@
       </div>
     </div>
     <AddContact v-model="isAdd0" v-if="isAdd0" :operatingState="operatingSta" :state="state" :row="rowDetail" :customersId="form.id"
-      :customersName="form.name" />
+      :customersName="form.name" :customersCode="form.code" />
 
     <AddPerson v-model="isAdd1" v-if="isAdd1" :pageStu="page" :disable="disable" :row="rowDetail" :customersId="form.id"
       :customersName="form.name" />

+ 56 - 50
src/views/business/spd/cm/customersContact/index.vue

@@ -32,7 +32,7 @@
             <dr-popover-select v-model="form.customerName" title="客户" type="CUSTOMER_PARAM_ZT" :dataMapping="{
                   customer: 'id',
                   customerName: 'name',
-                }" :source.sync="form">
+                }" :source.sync="form" :disabled="true">
             </dr-popover-select>
           </el-form-item>
         </el-col>
@@ -239,7 +239,7 @@
 
   export default {
     name: "CustomersContact",
-    props: ['operatingState', 'row', 'disable', 'state', 'customersId', 'customersName'],
+    props: ['operatingState', 'row', 'disable', 'state', 'customersId', 'customersName', 'customersCode'],
     model: {
       prop: 'isAdd0',
       event: 'jugislist'
@@ -276,7 +276,47 @@
           customerName: null,
         },
         // 表单参数
-        form: {},
+        form: {
+          id: null,
+          code: null,
+          name: null,
+          gander: null,
+          customer: null,
+          customer_name: null,
+          customer_code: null,
+          contact_classification: null,
+          birthday: null,
+          birthplace: null,
+          hobby: null,
+          state: null,
+          superior_contact_name: null,
+          superior_contact: null,
+          section: null,
+          position: null,
+          job_title: null,
+          power: null,
+          support: null,
+          field_expertise: null,
+          decision_maker: null,
+          telephone: null,
+          mail: null,
+          address: null,
+          visit_time: null,
+          visit_place: null,
+          organization: null,
+          organization_name: null,
+          area: null,
+          department: null,
+          department_name: null,
+          department_code: null,
+          create_by: null,
+          create_time: null,
+          update_by: null,
+          update_time: null,
+          del_flag: null,
+          bo_id: null,
+          zt_id: null
+        },
         // 表单校验
         rules: {
           name: [{
@@ -349,61 +389,28 @@
       };
     },
     created() {
-      if (this.operatingState == 'Browse') {
-        this.handleBrowse(this.row);
-      } else if (this.operatingState == 'Update') {
-        this.handleUpdate(this.row);
-      }
+      this.initialization();
     },
     methods: {
+      // 初始化
+      initialization() {
+        // 客户数据赋值
+        this.form.customer = this.customersId;
+        this.form.customerCode = this.customersCode;
+        this.form.customerName = this.customersName;
+        if (this.operatingState == 'Browse') {
+          this.handleBrowse(this.row);
+        } else if (this.operatingState == 'Update') {
+          this.handleUpdate(this.row);
+        }
+      },
       // 取消按钮
       cancel() {
         this.$emit('jugislist', false);
       },
-      // 表单重置
-      reset() {
-        this.form = {
-          boId: null,
-          delFlag: null,
-          updateTime: null,
-          updateBy: null,
-          createDate: null,
-          createBy: null,
-          departmentName: null,
-          departmentCode: null,
-          area: null,
-          organization: null,
-          visitPlace: null,
-          visitTime: null,
-          address: null,
-          mail: null,
-          telephone: null,
-          decisionMaker: null,
-          fieldExpertise: null,
-          support: null,
-          power: null,
-          jobTitle: null,
-          position: null,
-          section: null,
-          superiorContact: null,
-          state: null,
-          hobby: null,
-          birthplace: null,
-          birthday: null,
-          contactClassification: null,
-          customerName: null,
-          customerCode: null,
-          gander: null,
-          name: null,
-          code: null,
-          id: null
-        };
-        this.resetForm("form");
-      },
       /** 修改按钮操作 */
       handleUpdate(row) {
         this.operatingState = "Update";
-        this.reset();
         const id = row.id || this.ids
         getContact(id).then(response => {
           this.form = response.data;
@@ -412,7 +419,6 @@
       },
       /** 查看按钮操作 */
       handleBrowse(row) {
-        this.reset();
         const id = row.id || this.ids
         getContact(id).then(response => {
           this.form = response.data;

+ 13 - 8
src/views/business/spd/cm/customersDepartment/index.vue

@@ -110,7 +110,7 @@
         form: {
           id: null,
           name: null,
-          customersName: this.customersName,
+          customersName: null,
           responsiblePerson: null,
           responsiblePersonName: null,
           phone: null,
@@ -150,15 +150,20 @@
       };
     },
     created() {
-      // 客户主键赋值
-      this.form.customersId = this.customersId;
-      if (this.pageStu == 'check' || this.pageStu == 'update') {
-        this.getDetails(this.row);
-      }
-      // 获取当前登录用户的编码
-      this.operator = this.$store.state.user.name;
+      this.initialization();
     },
     methods: {
+      // 初始化
+      initialization() {
+        // 客户数据赋值
+        this.form.customersId = this.customersId;
+        this.form.customersName = this.customersName;
+        if (this.pageStu == 'check' || this.pageStu == 'update') {
+          this.getDetails(this.row);
+        }
+        // 获取当前登录用户的编码
+        this.operator = this.$store.state.user.name;
+      },
       // 取消按钮
       cancel() {
         this.$emit('jugislist', false);

+ 11 - 6
src/views/business/spd/cm/customersResponsiblePerson/index.vue

@@ -97,7 +97,7 @@
           id: null,
           person: null,
           personName: null,
-          customersName: this.customersName,
+          customersName: null,
           relationshipType: null,
           productionLine: null,
           startDate: null,
@@ -137,13 +137,18 @@
       };
     },
     created() {
-      // 客户主键赋值
-      this.form.customersId = this.customersId;
-      if (this.pageStu == 'check' || this.pageStu == 'update') {
-        this.getDetails(this.row);
-      }
+      this.initialization();
     },
     methods: {
+      // 初始化
+      initialization() {
+        // 客户主键赋值
+        this.form.customersId = this.customersId;
+        this.form.customersName = this.customersName;
+        if (this.pageStu == 'check' || this.pageStu == 'update') {
+          this.getDetails(this.row);
+        }
+      },
       // 取消按钮
       cancel() {
         this.$emit('jugislist', false);

+ 62 - 32
src/views/business/spd/target/MonthSaleGoal.vue

@@ -163,7 +163,7 @@
           </el-col>
           <el-col :span="6">
             <el-form-item label="单据日期" prop="documentDate">
-              <el-date-picker clearable v-model="form.documentDate" type="date" value-format="yyyy-MM-dd"
+              <el-date-picker clearable v-model="form.documentDate" type="date" value-format="yyyy-MM-dd" @change="setItemMonthly"
                 placeholder="请选择单据日期">
               </el-date-picker>
             </el-form-item>
@@ -305,7 +305,8 @@
                 <el-table-column label="一级分类" align="center" min-width="200" :render-header="addRedStar">
                   <template slot-scope="scope">
                     <el-select v-model="monthSaleGoalDetailsList[scope.$index].oneLevelClassify" clearable
-                      @focus="chooseTreeReferForMain('MATERIALCLASSIFY_PARAM', false, '一级物料分类', scope.$index)" :disabled="!isDept">
+                      @focus="chooseTreeReferForMain('MATERIALCLASSIFY_PARAM', false, '一级物料分类', scope.$index)"
+                      :disabled="!isDept">
                       <el-option v-for="item in classOptions" :key="item.id" :label="item.name" :value="item.code" />
                     </el-select>
                   </template>
@@ -313,7 +314,8 @@
                 <el-table-column label="二级分类" align="center" min-width="200" :render-header="addRedStar">
                   <template slot-scope="scope">
                     <el-select v-model="monthSaleGoalDetailsList[scope.$index].twoLevelClassify" clearable
-                      @focus="chooseTreeReferForMain('MATERIALCLASSIFY_PARAM', false, '二级物料分类', scope.$index)" :disabled="!isDept">
+                      @focus="chooseTreeReferForMain('MATERIALCLASSIFY_PARAM', false, '二级物料分类', scope.$index)"
+                      :disabled="!isDept">
                       <el-option v-for="item in classOptions" :key="item.id" :label="item.name" :value="item.code" />
                     </el-select>
                   </template>
@@ -332,10 +334,12 @@
                     </el-tooltip>
                   </template>
                 </el-table-column>
-                <el-table-column label="科室" align="center" prop="department" min-width="200">
+                <el-table-column label="科室" align="center" min-width="200">
                   <template slot-scope="scope">
-                    <el-select v-model.trim="monthSaleGoalDetailsList[scope.$index].department" placeholder="请选择科室" filterable>
-                      <el-option v-for="dict in dict.type.mk_bo_section" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
+                    <el-select v-model.trim="monthSaleGoalDetailsList[scope.$index].department" placeholder="请选择科室"
+                      filterable>
+                      <el-option v-for="dict in dict.type.mk_bo_section" :key="dict.value" :label="dict.label"
+                        :value="dict.value"></el-option>
                     </el-select>
                   </template>
                 </el-table-column>
@@ -347,21 +351,24 @@
                 </el-table-column>
                 <el-table-column label="月份" align="center" min-width="250">
                   <template slot-scope="scope">
-                    <el-date-picker v-model="monthSaleGoalDetailsList[scope.$index].monthly" value-format="yyyy-MM" disabled
-                      type="month" placeholder="选择月份">
+                    <el-date-picker v-model="monthSaleGoalDetailsList[scope.$index].monthly" value-format="yyyy-MM"
+                      disabled type="month" placeholder="选择月份">
                     </el-date-picker>
                   </template>
                 </el-table-column>
-                <el-table-column label="销售目标值(元)" align="center" prop="goalValue" min-width="220" :render-header="addRedStar">
+                <el-table-column label="销售目标值(元)" align="center" prop="goalValue" min-width="220"
+                  :render-header="addRedStar">
                   <template slot-scope="scope">
                     <el-input-number @change="computeTotal" v-model="monthSaleGoalDetailsList[scope.$index].goalValue"
                       :precision="2" :step="1" :min="0"></el-input-number>
                   </template>
                 </el-table-column>
-                <el-table-column label="利润目标值(元)" align="center" prop="profitTargetValue" min-width="220" :render-header="addRedStar" v-if="isDept">
+                <el-table-column label="利润目标值(元)" align="center" prop="profitTargetValue" min-width="220"
+                  :render-header="addRedStar" v-if="isDept">
                   <template slot-scope="scope">
-                    <el-input-number @change="computeTotal" v-model="monthSaleGoalDetailsList[scope.$index].profitTargetValue"
-                      :precision="2" :step="1" :min="0"></el-input-number>
+                    <el-input-number @change="computeTotal"
+                      v-model="monthSaleGoalDetailsList[scope.$index].profitTargetValue" :precision="2" :step="1"
+                      :min="0"></el-input-number>
                   </template>
                 </el-table-column>
                 <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120px"
@@ -448,7 +455,7 @@
         <el-button type="primary" @click="dialogUpdateMoreSave">确 定</el-button>
       </div>
     </el-dialog>
-  <TreeRefers ref="treeMain" @doSubmit="selectionsToInputForMain" :single="true" />
+    <TreeRefers ref="treeMain" @doSubmit="selectionsToInputForMain" :single="true" />
   </div>
 </template>
 
@@ -465,7 +472,8 @@
     getMonthSaleGoalDetails,
     delMonthSaleGoalDetails,
     importData,
-    getMaterialRangeList
+    getMaterialRangeList,
+    getDeptIds
   } from "@/api/business/spd/goal_management/monthSaleGoalDetails"
   import {
     getToken
@@ -844,9 +852,9 @@
           material: null,
           department: null,
           num: null,
-          monthly: new Date().getFullYear().toString() + '-' + (new Date().getMonth() + 1).toString().padStart(2,
-            '0'),
-          goalValue: 0
+          monthly: this.form.documentDate.substring(0, 7),
+          goalValue: 0,
+          profitTargetValue: 0
         }
         this.monthSaleGoalDetailsList.push(list)
         this.computeTotal()
@@ -906,6 +914,11 @@
           this.monthSaleGoalDetailsList[i].dept = this.form.dept;
           this.monthSaleGoalDetailsList[i].creator = this.form.creator;
         }
+        console.log(this.form, 'form');
+        if (this.form.saleZone == null || this.form.saleZone == undefined || this.form.saleZone == '' || this.form
+          .custom == null || this.form.custom == undefined) {
+          return this.$message.error('主表中有必填字段未填!')
+        }
         if (this.justiceDetailsList()) {
           return this.$message.error('子表中第' + this.text + '行有必填字段未填,或者目标值为0')
         }
@@ -927,7 +940,7 @@
                 this.$modal.msgSuccess("修改成功");
                 this.open = false;
                 this.getList();
-              }).finally( e =>{
+              }).finally(e => {
                 this.$modal.closeLoading();
               });
             } else {
@@ -939,7 +952,7 @@
                 this.$modal.msgSuccess("新增成功");
                 this.open = false;
                 this.getList();
-              }).finally( e =>{
+              }).finally(e => {
                 this.$modal.closeLoading();
               });
             }
@@ -1012,7 +1025,8 @@
           department: row.department,
           num: row.num,
           monthly: row.monthly,
-          goalValue: row.goalValue
+          goalValue: row.goalValue,
+          profitTargetValue: row.profitTargetValue
         }
         this.monthSaleGoalDetailsList.push(list)
         this.computeTotal()
@@ -1045,11 +1059,11 @@
         column
       }) {
         if (this.isDept) {
-          return[
+          return [
             h('span', '' + column.label)
           ]
         } else {
-        return [
+          return [
             h('span', {
               style: 'color: #F56C6C'
             }, '*'),
@@ -1068,7 +1082,8 @@
               element.dept !== null) && (element.creator !== null) && (element.oneLevelClassify !== null) && (element
               .oneLevelClassifyCode !== null) && (element.monthly !== null) && (element.goalValue !== 0);
             const flag2 = (element.saleOrg !== undefined) && (element.saleZone !== undefined) && (element.custom !==
-              undefined) && (element.dept !== undefined) && (element.creator !== undefined) && (element.oneLevelClassify !==
+              undefined) && (element.dept !== undefined) && (element.creator !== undefined) && (element
+              .oneLevelClassify !==
               undefined) && (element.oneLevelClassifyCode !== undefined) && (element.monthly !== undefined);
             if (flag1 && flag2) {
               isFlag.push(true);
@@ -1089,7 +1104,8 @@
               element.dept !== null) && (element.creator !== null) && (element.materialCode !== null) && (element
               .material !== null) && (element.monthly !== null) && (element.goalValue !== 0);
             const flag2 = (element.saleOrg !== undefined) && (element.saleZone !== undefined) && (element.custom !==
-              undefined) && (element.dept !== undefined) && (element.creator !== undefined) && (element.materialCode !==
+              undefined) && (element.dept !== undefined) && (element.creator !== undefined) && (element
+              .materialCode !==
               undefined) && (element.material !== undefined) && (element.monthly !== undefined);
             if (flag1 && flag2) {
               isFlag.push(true);
@@ -1180,7 +1196,8 @@
         const oneArray = one.split("&")
         const twoArray = two.split("&")
         // 物料提醒文本
-        const memo = '名称:' + row.material + '; 编码:' + row.materialCode + '; 规格:' + row.specification + ';  包装:' + row.packExplain + '; 型号:' + row.model + '。';
+        const memo = '名称:' + row.material + '; 编码:' + row.materialCode + '; 规格:' + row.specification + ';  包装:' + row
+          .packExplain + '; 型号:' + row.model + '。';
         obj.memo = memo;
         obj.oneLevelClassifyCode = oneArray[1]
         obj.oneLevelClassify = oneArray[0]
@@ -1309,8 +1326,7 @@
             item.custom = this.form.custom;
             item.dept = this.form.dept;
             item.creator = this.form.creator;
-            item.monthly = new Date().getFullYear().toString() + '-' + (new Date().getMonth() + 1).toString()
-              .padStart(2, '0');
+            item.monthly = this.form.documentDate.substring(0, 7);
           }
         }).catch((e) => {
           this.$message.error(e.message)
@@ -1319,13 +1335,21 @@
         })
       },
       calculate(row) {
-        row.goalValue = row.num * row.price;
+        if (!(row.price == 0 || row.price == null || row.price == undefined)) {
+          row.goalValue = row.num * row.price;
+        }
       },
+      // 判断操作人部门是否属于湖南公司、湖南公司本部
       judge() {
-        this.isDept = false;
-        if (this.$store.state.user.deptName.indexOf('湖南公司') >= 0) {
-          this.isDept = true;
-        }
+        let that = this;
+        that.isDept = false;
+        getDeptIds().then(res => {
+          for (const r of res) {
+            if (that.$store.state.user.deptId === r) {
+              that.isDept = true;
+            }
+          }
+        })
       },
       // 树形参照
       chooseTreeReferForMain(type, isPage, title, index) {
@@ -1355,6 +1379,12 @@
           }
         }
       },
+      // 当单据日期改变时改变明细月份
+      setItemMonthly() {
+        for (let i = 0; i < this.monthSaleGoalDetailsList.length; i++) {
+          this.monthSaleGoalDetailsList[i].monthly = this.form.documentDate.substring(0, 7);
+        }
+      },
     }
   }
 

+ 28 - 0
src/views/business/spd/target/targetMk/add.vue

@@ -113,6 +113,7 @@ export default {
     return {
       template:{},
       form:{
+        date: this.formatDateTime(new Date(), 'yyyy-MM-dd'),
         template: null,
       },
       //表单校验
@@ -240,6 +241,33 @@ export default {
         }
       })
     },
+    // 日期名称格式化
+    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;
+    },
   }
 }
 </script>

+ 1 - 1
src/views/business/spd/target/targetMk/item.vue

@@ -30,7 +30,7 @@
               />
               <el-popover-tree-select 
                 size="mini" 
-                v-else-if="scope.row[head.prop].model == 'MATERIALCLASSIFY_PARAM' || scope.row[head.prop].model == 'PROFITCENTER'"
+                v-else-if="scope.row[head.prop].model == 'MATERIALCLASSIFY_PARAM' || scope.row[head.prop].model == 'PROFITCENTER' || scope.row[head.prop].model == 'PRODUCTLINE'"
                 v-model="scope.row[head.prop].valueName" 
                 valueKey='name'
                 title="参照选择" 

+ 6 - 12
src/views/material/label/index.vue

@@ -1,19 +1,13 @@
 <script>
-import LabelTable from "./label-table.vue";
-import LabelAddDialog from "./label-add-dialog.vue";
-import LabelEditDialog from "./label-edit-dialog.vue";
-import LabelBindDialog from "./label-bind-dialog.vue";
-import LabelAutoBindDialog from "./label-auto-bind-dialog.vue";
-import LabelHandBindDialog from "./label-hand-bind-dialog.vue";
 export default {
   name: "MaterialLabel",
   components: {
-    LabelTable,
-    LabelAddDialog,
-    LabelEditDialog,
-    LabelBindDialog,
-    LabelAutoBindDialog,
-    LabelHandBindDialog,
+    LabelTable: () => import("./label-table.vue"),
+    LabelAddDialog: () => import("./label-add-dialog.vue"),
+    LabelEditDialog: () => import("./label-edit-dialog.vue"),
+    LabelBindDialog: () => import("./label-bind-dialog.vue"),
+    LabelAutoBindDialog: () => import("./label-auto-bind-dialog.vue"),
+    LabelHandBindDialog: () => import("./label-hand-bind-dialog.vue"),
   },
   data() {
     return {};

+ 6 - 19
src/views/material/label/label-table.vue

@@ -102,16 +102,6 @@ export default {
       this.fetchList();
     },
 
-    onSizeChange(prop) {
-      this.page.pageSize = prop;
-      this.fetchList();
-    },
-
-    onNumberChange(prop) {
-      this.page.pageNum = prop;
-      this.fetchList();
-    },
-
     onBindLabel(prop) {
       this.$parent.$children
         .find((el) => el.$vnode.tag.indexOf("BindDialog") > -1)
@@ -247,16 +237,13 @@ export default {
       </el-table>
     </el-main>
     <el-footer>
-      <el-pagination
-        @size-change="onSizeChange"
-        @current-change="onNumberChange"
-        :current-page="page.pageNum"
-        :page-sizes="[25, 50, 100]"
-        :page-size="page.pageSize"
-        layout="total, prev, pager, next, sizes, jumper"
+      <pagination
         :total="page.total"
-      >
-      </el-pagination>
+        :page.sync="page.pageNum"
+        :limit.sync="page.pageSize"
+        @pagination="fetchList"
+        style="height: 32px; padding: 0 !important; flex: 1; overflow-x: auto"
+      />
     </el-footer>
   </el-container>
 </template>

+ 14 - 13
src/views/purchase/PurchaseDemandList/index.vue

@@ -440,20 +440,21 @@ export default {
       this.params = this.$init.params(SearchColumns);
       this.getList(this.params, this.Pages);
     },
-    getList(params, pages) {
-      getDemandList({ ...params, ...pages })
-        .then((res) => {
-          if (res.code === 200) {
-            this.tableList = res.rows;
-            this.Pages.total = res.total;
-          }
-        })
-        .then(() => {
-          this.loading = false;
-        })
-        .catch((err) => {
-          this.loading = false;
+    async getList(params, pages) {
+      try {
+        this.loading = true;
+        let { code, rows, total } = await getDemandList({
+          ...params,
+          ...pages,
         });
+        if (code === 200) {
+          this.tableList = rows;
+          this.Pages.total = total;
+        }
+      } catch (error) {
+      } finally {
+        this.loading = false;
+      }
     },
     handleSelectionChange(selection) {
       this.ids = selection.map((item) => item.id);