瀏覽代碼

Merge branch 'hotfix/Hotfix-zh-309' into develop

howie 2 年之前
父節點
當前提交
174caa29ee
共有 2 個文件被更改,包括 23 次插入2 次删除
  1. 9 0
      src/api/supply/policy.js
  2. 14 2
      src/views/supply/policy/components/retail_form.vue

+ 9 - 0
src/api/supply/policy.js

@@ -219,3 +219,12 @@ export function deleteList(params) {
     params
   })
 }
+
+// 判断是否为生活电器品类
+export function hasRak(params) {
+  return request({
+    url: '/invoice/rak/ifRak',
+    method: 'post',
+    params
+  })
+}

+ 14 - 2
src/views/supply/policy/components/retail_form.vue

@@ -241,7 +241,7 @@
         </el-table-column>
         <el-table-column align="left" label="是否直调" prop="isDirectTransfer" min-width="100">
           <template slot-scope="scope">
-            <el-checkbox v-model="scope.row.isDirectTransfer" />
+            <el-checkbox v-model="scope.row.isDirectTransfer" @change="hasRak($event, scope.row)" />
           </template>
         </el-table-column>
         <!-- <el-table-column
@@ -628,7 +628,8 @@ import {
   getWalletList,
   getWarehouseList,
   policyList,
-  typeList
+  typeList,
+  hasRak
 } from '@/api/supply/policy'
 import { getDictList } from '@/api/common'
 import { mapGetters } from 'vuex'
@@ -942,6 +943,17 @@ export default {
       this.$set(this.mainForm, 'k3ServiceId', user.adminUserId)
       this.$set(this.mainForm, 'k3ServiceName', user.nickName)
     },
+    hasRak(e, row) {
+      if (e) {
+        hasRak({ id: row.materialId }).then(res => {
+          if (res.data) {
+            this.goodsList.forEach(k => {
+              this.$set(k, 'isDirectTransfer', true)
+            })
+          }
+        })
+      }
+    },
     // 返回列表
     goBack() {
       this.$emit('backListFormDetail')