chenrui 3 lat temu
rodzic
commit
94719b379a

+ 11 - 1
src/views/common/productJqList.vue

@@ -25,6 +25,12 @@ export default {
     itemSn: {
       type: String || Number,
       default: undefined
+    },
+    params: {
+      type: Object,
+      default: ()=> {
+        return null
+      }
     }
   },
   data () {
@@ -44,7 +50,11 @@ export default {
       const fetchId = this.lastFetchId
       this.data = []
       this.fetching = true
-      shelfDealerProductList({ code: productCode, pageNo: 1, pageSize: 20 }).then(res => {
+      let params = { code: productCode, pageNo: 1, pageSize: 20 }
+      if(this.params){
+        params = Object.assign(params, this.params)
+      }
+      shelfDealerProductList(params).then(res => {
         if (fetchId !== this.lastFetchId) {
           return
         }

+ 11 - 9
src/views/numsGoodsShelves/shelfSet/bindProductModal.vue

@@ -6,7 +6,7 @@
     :maskClosable="false"
     :title="modalTit"
     v-model="isShow"
-    @cancle="isShow = false"
+    @cancle="isShow=false"
     :width="600">
     <a-spin :spinning="spinning" tip="Loading...">
       <a-form-model
@@ -22,8 +22,11 @@
           {{ productInfo&&productInfo.productCode }}
           <p style="margin: 0;">{{ productInfo&&productInfo.productName || '--' }}</p>
         </a-form-model-item>
+        <a-form-model-item label="绑定产品" prop="productSn" v-if="type == 'bind'">
+          <productJqList ref="productJqList" :params="{customerSn:nowData&&nowData.customerSn}" @change="productJqChange"></productJqList>
+        </a-form-model-item>
         <a-form-model-item label="新绑定产品" prop="productSn" v-if="type == 'replace'">
-          <productJqList ref="productJqList" @change="productJqChange"></productJqList>
+          <productJqList ref="productJqList" :params="{customerSn:nowData&&nowData.customerSn}" @change="productJqChange"></productJqList>
           <span v-if="form.productSn">{{ productName || '--' }}</span>
         </a-form-model-item>
         <a-form-model-item label="销售价" prop="price">
@@ -72,7 +75,7 @@
       </a-form-model>
       <div class="btn-cont">
         <a-button type="primary" id="shelfSet-bindProduct-modal-save" @click="handleSave">保存</a-button>
-        <a-button id="shelfSet-bindProduct-modal-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
+        <a-button id="shelfSet-bindProduct-modal-back" @click="isShow=false" style="margin-left: 15px;">取消</a-button>
       </div>
     </a-spin>
   </a-modal>
@@ -145,6 +148,7 @@ export default {
     // 产品 change
     productJqChange (obj) {
       this.form.productSn = obj.key || undefined
+      this.form.productCode = obj && obj.row && obj.row.code || ''
       this.form.price = obj && obj.row && obj.row.price || ''
       this.form.cost = obj && obj.row && obj.row.cost || ''
       this.productName = obj && obj.row && obj.row.name || ''
@@ -181,15 +185,13 @@ export default {
       shelfProductDetail({ shelfPlaceSn: this.nowData && this.nowData.shelfPlaceSn }).then(res => {
         if (res.status == 200 && res.data) {
           this.productInfo = res.data
-          this.form.productSn = res.data.productSn
-          this.form.productCode = res.data.productCode
+          if(this.type == 'edit'){
+            this.form.productSn = res.data.productSn
+            this.form.productCode = res.data.productCode
+          }
           this.form.price = res.data.price
           this.form.cost = res.data.cost
           this.form.maxQty = res.data.maxQty
-          if (this.$refs.productJqList && this.type == 'replace') {
-            this.$refs.productJqList.fetchUser(res.data.productCode)
-            this.$refs.productJqList.productCode = { key: res.data.productSn, label: res.data.productCode, row: res.data }
-          }
         } else {
           this.productInfo = null
           this.$refs.ruleForm.resetFields()

+ 1 - 1
src/views/numsGoodsShelves/shelfSet/chooseImportModal.vue

@@ -94,7 +94,7 @@ export default {
         { title: '销售价', dataIndex: 'price', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '结算价', dataIndex: 'cost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '最大库容', dataIndex: 'maxQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '错误原因', dataIndex: 'errorDesc', width: '17%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true }
+        { title: '错误原因', dataIndex: 'remarks', width: '17%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true }
       ],
       loadData: [],
       unLoadData: [],

+ 20 - 16
src/views/numsGoodsShelves/shelfSet/set.vue

@@ -29,12 +29,12 @@
             <a-row :gutter="15">
               <a-col :md="6" :sm="24">
                 <a-form-item label="产品编码">
-                  <a-input id="shelfSet-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
+                  <a-input id="shelfSet-productCode" v-model.trim="queryParam.shelfProductApiEntity.productCode" allowClear placeholder="请输入产品编码"/>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="产品名称">
-                  <a-input id="shelfSet-productName" v-model.trim="queryParam.productEntity.productName" allowClear placeholder="请输入产品名称"/>
+                  <a-input id="shelfSet-productName" v-model.trim="queryParam.shelfProductApiEntity.productName" allowClear placeholder="请输入产品名称"/>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -73,21 +73,21 @@
               size="small"
               type="link"
               class="button-primary"
-              v-if="!!record.productSn"
+              v-if="!!(record.shelfProductApiEntity&&record.shelfProductApiEntity.productSn)"
               @click="handleProduct(record, 'edit')"
               id="shelfMonitoringList-edit-btn">修改信息</a-button>
             <a-button
               size="small"
               type="link"
               class="button-primary"
-              v-if="!!record.productSn"
+              v-if="!!(record.shelfProductApiEntity&&record.shelfProductApiEntity.productSn)"
               @click="handleReplace(record)"
               id="shelfMonitoringList-replace-btn">更换产品</a-button>
             <a-button
               size="small"
               type="link"
               class="button-primary"
-              v-if="!record.productSn"
+              v-if="!(record.shelfProductApiEntity&&record.shelfProductApiEntity.productSn)"
               @click="handleProduct(record, 'bind')"
               id="shelfMonitoringList-bind-btn">绑定产品</a-button>
           </template>
@@ -128,20 +128,20 @@ export default {
       spinning: false,
       disabled: false, //  查询、重置按钮是否可操作
       queryParam: {
-        productCode: '',
-        productEntity: {
+        shelfProductApiEntity: {
+          productCode: '',
           productName: ''
         }
       },
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '货位号', dataIndex: 'shelfPlaceCode', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '绑定产品编码', dataIndex: 'productCode', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '绑定产品名称', dataIndex: 'productName', width: '23%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '销售价', dataIndex: 'price', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '结算价', dataIndex: 'cost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '最大库容', dataIndex: 'maxQty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '当前库存', dataIndex: 'qty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '绑定产品编码', dataIndex: 'shelfProductApiEntity.productCode', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '绑定产品名称', dataIndex: 'shelfProductApiEntity.productName', width: '23%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '销售价', dataIndex: 'shelfProductApiEntity.price', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '结算价', dataIndex: 'shelfProductApiEntity.cost', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '最大库容', dataIndex: 'shelfProductApiEntity.maxQty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '当前库存', dataIndex: 'shelfProductApiEntity.qty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '15%', align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
@@ -195,13 +195,17 @@ export default {
     },
     // 更换产品/绑定产品/修改信息
     handleProduct (row, type) {
+      if(row){
+        this.nowData = Object.assign(row, { customerSn: this.basicInfoData&&this.basicInfoData.customerEntity&&this.basicInfoData.customerEntity.customerSn })
+      }else{
+        this.nowData = null
+      }
       this.nowData = row || null
       this.modalType = type
       this.openModal = true
     },
     handleOk () {
       this.$refs.table.refresh()
-      this.handleCancel()
     },
     handleCancel () {
       this.nowData = null
@@ -220,8 +224,8 @@ export default {
     },
     //  重置
     resetSearchForm () {
-      this.queryParam.productCode = ''
-      this.queryParam.productEntity.productName = ''
+      this.queryParam.shelfProductApiEntity.productCode = ''
+      this.queryParam.shelfProductApiEntity.productName = ''
       this.$refs.table.refresh(true)
     },
     //  返回列表