zh 2 lat temu
rodzic
commit
777361a633

+ 107 - 97
src/views/sales_policy/components/AddCondition.vue

@@ -1,24 +1,26 @@
 <template>
   <el-container class="">
     <el-header height="20px">
-      <el-page-header @back="handleBack" :content="content"> </el-page-header>
-    </el-header> 
+      <el-page-header :content="content" @back="handleBack" />
+    </el-header>
     <div class="line">
-      <el-divider></el-divider>
+      <el-divider />
       <h4>限定条件</h4>
-      <el-divider></el-divider>
+      <el-divider />
     </div>
     <el-main v-if="!id">
       <el-row v-if="conditionBox.length">
         <el-row :gutter="50">
-          <el-col :xs="24" :sm="24" :lg="24" class="mgb" v-for="(item, index) in conditionBox" :key="index">
+          <el-col v-for="(item, index) in conditionBox" :key="index" :xs="24" :sm="24" :lg="24" class="mgb">
             <h5 v-if="index == 0">限定机型</h5>
             <h5 v-if="index > 0">配提机型</h5>
             <el-row>
               <el-row class="pdt">
-                <el-button type="primary" size="mini" @click=";(VisibleModle = true), getMaterialLists(index)"
-                  >添加机型</el-button
-                >
+                <el-button
+                  type="primary"
+                  size="mini"
+                  @click=";(VisibleModle = true), getMaterialLists(index)"
+                >添加机型</el-button>
 
                 <el-button type="primary" size="mini" @click="handleDeleteRow(index)">删除机型</el-button>
               </el-row>
@@ -31,16 +33,16 @@
                   @select="hanleSelectAll($event, index)"
                   @select-all="hanleSelectAll($event, index)"
                 >
-                  <el-table-column type="selection" width="55" align="left"> </el-table-column>
+                  <el-table-column type="selection" width="55" align="left" />
                   <el-table-column label="产品名称" width="300" show-overflow-tooltip align="left" prop="materialName">
                     <template slot-scope="scope">
-                      <CopyButton :copyText="scope.row.materialName" />
+                      <CopyButton :copy-text="scope.row.materialName" />
                       <span>{{ scope.row.materialName }}</span>
                     </template>
                   </el-table-column>
                   <el-table-column prop="specification" show-overflow-tooltip label="规格型号" align="left">
                     <template slot-scope="scope">
-                      <CopyButton :copyText="scope.row.specification" />
+                      <CopyButton :copy-text="scope.row.specification" />
                       <span>{{ scope.row.specification }}</span>
                     </template>
                   </el-table-column>
@@ -52,44 +54,44 @@
         <el-row>
           <el-form label-width="120px" :inline="false" size="mini">
             <el-row>
-              <el-form-item label="配置比例设置"> </el-form-item>
+              <el-form-item label="配置比例设置" />
             </el-row>
             <el-col :xs="24" :sm="8" :lg="8">
               <el-form-item label="限定机型">
-                <el-input size="mini" v-model="limit"></el-input>
+                <el-input v-model="limit" size="mini" />
               </el-form-item>
             </el-col>
 
-            <el-col :xs="24" :sm="8" :lg="8" v-for="(len, index) in conditionBox.length - 1">
+            <el-col v-for="(len, index) in conditionBox.length - 1" :xs="24" :sm="8" :lg="8">
               <el-form-item :label="'配提' + (index + 1) + '比例'">
-                <el-input size="mini" v-model="popArr['line_' + index]"></el-input>
+                <el-input v-model="popArr['line_' + index]" size="mini" />
               </el-form-item>
             </el-col>
           </el-form>
         </el-row>
-        <el-divider></el-divider>
+        <el-divider />
       </el-row>
     </el-main>
     <el-main v-else>
       <el-row>
         <el-row :gutter="50">
-          <el-col :xs="24" :sm="24" :lg="24" class="mgb" v-for="(item, index) in conditionBoxs" :key="index">
+          <el-col v-for="(item, index) in conditionBoxs" :key="index" :xs="24" :sm="24" :lg="24" class="mgb">
             <h5 v-if="index == 0">限定机型</h5>
             <h5 v-if="index > 0">配提机型</h5>
             <el-row>
               <el-row class="table">
                 <el-table style="width: 100%" :data="item" border>
-                  <el-table-column type="selection" width="55" align="left" v-if="!id"> </el-table-column>
-                  <el-table-column type="index" label="序号" width="55" align="left" v-else> </el-table-column>
+                  <el-table-column v-if="!id" type="selection" width="55" align="left" />
+                  <el-table-column v-else type="index" label="序号" width="55" align="left" />
                   <el-table-column label="产品名称" width="300" align="left" prop="materialName">
                     <template slot-scope="scope">
-                      <CopyButton :copyText="scope.row.materialName" />
+                      <CopyButton :copy-text="scope.row.materialName" />
                       <span>{{ scope.row.materialName }}</span>
                     </template>
                   </el-table-column>
                   <el-table-column prop="specification" label="规格型号" show-overflow-tooltip align="left">
                     <template slot-scope="scope">
-                      <CopyButton :copyText="scope.row.specification" />
+                      <CopyButton :copy-text="scope.row.specification" />
                       <span>{{ scope.row.specification }}</span>
                     </template>
                   </el-table-column>
@@ -101,28 +103,27 @@
         <el-row v-if="conditionBoxs.length">
           <el-form label-width="120px" :inline="false" size="mini">
             <el-row>
-              <el-form-item label="配置比例设置"> </el-form-item>
+              <el-form-item label="配置比例设置" />
             </el-row>
             <el-col :xs="24" :sm="8" :lg="8">
               <el-form-item label="限定机型">
-                <el-input size="mini" v-model="limit" :readonly="!id ? false : true"></el-input>
+                <el-input v-model="limit" size="mini" :readonly="!id ? false : true" />
               </el-form-item>
             </el-col>
 
-            <el-col :xs="24" :sm="8" :lg="8" v-for="(len, index) in conditionBoxs.length - 1">
+            <el-col v-for="(len, index) in conditionBoxs.length - 1" :xs="24" :sm="8" :lg="8">
               <el-form-item :label="'配提' + (index + 1) + '比例'">
-                <el-input size="mini" :readonly="!id ? false : true" v-model="popArr['line_' + index]"></el-input>
+                <el-input v-model="popArr['line_' + index]" size="mini" :readonly="!id ? false : true" />
               </el-form-item>
             </el-col>
           </el-form>
-          <el-col class="text_rihgt" v-if="false">
-            <el-button type="primary" size="mini" @click="">添加限定条件</el-button></el-col
-          >
+          <el-col v-if="false" class="text_rihgt">
+            <el-button type="primary" size="mini" @click="">添加限定条件</el-button></el-col>
         </el-row>
-        <el-divider></el-divider>
+        <el-divider />
       </el-row>
     </el-main>
-    <el-footer height="100px" v-if="!id">
+    <el-footer v-if="!id" height="100px">
       <el-row :gutter="20">
         <el-col :xs="24" :sm="12" :lg="12" :offset="0">
           <el-button type="primary" size="mini" @click="handleSubmit">保存</el-button>
@@ -138,8 +139,8 @@
       append-to-body
       width="80%"
       center
-      @close="handleClose"
       :close-on-click-modal="false"
+      @close="handleClose"
     >
       <div>
         <el-container>
@@ -147,7 +148,7 @@
             <el-form label-width="0" :inline="false" size="mini">
               <el-col :xs="24" :sm="10" :lg="10" :offset="0">
                 <el-form-item label="">
-                  <el-input v-model="saleTypeCode" placeholder="类型编号"></el-input>
+                  <el-input v-model="saleTypeCode" placeholder="类型编号" />
                 </el-form-item>
               </el-col>
               <el-col :xs="24" :sm="10" :lg="10" :offset="1">
@@ -162,7 +163,7 @@
               <el-row :gutter="50">
                 <el-col :xs="10" :ms="10" :lg="10">
                   <el-row>
-                    <el-row> </el-row>
+                    <el-row />
                     <el-row class="table">
                       <el-row class="title"> 可选产品列表 </el-row>
                       <el-table
@@ -174,8 +175,7 @@
                         @select-all="handleSelectionAllChange"
                         @selection-change="handleSelectionChange"
                       >
-                        <el-table-column type="selection" width="55" :selectable="selectable" align="left">
-                        </el-table-column>
+                        <el-table-column type="selection" width="55" :selectable="selectable" align="left" />
                         <el-table-column
                           label="产品编码"
                           prop="materialNumber"
@@ -184,7 +184,7 @@
                           align="left"
                         >
                           <template slot-scope="scope">
-                            <CopyButton :copyText="scope.row.materialNumber" />
+                            <CopyButton :copy-text="scope.row.materialNumber" />
                             <span>{{ scope.row.materialNumber }}</span>
                           </template>
                         </el-table-column>
@@ -196,7 +196,7 @@
                           align="left"
                         >
                           <template slot-scope="scope">
-                            <CopyButton :copyText="scope.row.materialName" />
+                            <CopyButton :copy-text="scope.row.materialName" />
                             <span>{{ scope.row.materialName }}</span>
                           </template>
                         </el-table-column>
@@ -208,7 +208,7 @@
                           align="left"
                         >
                           <template slot-scope="scope">
-                            <CopyButton :copyText="scope.row.specification" />
+                            <CopyButton :copy-text="scope.row.specification" />
                             <span>{{ scope.row.specification }}</span>
                           </template>
                         </el-table-column>
@@ -218,19 +218,18 @@
                           min-width="160"
                           show-overflow-tooltip
                           align="right"
-                        >
-                        </el-table-column>
+                        />
                       </el-table>
                       <el-row class="mg">
                         <div>
                           <el-pagination
-                            @size-change="handleSizeChange"
-                            @current-change="handleCurrentChange"
                             :current-page="currentPage"
                             :page-size.sync="mySize"
                             :page-sizes="[10, 20, 30, 50]"
                             layout="total, sizes, prev, pager, next, jumper"
                             :total="listTotal"
+                            @size-change="handleSizeChange"
+                            @current-change="handleCurrentChange"
                           />
                         </div>
                       </el-row>
@@ -240,39 +239,47 @@
                 <el-col :xs="4" :ms="4" :lg="4" class="middle">
                   <el-row :gutter="20" justify="center" align="middle">
                     <el-row class="btn">
-                      <el-button type="primary" size="small " @click="handleAllAdd" :disabled="type == 2"
-                        >全部添加</el-button
-                      >
+                      <el-button
+                        type="primary"
+                        size="small "
+                        :disabled="type == 2"
+                        @click="handleAllAdd"
+                      >全部添加</el-button>
                     </el-row>
                     <el-row class="btn">
-                      <el-button type="primary" size="small " @click="handleAdd" :disabled="type == 2">增加</el-button>
+                      <el-button type="primary" size="small " :disabled="type == 2" @click="handleAdd">增加</el-button>
                     </el-row>
                     <el-row class="btn">
-                      <el-button type="primary" size="small " @click="handleDelete" :disabled="type == 1"
-                        >删除</el-button
-                      ></el-row
-                    >
-                    <el-row class="btn"
-                      ><el-button :disabled="type == 1" type="primary" size="small  " @click="handleAllDelete"
-                        >全部删除</el-button
-                      ></el-row
-                    >
+                      <el-button
+                        type="primary"
+                        size="small "
+                        :disabled="type == 1"
+                        @click="handleDelete"
+                      >删除</el-button></el-row>
+                    <el-row
+                      class="btn"
+                    ><el-button
+                      :disabled="type == 1"
+                      type="primary"
+                      size="small  "
+                      @click="handleAllDelete"
+                    >全部删除</el-button></el-row>
                   </el-row>
                 </el-col>
                 <el-col :xs="10" :ms="10" :lg="10">
                   <el-row>
-                    <el-row> </el-row>
+                    <el-row />
                     <el-row class="table">
                       <el-row class="title"> 已选产品列表 </el-row>
                       <el-table
                         style="width: 100%"
                         :data="conditList2"
-                        @select-all="handleSelectionAllChange2"
-                        @selection-change="handleSelectionChange2"
                         border
                         height="400"
+                        @select-all="handleSelectionAllChange2"
+                        @selection-change="handleSelectionChange2"
                       >
-                        <el-table-column type="selection" width="55" align="left"> </el-table-column>
+                        <el-table-column type="selection" width="55" align="left" />
                         <el-table-column
                           label="产品编码"
                           prop="materialNumber"
@@ -281,7 +288,7 @@
                           align="left"
                         >
                           <template slot-scope="scope">
-                            <CopyButton :copyText="scope.row.materialNumber" />
+                            <CopyButton :copy-text="scope.row.materialNumber" />
                             <span>{{ scope.row.materialNumber }}</span>
                           </template>
                         </el-table-column>
@@ -293,7 +300,7 @@
                           align="left"
                         >
                           <template slot-scope="scope">
-                            <CopyButton :copyText="scope.row.materialName" />
+                            <CopyButton :copy-text="scope.row.materialName" />
                             <span>{{ scope.row.materialName }}</span>
                           </template>
                         </el-table-column>
@@ -305,7 +312,7 @@
                           align="left"
                         >
                           <template slot-scope="scope">
-                            <CopyButton :copyText="scope.row.specification" />
+                            <CopyButton :copy-text="scope.row.specification" />
                             <span>{{ scope.row.specification }}</span>
                           </template>
                         </el-table-column>
@@ -315,8 +322,7 @@
                           min-width="160"
                           show-overflow-tooltip
                           align="right"
-                        >
-                        </el-table-column>
+                        />
                       </el-table>
                       <el-row class="mg">
                         <!-- <Pagination /> -->
@@ -335,8 +341,7 @@
             VisibleModle = false
             handleClose()
           "
-          >取 消</el-button
-        >
+        >取 消</el-button>
         <el-button type="primary" @click="handleDiaSubmit">确 定</el-button>
       </span>
     </el-dialog>
@@ -367,36 +372,25 @@ export default {
       type: String,
       default: ''
     },
-    isShow:{
+    isShow: {
       type: Number,
+      default: null
     },
-    isFlag:{
-      type: [Number,String],
-    },
-    isEdit:{
-      type: [Number,String],
-    },
-    isCondition:{
-      type: [Number,String],
+    isFlag: {
+      type: [Number, String],
+      default: null
     },
-    code:{
-      type: [Number,String],
+    isEdit: {
+      type: [Number, String],
+      default: null
     },
-  },
-  watch: {
-    conditList: {
-      handler(newValue, oldValue) {
-        this.conditList = newValue
-      },
-      immediate: true,
-      deep: true
+    isCondition: {
+      type: [Number, String],
+      default: null
     },
-    conditList2: {
-      handler(newValue, oldValue) {
-        this.conditList2 = newValue
-      },
-      immediate: true,
-      deep: true
+    code: {
+      type: [Number, String],
+      default: null
     }
   },
 
@@ -448,6 +442,22 @@ export default {
       listLoadingArr: {}
     }
   },
+  watch: {
+    conditList: {
+      handler(newValue, oldValue) {
+        this.conditList = newValue
+      },
+      immediate: true,
+      deep: true
+    },
+    conditList2: {
+      handler(newValue, oldValue) {
+        this.conditList2 = newValue
+      },
+      immediate: true,
+      deep: true
+    }
+  },
   created() {
     this.getCommonApi()
   },
@@ -457,7 +467,7 @@ export default {
     content() {
       const textArr = ['新增条件', '编辑条件', '条件详情']
       const isShow = this.isShow - 2
-      let len = isShow ? 2 : isShow
+      const len = isShow ? 2 : isShow
       return textArr[len]
     }
   }),
@@ -479,7 +489,7 @@ export default {
      * @param {String} index - 索引值
      * @return Boolean
      */
-    selectable: function (row, index) {
+    selectable: function(row, index) {
       // row.disabled == undefined 才能被选中
       if (row.disabled == undefined) {
         return true
@@ -504,7 +514,7 @@ export default {
         })
         console.log()
         this.pop = res.data.pop
-        let pop = res.data.pop.split(':')
+        const pop = res.data.pop.split(':')
         this.conditionBox = []
         for (let i = 0; i < pop.length; i++) {
           if (i == 0) {
@@ -582,8 +592,8 @@ export default {
         this.limit = ''
         this.pop = ''
         this.popArr = {}
-        this.isFlag = 1
-        // Object.assign(this.$data, this.$options.data());
+        // this.isFlag = 1
+        Object.assign(this.$data, this.$options.data())
         this.$emit('back')
         this.$emit('handleSubmitCon', this.code || this.comCode)
       })
@@ -723,7 +733,7 @@ export default {
       this.conditList2 = [...new Set([...this.conditList2, ...this.leftData])]
       this.$refs.multipleTable.clearSelection()
     },
-    //去掉相同数据
+    // 去掉相同数据
     resArr(arr1, arr2) {
       return arr1.filter(v => arr2.every(val => val.id != v.id))
     },

+ 6 - 2
src/views/sales_policy/components/AddPolicy.vue

@@ -474,7 +474,7 @@
         </div>
       </div>
     </div>
-    <AddCondition v-show="isCondition == 1" :code="searchForm.code" :is-show="isShow" :is-flag="isFlag" :is-condition="isCondition" @handleSubmitCon="handleSubmitCon" @back="handleBack" />
+    <AddCondition v-show="isCondition == 1" ref="condition" :code="searchForm.code" :is-show="isShow" :is-flag="isFlag" :is-condition="isCondition" @handleSubmitCon="handleSubmitCon" @back="handleBack" />
   </div>
 </template>
 
@@ -627,7 +627,10 @@ export default {
     handleCondition(id, index) {
       deleteCondition({ id }).then(res => {
         this.conditionList.splice(index, 1)
-        Object.assign(this.$children[9].$data, this.$children[9].$options.data())
+        this.$nextTick(() => {
+          Object.assign(this.$children[8].$data, this.$children[9].$options.data())
+        })
+        this.$refs
         this.$successMsg('删除成功')
       })
     },
@@ -1036,6 +1039,7 @@ export default {
     },
     handleBack() {
       this.isCondition = 0
+      // this.isFlag = 1
       this.$emit('upDataIsFlag')
     },
     getProductPriceListV2() {

+ 3 - 3
src/views/sales_policy/components/Examine.vue

@@ -481,7 +481,7 @@
               @select-all="handleSelectionAllChange2"
               @selection-change="handleSelectionChange2"
             >
-              <el-table-column prop="customerName" label="经销商名称" align="left">
+              <el-table-column prop="customerName" label="经销商名称" align="left" width="300">
                 <template slot-scope="scope">
                   <CopyButton :copy-text="scope.row.customerName" />
                   <span>{{ scope.row.customerName }}</span>
@@ -534,13 +534,13 @@
               @selection-change="handleSelectionChange2"
             >
               <el-table-column type="index" label="序号" align="left" />
-              <el-table-column prop="customerNumber" label="经销商编号" align="left">
+              <el-table-column prop="customerNumber" label="经销商编号" align="left" width="300">
                 <template slot-scope="scope">
                   <CopyButton :copy-text="scope.row.customerNumber" />
                   <span>{{ scope.row.customerNumber }}</span>
                 </template>
               </el-table-column>
-              <el-table-column prop="customerName" label="经销商名称" align="left">
+              <el-table-column prop="customerName" label="经销商名称" align="left" width="300">
                 <template slot-scope="scope">
                   <CopyButton :copy-text="scope.row.customerName" />
                   <span>{{ scope.row.customerName }}</span>

+ 4 - 3
src/views/sales_policy/components/TabelTransfer.vue

@@ -180,13 +180,13 @@
             @selection-change="handleSelectionChange2"
           >
             <el-table-column type="index" label="序号" align="left" />
-            <el-table-column prop="customerNumber" label="经销商编号" align="left">
+            <el-table-column prop="customerNumber" label="经销商编号" align="left" width="300">
               <template slot-scope="scope">
                 <CopyButton :copy-text="scope.row.customerNumber" />
                 <span>{{ scope.row.customerNumber }}</span>
               </template>
             </el-table-column>
-            <el-table-column prop="customerName" label="经销商名称" align="left">
+            <el-table-column prop="customerName" label="经销商名称" align="left" width="300">
               <template slot-scope="scope">
                 <CopyButton :copy-text="scope.row.customerName" />
                 <span>{{ scope.row.customerName }}</span>
@@ -282,13 +282,14 @@
               label="经销商编号
 "
               align="left"
+              width="300"
             >
               <template slot-scope="scope">
                 <CopyButton :copy-text="scope.row.customerNumber" />
                 <span>{{ scope.row.customerNumber }}</span>
               </template>
             </el-table-column>
-            <el-table-column prop="customerName" label="经销商名称" align="left">
+            <el-table-column prop="customerName" label="经销商名称" align="left" width="300">
               <template slot-scope="scope">
                 <CopyButton :copy-text="scope.row.customerName" />
                 <span>{{ scope.row.customerName }}</span>

+ 3 - 6
src/views/sales_policy/components/details.vue

@@ -516,19 +516,17 @@
                     @select-all="handleSelectionAllChange2"
                     @selection-change="handleSelectionChange2"
                   >
-                    <el-table-column prop="customerName" label="经销商名称" align="left">
+                    <el-table-column prop="customerName" label="经销商名称" align="left" width="300">
                       <template slot-scope="scope">
                         <CopyButton :copy-text="scope.row.customerName" />
                         <span>{{ scope.row.customerName }}</span>
                       </template>
                     </el-table-column>
-
                     <el-table-column prop="maxBuyNum" label="最大提货套数" align="left">
                       <template slot-scope="scope">
                         {{ scope.row.maxBuyNum }}
                       </template>
                     </el-table-column>
-                 
                     <el-table-column prop="materialName" label="物料名称" align="left">
                       <template slot-scope="scope">
                         {{ scope.row.materialName }}
@@ -554,7 +552,6 @@
                         {{ scope.row.examineOrderNums }}
                       </template>
                     </el-table-column>
-                  
                   </el-table>
                   <el-table
                     v-else
@@ -569,13 +566,13 @@
                     @selection-change="handleSelectionChange2"
                   >
                     <el-table-column type="index" label="序号" align="left" />
-                    <el-table-column prop="customerNumber" label="经销商编号" align="left">
+                    <el-table-column prop="customerNumber" label="经销商编号" align="left" width="300">
                       <template slot-scope="scope">
                         <CopyButton :copy-text="scope.row.customerNumber" />
                         <span>{{ scope.row.customerNumber }}</span>
                       </template>
                     </el-table-column>
-                    <el-table-column prop="customerName" label="经销商名称" align="left">
+                    <el-table-column prop="customerName" label="经销商名称" align="left" width="300">
                       <template slot-scope="scope">
                         <CopyButton :copy-text="scope.row.customerName" />
                         <span>{{ scope.row.customerName }}</span>

+ 5 - 6
src/views/sales_policy/components/editPolicy.vue

@@ -955,12 +955,11 @@ export default {
                 k.walletIds = [...k.walletIds, d.walletId]
               }
             }
-            k.priceType
-            this.priceList.forEach(k => {
-              if (k.priceTypeName === k.priceType) {
-                k.priceType = k.priceTypeId
-              }
-            })
+            // this.priceList.forEach(l => {
+            //   if (l.priceTypeName == k.priceType) {
+            //     k.priceType = l.priceTypeId
+            //   }
+            // })
           })
 
           this.dataList = result.data.records