Parcourir la source

Finish Hotfix-zh-41

howie il y a 3 ans
Parent
commit
04d390723c

+ 1 - 1
src/api/basic_data/warehouse.js

@@ -135,7 +135,7 @@ export function updateReserve(params) {
 
 export function categoryList(params) {
   return request({
-    url: "/product-category/king-dee-category-list",
+    url: "/k3/category/list",
     method: "get",
     params,
   });

+ 137 - 72
src/views/basic_data/material/components/modify_list-apply.vue

@@ -15,7 +15,7 @@
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="单据编号">
               <el-input
-                v-model="base.billId"
+                v-model="base.updPriceBillId"
                 placeholder="系统自动生成"
                 disabled
               />
@@ -223,7 +223,7 @@
             >
               <template slot-scope="scope">
                 <el-form-item>
-                  <el-input v-model="scope.row.batchPrice" />
+                  <el-input v-model="scope.row.batchPrice" placeholder="请输入批发价"/>
                 </el-form-item>
               </template>
             </el-table-column>
@@ -235,7 +235,7 @@
               show-overflow-tooltip
             ><template slot-scope="scope">
               <el-form-item>
-                <el-input v-model="scope.row.discAmount" />
+                <el-input v-model="scope.row.discAmount" placeholder="请输入格力折扣"/>
               </el-form-item>
             </template>
             </el-table-column>
@@ -329,7 +329,7 @@
               show-overflow-tooltip
             ><template slot-scope="scope">
               <el-form-item>
-                <el-input v-model="scope.row.qty" />
+                <el-input v-model="scope.row.qty"   placeholder="请输入数量"/>
               </el-form-item>
             </template>
             </el-table-column>
@@ -371,9 +371,9 @@
                   >
                     <el-option
                       v-for="item in scope.row.walleList"
-                      :key="item.walletId"
-                      :value="item.walletId"
-                      :label="item.walletName"
+                      :key="item.walletId || item.id"
+                      :value="item.walletId || item.id"
+                      :label="item.walletName || item.name"
                     /> </el-select></template>
               </el-form-item>
             </template>
@@ -431,22 +431,25 @@
             <el-table-column
               align="center"
               label="销售类型"
-              prop="saleTypeId"
+              prop="mainId"
               min-width="160"
               show-overflow-tooltip
             >
               <template slot-scope="scope">
                 <el-form-item>
-                  <el-select
-                    v-model="scope.row.saleTypeId"
-                    placeholder="请选择销售类型"
-                  >
-                    <el-option
-                      v-for="item in typeList"
-                      :label="item.name"
-                      :value="item.saleTypeId"
-                    />
-                  </el-select>
+
+                    <el-select
+                      v-model="scope.row.saleTypeId"
+                      placeholder="请选择销售类型"
+                      @change="handleSale($event, scope.$index, scope.row.id)"
+                    >
+                      <el-option
+                        v-for="item in typeList"
+                        :label="item.saleName"
+                        :value="item.id"
+                      />
+                    </el-select>
+
                 </el-form-item>
               </template>
             </el-table-column>
@@ -541,6 +544,32 @@
             </el-table-column>
             <el-table-column
               align="center"
+              label="返利类型"
+              prop="rebateUseRate"
+              min-width="160"
+              show-overflow-tooltip
+            ><template slot-scope="scope">
+              <el-form-item>
+                <el-select
+                  v-model="scope.row.walletRebateId"
+                  multiple
+                  :disabled="scope.row.fang"
+                  placeholder="请选择返利类型"
+                  @change="handelRebateList($event, scope.$index, scope.row)"
+                  @remove-tag="handleRemove2($event, scope.$index, scope.row)"
+                >
+                  <el-option
+                    v-for="(item, index) in scope.row.rebateList"
+                    :key="item.index"
+                    :value="item.walletRebateId"
+                    :label="item.name"
+                  />
+                </el-select>
+              </el-form-item>
+            </template>
+            </el-table-column>
+            <el-table-column
+              align="center"
               label="生效日期"
               prop="startDate"
               min-width="160"
@@ -900,7 +929,6 @@ export default {
         saleTypeId: ''
       },
       items: [],
-      centerDialogVisible: false,
       materialLis: [],
       materialId: '',
       rebateList: [],
@@ -917,7 +945,6 @@ export default {
       startDate: '',
       userList: [],
       centerDialogVisible: false,
-
       selectData: [],
       walleList: [],
       fang: true,
@@ -981,10 +1008,11 @@ export default {
     handleRemove(e, index, row) {
       console.log(e)
       const copxyWall = JSON.parse(JSON.stringify(row.wallets))
+      if (row.wallets[0].walletId === e){
+        copxyWall.splice(0, 1)
+      }
       for (let i = 0; i < row.wallets.length; i++) {
-        if (this.wall1.includes(e) && row.wallets[i].walletId == e) {
-          console.log(454)
-
+        if (this.wall1.includes(e) && row.wallets[i].walletId  === e) {
           this.wall1.splice(i, 1)
           copxyWall.splice(i, 1)
         }
@@ -1002,11 +1030,11 @@ export default {
       this.$set(row, 'wallets', copxyWall)
     },
     handelRebateList(e, index, row) {
-      console.log(row, 'kjkj')
       const id = row.cid || row.updPriceBillId
       if (e && e.length) {
         for (let i = 0; i < e.length; i++) {
           if (!this.wall2.includes(e[e.length - 1])) {
+            console.log(44544)
             this.$set(row, 'wallets', [
               ...row.wallets,
               {
@@ -1019,6 +1047,7 @@ export default {
             ])
             this.wall2.push(e[e.length - 1])
           }
+          console.log(row.wallets)
         }
       }
     },
@@ -1063,6 +1092,9 @@ export default {
               this.dataList[j].disabled = true
             }
           }
+
+
+          console.log(this.selectData[i].wallets,'4444  ' )
           this.items.push({
             baseUnitId: '',
             batchPrice: '',
@@ -1087,7 +1119,15 @@ export default {
             saleTypeId: '',
             specification: this.selectData[i].specification,
             startDate: this.selectData[i].startDate,
-            wallets: [],
+            wallets: [
+              {
+                type: 'COMMONLY',
+                id: '',
+                updPriceBillId: this.selectData[i].baseUnitId,
+                updPriceBillItemId: this.selectData[i].baseUnitId,
+                walletId:this.selectData[i].wallets[0].id
+              }
+            ],
             rebateWallets: [],
             rebateList: [],
             walletsId:[this.selectData[i].wallets[0].id],
@@ -1149,6 +1189,41 @@ export default {
       }
     },
     async getList() {
+      const params1 = {
+        pageNum: 1,
+        pageSize: -1,
+        saleCode: '',
+        saleName: '',
+        status: ''
+      }
+      getTypeList(params1).then((res) => {
+        this.typeList = res.data.records
+      })
+      getUserList({
+        pageNum: 1,
+        pageSize: -1,
+        adminWebsitId: '',
+        isCustomer: 0,
+        roleId: '',
+        status: '',
+        userName: ''
+      }).then((res) => {
+        this.userList = res.data.records
+      })
+      this.listLoading = true
+      const params = {
+        pageNum: this.currentPage,
+        pageSize: 10 || this.pageSize,
+        keyword: this.screenForm.keyword,
+        specification: this.screenForm.specification,
+        bindMain: true
+      }
+      getMaterialList(params).then((res) => {
+        this.dataList = res.data.records
+        this.listTotal = res.data.total
+        this.listLoading = false
+      })
+
       const rebateParams = {
         pageNum: 1,
         pageSize: -1,
@@ -1165,8 +1240,7 @@ export default {
         wall.data[u].walletName = wall.data[u].name
       }
       this.walleList = wall.data
-
-      if (this.$parent.show == 5) {
+      if (this.$parent.show === 5) {
         getProductRriceDetail({ id: this.cid }).then((res) => {
           for (let i = 0; i < res.data.items.length; i++) {
             const linshi = []
@@ -1198,40 +1272,61 @@ export default {
             res.data.items[i].walletRebateId = []
             res.data.items[i].rebateWallets = []
             res.data.items[i].wallets = []
+            console.log(res.data.items[i].wallets2,'8878')
             for (let p = 0; p < res.data.items[i].wallets2.length; p++) {
-              if (res.data.items[i].wallets2[p].type == 'COMMONLY') {
+              if (res.data.items[i].wallets2[p].type === 'COMMONLY') {
                 walletIds.push(res.data.items[i].wallets2[p].walletId)
                 this.$set(res.data.items[i], 'wallets', [
                   ...res.data.items[i].wallets,
-                  res.data.items[i].wallets2[p]
+                  {
+                    type: 'COMMONLY',
+                    id: '',
+                    updPriceBillId:  res.data.items[i].updPriceBillId,
+                    updPriceBillItemId:  res.data.items[i].updPriceBillId,
+                    walletId:  res.data.items[i].wallets2[p].walletId
+                  }
                 ])
-              } else if (res.data.items[i].wallets2[p].type == 'REBATE') {
+              } else if (res.data.items[i].wallets2[p].type === 'REBATE') {
                 walletRebateIds.push(res.data.items[i].wallets2[p].walletId)
+                console.log(walletRebateIds)
                 this.$set(res.data.items[i], 'rebateWallets', [
                   ...res.data.items[i].rebateWallets,
-                  res.data.items[i].wallets2[p]
+                  {
+                    type: 'REBATE',
+                    id: '',
+                    updPriceBillId:  res.data.items[i].updPriceBillId,
+                    updPriceBillItemId:  res.data.items[i].updPriceBillId,
+                    walletId:  res.data.items[i].wallets2[p].walletId
+                  }
                 ])
               }
             }
-
             this.rebateList.forEach((k) => {
               k.saleTypes.forEach((j) => {
                 if (
                   !linshi.includes(j.saleTypeId) &&
-                  j.saleTypeId == res.data.items[i].saleTypeId
+                  j.saleTypeId === res.data.items[i].saleTypeId
                 ) {
-                  console.log(k, 998)
-
                   for (let w = 0; w < walletRebateIds.length; w++) {
-                    if (walletRebateIds[w] != k.walletRebateId) {
-                      walletRebateIds.splice(w, 1)
+                    if (walletRebateIds[w] !== k.walletRebateId) {
+                      // walletRebateIds.splice(w, 1)
                     }
                   }
-
                   rebateList.push(k)
                 }
               })
             })
+            if (this.dataList.length){
+              for (let j = 0; j < res.data.items.length; j++) {
+                for (let k = 0; k < this.dataList.length; k++) {
+                  if (res.data.items[j].materialId === this.dataList[k].id){
+                    this.dataList[k].disabled = true
+                  }
+                }
+              }
+              // console.log(this.dataList)
+            }
+
             this.$set(res.data.items[i], 'walletsId', walletIds)
             this.$set(res.data.items[i], 'walletRebateId', walletRebateIds)
             res.data.items[i].walleList = this.walleList
@@ -1244,40 +1339,7 @@ export default {
           this.listLoading = false
         })
       } else {
-        this.listLoading = true
-        const params = {
-          pageNum: this.currentPage,
-          pageSize: 10 || this.pageSize,
-          keyword: this.screenForm.keyword,
-          specification: this.screenForm.specification,
-          bindMain: true
-        }
-        getMaterialList(params).then((res) => {
-          this.dataList = res.data.records
-          this.listTotal = res.data.total
-          this.listLoading = false
-        })
-        const params1 = {
-          pageNum: 1,
-          pageSize: -1,
-          saleCode: '',
-          saleName: '',
-          status: ''
-        }
-        getTypeList(params1).then((res) => {
-          this.typeList = res.data.records
-        })
-        getUserList({
-          pageNum: 1,
-          pageSize: -1,
-          adminWebsitId: '',
-          isCustomer: 0,
-          roleId: '',
-          status: '',
-          userName: ''
-        }).then((res) => {
-          this.userList = res.data.records
-        })
+
       }
     },
     /**
@@ -1311,6 +1373,7 @@ export default {
       //     return;
       //   }
       // }
+
       const params = {
         ...this.base,
         items: this.items,
@@ -1339,6 +1402,8 @@ export default {
       //               console.log(this.items[i]);
 
       // }
+      console.log(this.items)
+      return
       handleEdit({
         ...this.base,
         items: this.items,

+ 50 - 17
src/views/basic_data/warehouse/warehouse_book.vue

@@ -7,7 +7,7 @@
           type="primary"
           icon="el-icon-plus"
           size="small"
-          @click="dialogVisible=true"
+          @click="dialogVisible=true;type=1"
         >新增</el-button>
       </div>
     </div>
@@ -36,14 +36,14 @@
           <el-table-column
             align="center"
             label="仓库"
-            prop="stockName"
+            prop="correspondName"
             min-width="160"
             show-overflow-tooltip
           />
           <el-table-column
             align="center"
             label="预约存货类型"
-            prop="type"
+            prop="categoryName"
             min-width="160"
             show-overflow-tooltip
           />
@@ -81,9 +81,9 @@
               <el-button
                 type="text"
                 class="textColor"
-                @click="hanleEidt(scope.$index)"
+                @click="hanleEidt(scope.row.id,scope.row)"
               >编辑</el-button>
-              <el-button type="text" class="textColor" @click="hanleSave(scope.row)">保存</el-button>
+              <!--              <el-button type="text" class="textColor" @click="hanleSave(scope.row)">保存</el-button>-->
             </template>
           </el-table-column>
         </el-table>
@@ -169,6 +169,10 @@ export default {
         towerNum: [
           { required: true, message: '请输入预约台数量', trigger: 'blur' }
         ]
+      },
+      type: '',
+      editData: {
+
       }
     }
   },
@@ -177,11 +181,17 @@ export default {
     this.getCommonList()
   },
   methods: {
-    hanleEidt(i) {
-      this.dataList.forEach(e => {
-        e.isDisabled = true
-      })
-      this.dataList[i].isDisabled = false
+
+    hanleEidt(id, row) {
+      this.type = 2
+      this.dialogVisible = true
+      this.ruleForm = {
+        ...row
+      }
+      // this.dataList.forEach(e => {
+      //   e.isDisabled = true
+      // })
+      // this.dataList[i].isDisabled = false
     },
     hanleSave(row) {
       const params = {
@@ -200,21 +210,40 @@ export default {
           this.ruleForm
         )
         if (valid) {
-          updateReserve({
-            ...this.ruleForm
-          }).then(res => {
-            this.$successMsg('新增成功')
+          if (this.type === 1) {
+            addReserve({
+              ...this.ruleForm
+            }).then(res => {
+              this.$successMsg('新增成功')
+              this.getList()
+            })
+          } else {
+            updateReserve({
+              ...this.ruleForm
+            }).then(res => {
+              this.$successMsg('编辑成功')
               this.getList()
-          })
+            })
+          }
         } else {
           console.log('error submit!!')
           return false
         }
         this.dialogVisible = false
+        this.resetForm()
       })
     },
     resetForm() {
       this.$refs.ruleForm.resetFields()
+      this.ruleForm = {
+        'categoryId': '',
+        'categoryName': '',
+        'correspondId': '',
+        'correspondName': '',
+        'id': '',
+        'number': '',
+        'towerNum': ''
+      }
     },
     getList() {
       this.listLoading = true
@@ -241,9 +270,13 @@ export default {
       }).then(res => {
         this.stockList = res.data.records
       })
-      categoryList().then(res => {
+      categoryList({
+        pageNum: 1,
+        pageSize: -1,
+        keyword: ''
+      }).then(res => {
         console.log(res)
-        this.cateList = res.data
+        this.cateList = res.data.records
       })
     },
     handleStock(e) {

+ 1 - 0
src/views/sales_policy/components/AddPolicy.vue

@@ -935,6 +935,7 @@ export default {
     },
     handleReset() {
       Object.assign(this.$data, this.$options.data())
+      this.getCommonApi()
     }
   },
   components: {

+ 6 - 1
src/views/sales_policy/components/TabelTransfer.vue

@@ -33,7 +33,7 @@
             size="small"
           />
         </el-col>
-        <el-col style="margin-left: 10px"><el-button size="small" @click="getList">确定</el-button></el-col>
+        <el-col style="margin-left: 10px"><el-button size="small" @click="submitScreenForm">确定</el-button></el-col>
       </el-row>
     </slot>
     <el-row :gutter="20">
@@ -285,6 +285,11 @@ export default {
       this.currentPages = val
       this.getCrList()
     },
+    // 提交筛选表单
+    submitScreenForm() {
+      this.currentPages = 1;
+      this.getCrList();
+    },
     // 去掉相同数据
     resArr(arr1, arr2) {
       return arr1.filter((v) => arr2.every((val) => val.id !== v.id))

+ 1 - 0
src/views/sales_policy/components/editPolicy.vue

@@ -957,6 +957,7 @@ export default {
     },
     handleReset() {
       Object.assign(this.$data, this.$options.data())
+      this.getCommonApi()
     }
   },
   components: {