Sfoglia il codice sorgente

fix: 销售政策 policyConditionId

zh 2 anni fa
parent
commit
0b0870f06e

+ 21 - 12
src/views/supply/policy/components/retail_form.vue

@@ -65,7 +65,7 @@
             </el-select>
           </el-form-item>
         </el-col>
-        <el-col :span="24" :sm="12" :lg="12" v-if="goodsList.length && commercialType">
+        <el-col v-if="goodsList.length && commercialType" :span="24" :sm="12" :lg="12">
           <el-form-item label="计划单" prop="isPlanOrder">
             <el-radio-group v-model="mainForm.isPlanOrder">
               <el-radio :label="true">是</el-radio>
@@ -322,8 +322,8 @@
       width="80%"
       :close-on-click-modal="false"
       title="引用销售政策"
-      @close="handleClose"
       :append-to-body="true"
+      @close="handleClose"
     >
       <template>
         <el-form ref="screenForm" :model="screenForm" label-width="120px" label-position="left" size="small">
@@ -341,9 +341,12 @@
               <el-form-item label="规格型号">
                 <div style="display: flex">
                   <el-input v-model="screenForm.specification" placeholder="请输入规格型号" />
-                  <el-button style="margin-left: 10px" type="primary" size="mini" @click="handleGetPolicyList"
-                    >查询</el-button
-                  >
+                  <el-button
+                    style="margin-left: 10px"
+                    type="primary"
+                    size="mini"
+                    @click="handleGetPolicyList"
+                  >查询</el-button>
                 </div>
               </el-form-item>
             </el-col>
@@ -359,9 +362,10 @@
                 >
                   <el-option v-for="item in policyList" :key="item.code" :label="item.title" :value="item.code">
                     <span>{{ item.title }}</span>
-                    <span v-if="item.policyRemark" style="margin-left: 15px; color: #f00; font-size: 12px"
-                      >( {{ item.policyRemark }} )</span
-                    >
+                    <span
+                      v-if="item.policyRemark"
+                      style="margin-left: 15px; color: #f00; font-size: 12px"
+                    >( {{ item.policyRemark }} )</span>
                   </el-option>
                 </el-select>
               </el-form-item>
@@ -854,7 +858,7 @@ export default {
       handler(newValue, oldValue) {
         if (newValue && newValue.length) {
           newValue.forEach((item, index) => {
-            this.goodsList[index].policyConditionId = this.policyConditionId
+            this.goodsList[index].policyConditionId = this.policyConditionId || this.goodsList[index].policyConditionId
             if (this.correspondId) {
               this.goodsList[index].correspondName = this.correspondName
               this.goodsList[index].correspondId = this.correspondId
@@ -1052,10 +1056,13 @@ export default {
           this.screenForm.policyId = this.policyId
           if (this.listItem) {
             this.policyConditionId = data[0].id
+            console.log('edit', this.policyConditionId);
+
           }
         } else {
           this.screenForm.policyId = data[0].policyId
           this.policyConditionId = data[0].id
+          console.log('xinz', this.policyConditionId);
         }
 
         for (let i = 0; i < this.popArr.length; i++) {
@@ -1094,6 +1101,7 @@ export default {
 
       this.screenForm.policyId = data.policyId
       this.policyConditionId = data.id
+      console.log('获取条件相对应的比列', this.policyConditionId );
     },
     async handleGetPolicyList() {
       const { data } = await policyList({
@@ -1254,7 +1262,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
@@ -1270,7 +1278,7 @@ export default {
      * @param {String} index - 索引值
      * @return Boolean
      */
-    selectable2: function (row, index) {
+    selectable2: function(row, index) {
       // row.disabled == undefined 才能被选中
       if (row.disabled == undefined) {
         return true
@@ -1872,7 +1880,7 @@ export default {
           this.goodsList.forEach(k => {
             delete k.userList
           })
-          let hasCustomerWalletId = this.goodsList.find((k, i) => {
+          const hasCustomerWalletId = this.goodsList.find((k, i) => {
             if (!k.customerWalletId) {
               this.$errorMsg(`第${i + 1}货品没现金钱包`)
               return true
@@ -1905,6 +1913,7 @@ export default {
               this.goBack()
             })
           } else {
+            console.log('添加成功',this.policyConditionId);
             params.retailOrderItemList.forEach(k => {
               k.id = null
               k.policyConditionId = this.policyConditionId

+ 10 - 9
src/views/supply/policy/policy_list.vue

@@ -8,6 +8,7 @@
     :columnParsing="columnParsing"
     :tableEvents="tableEvents"
     :tableAttributes="tableAttributes"
+    :operationColumnWidth="200"
   >
     <ExamineDialog :isShow.sync="isShowExamineDialog" :examineForm.sync="examineForm" @submit="submitExamineForm" />
     <EditDateDialog :is-show.sync="isShowEditDateDialog" :date-form.sync="dateForm" @submit="submitDateForm" />
@@ -209,54 +210,54 @@ export default {
           <div class="operation-btns">
             {row.examineStatus === statusData['SAVE'] ? (
               <el-popconfirm title="确定提审?" onOnConfirm={() => this.handleSubmit(row.id)}>
-                <el-button slot="reference" type="text">
+                <el-button slot="reference" size="mini" type="text">
                   提审
                 </el-button>
               </el-popconfirm>
             ) : null}
             {row.examineStatus == statusData['WAIT'] && this.$checkBtnRole('examine', this.$route.meta.roles) ? (
-              <el-button type="text" onClick={() => this.toExamine(row)}>
+              <el-button type="text" size="mini" onClick={() => this.toExamine(row)}>
                 审核
               </el-button>
             ) : null}
             {this.$checkBtnRole('del', this.$route.meta.roles) && row.examineStatus === statusData['SAVE'] ? (
               <el-popconfirm title="确定删除吗?" onOnConfirm={() => this.handleDelete(row.id)}>
-                <el-button slot="reference" type="text">
+                <el-button slot="reference" size="mini" type="text">
                   删除
                 </el-button>
               </el-popconfirm>
             ) : null}
             {row.examineStatus === statusData['SAVE'] && this.$checkBtnRole('edit', this.$route.meta.roles) ? (
-              <el-button type="text" onClick={() => this.toForm(row)}>
+              <el-button type="text" size="mini" onClick={() => this.toForm(row)}>
                 编辑
               </el-button>
             ) : null}
             {this.$checkBtnRole('examine', this.$route.meta.roles) && row.examineStatus === statusData['OK'] ? (
               <el-popconfirm title="确定弃审吗?" onOnConfirm={() => this.handleAbandon(row.id)}>
-                <el-button slot="reference" type="text">
+                <el-button slot="reference" size="mini" type="text">
                   弃审
                 </el-button>
               </el-popconfirm>
             ) : null}
             {row.examineStatus == statusData['WAIT'] && this.$checkBtnRole('apply', this.$route.meta.roles) ? (
               <el-popconfirm title="确定撤回?" onOnConfirm={() => this.handleCancel(row.id)}>
-                <el-button slot="reference" type="text">
+                <el-button slot="reference" size="mini" type="text">
                   撤回
                 </el-button>
               </el-popconfirm>
             ) : null}
-            <el-button type="text" onClick={() => this.toDetail(row)}>
+            <el-button type="text" size="mini" onClick={() => this.toDetail(row)}>
               详情
             </el-button>
 
             {row.examineStatus === statusData['OK'] && this.$checkBtnRole('examine', this.$route.meta.roles) ? (
-              <el-button type="text" onClick={() => this.toReturn(row)}>
+              <el-button type="text" size="mini" onClick={() => this.toReturn(row)}>
                 退订
               </el-button>
             ) : null}
             {row.examineStatus === statusData['SAVE'] && this.$checkBtnRole('examine', this.$route.meta.roles) ? (
               <el-popconfirm title="确定关闭吗?" onOnConfirm={() => this.handleClose(row.id)}>
-                <el-button slot="reference" type="text">
+                <el-button slot="reference" type="text" size="mini">
                   关闭
                 </el-button>
               </el-popconfirm>