Bladeren bron

对接 货架设置

chenrui 3 jaren geleden
bovenliggende
commit
5836046fb5

+ 13 - 2
src/api/shelf.js

@@ -38,7 +38,7 @@ export const shelfProductList = (params) => {
 //  货架  货位产品 详情
 //  货架  货位产品 详情
 export const shelfProductDetail = (params) => {
 export const shelfProductDetail = (params) => {
   return axios({
   return axios({
-    url: `/shelf/placeProduct/queryByPlaceSnProductSn/${params.shelfPlaceSn}/${params.productSn}`,
+    url: `/shelf/placeProduct/queryByPlaceSn/${params.shelfPlaceSn}`,
     data: params,
     data: params,
     method: 'get'
     method: 'get'
   })
   })
@@ -54,7 +54,7 @@ export const shelfProductSave = (params) => {
 // 货架  货位产品 下载模板
 // 货架  货位产品 下载模板
 export const shelfProductDownload = params => {
 export const shelfProductDownload = params => {
   return axios.request({
   return axios.request({
-    url: `/shelf/placeProduct/downloadExcel`,
+    url: `/shelf/placeProduct/downloadExcel/${params.shelfSn}`,
     method: 'post',
     method: 'post',
     responseType: 'blob'
     responseType: 'blob'
   })
   })
@@ -75,6 +75,17 @@ export const shelfProductBatchInsert = params => {
     method: 'post'
     method: 'post'
   })
   })
 }
 }
+// 货架 箭冠产品  分页
+export const shelfDealerProductList = (params) => {
+  const url = `/dealerProduct/queryPageForXPRH/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
 //  货架监控 列表 不分页
 //  货架监控 列表 不分页
 export const shelfControlList = (params) => {
 export const shelfControlList = (params) => {
   return axios({
   return axios({

+ 1 - 1
src/utils/request.js

@@ -119,7 +119,7 @@ service.interceptors.response.use((response) => {
     })
     })
   }
   }
   store.commit('SET_loadingStatus', false)
   store.commit('SET_loadingStatus', false)
-  return response
+  return response.data
 }, err)
 }, err)
 
 
 const installer = {
 const installer = {

+ 2 - 2
src/views/common/productJqList.vue

@@ -19,7 +19,7 @@
 </template>
 </template>
 <script>
 <script>
 import debounce from 'lodash/debounce'
 import debounce from 'lodash/debounce'
-import { productList } from '@/api/product'
+import { shelfDealerProductList } from '@/api/shelf'
 export default {
 export default {
   props: {
   props: {
     itemSn: {
     itemSn: {
@@ -44,7 +44,7 @@ export default {
       const fetchId = this.lastFetchId
       const fetchId = this.lastFetchId
       this.data = []
       this.data = []
       this.fetching = true
       this.fetching = true
-      productList({ code: productCode, onlineFalg: 1, sysFlag: 1, pageNo: 1, pageSize: 20 }).then(res => {
+      shelfDealerProductList({ code: productCode, pageNo: 1, pageSize: 20 }).then(res => {
         if (fetchId !== this.lastFetchId) {
         if (fetchId !== this.lastFetchId) {
           return
           return
         }
         }

+ 1 - 1
src/views/numsGoodsShelves/shelfMonitoring/warehouseDetail.vue

@@ -126,7 +126,7 @@ export default {
     },
     },
     // 基本信息
     // 基本信息
     getDetail () {
     getDetail () {
-      shelfProductDetail({ shelfPlaceSn: this.$route.params.shelfPlaceSn, productSn: this.$route.params.productSn }).then(res => {
+      shelfProductDetail({ shelfPlaceSn: this.$route.params.shelfPlaceSn }).then(res => {
         if (res.status == 200) {
         if (res.status == 200) {
           this.basicInfoData = res.data
           this.basicInfoData = res.data
         } else {
         } else {

+ 3 - 2
src/views/numsGoodsShelves/shelfSet/basicInfoModal.vue

@@ -18,7 +18,7 @@
         :label-col="formItemLayout.labelCol"
         :label-col="formItemLayout.labelCol"
         :wrapper-col="formItemLayout.wrapperCol">
         :wrapper-col="formItemLayout.wrapperCol">
         <a-form-model-item label="关联客户" prop="customerSn">
         <a-form-model-item label="关联客户" prop="customerSn">
-          <custList ref="custList" @change="custChange"></custList>
+          <custList ref="custList" :isEnabled="true" @change="custChange"></custList>
         </a-form-model-item>
         </a-form-model-item>
       </a-form-model>
       </a-form-model>
       <div class="btn-cont">
       <div class="btn-cont">
@@ -114,8 +114,9 @@ export default {
         if (this.nowData.customerSn) {
         if (this.nowData.customerSn) {
           const _this = this
           const _this = this
           this.$nextTick(() => {
           this.$nextTick(() => {
-            _this.$refs.custList.setData({ key: _this.nowData.customerSn, label: _this.nowData.customerName, row: _this.nowData })
             _this.form.customerSn = _this.nowData.customerSn
             _this.form.customerSn = _this.nowData.customerSn
+            _this.$refs.custList.fetchUser(_this.nowData.customerName)
+            _this.$refs.custList.dealerName = { key: _this.nowData.customerSn, label: _this.nowData.customerName, row: _this.nowData }
           })
           })
         }
         }
       }
       }

+ 16 - 7
src/views/numsGoodsShelves/shelfSet/bindProductModal.vue

@@ -113,6 +113,7 @@ export default {
       },
       },
       form: {
       form: {
         productSn: undefined,
         productSn: undefined,
+        productCode: undefined,
         price: '',
         price: '',
         cost: '',
         cost: '',
         maxQty: ''
         maxQty: ''
@@ -144,6 +145,8 @@ export default {
     // 产品 change
     // 产品 change
     productJqChange (obj) {
     productJqChange (obj) {
       this.form.productSn = obj.key || undefined
       this.form.productSn = obj.key || undefined
+      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 || ''
       this.productName = obj && obj.row && obj.row.name || ''
     },
     },
     //  保存
     //  保存
@@ -152,17 +155,17 @@ export default {
       this.$refs.ruleForm.validate(valid => {
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
         if (valid) {
           const form = JSON.parse(JSON.stringify(_this.form))
           const form = JSON.parse(JSON.stringify(_this.form))
-          form.shelfSn = _this.nowData && _this.nowData.shelfSn
           form.shelfPlaceSn = _this.nowData && _this.nowData.shelfPlaceSn
           form.shelfPlaceSn = _this.nowData && _this.nowData.shelfPlaceSn
+          if (this.type != 'bind') { // 修改信息、更换产品
+            form.shelfProductSn = _this.nowData && _this.nowData.shelfProductSn
+          }
           _this.spinning = true
           _this.spinning = true
           shelfProductSave(form).then(res => {
           shelfProductSave(form).then(res => {
             if (res.status == 200) {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$message.success(res.message)
-              setTimeout(() => {
-                _this.isShow = false
-                _this.$emit('ok', res.data)
-                _this.spinning = false
-              }, 1000)
+              _this.isShow = false
+              _this.$emit('ok', res.data)
+              _this.spinning = false
             } else {
             } else {
               _this.spinning = false
               _this.spinning = false
             }
             }
@@ -175,12 +178,18 @@ export default {
     },
     },
     // 获取产品信息
     // 获取产品信息
     getProductInfo () {
     getProductInfo () {
-      shelfProductDetail({ shelfPlaceSn: this.nowData && this.nowData.shelfPlaceSn, productSn: this.nowData && this.nowData.productSn }).then(res => {
+      shelfProductDetail({ shelfPlaceSn: this.nowData && this.nowData.shelfPlaceSn }).then(res => {
         if (res.status == 200 && res.data) {
         if (res.status == 200 && res.data) {
           this.productInfo = res.data
           this.productInfo = res.data
+          this.form.productSn = res.data.productSn
+          this.form.productCode = res.data.productCode
           this.form.price = res.data.price
           this.form.price = res.data.price
           this.form.cost = res.data.cost
           this.form.cost = res.data.cost
           this.form.maxQty = res.data.maxQty
           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 {
         } else {
           this.productInfo = null
           this.productInfo = null
           this.$refs.ruleForm.resetFields()
           this.$refs.ruleForm.resetFields()

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

@@ -131,7 +131,7 @@ export default {
       const _this = this
       const _this = this
       _this.spinning = true
       _this.spinning = true
       // 导出
       // 导出
-      hdPrint('', 'export', shelfProductDownload, {}, '导入绑定产品模板', function () {
+      hdPrint('', 'export', shelfProductDownload, _this.params, '导入绑定产品模板', function () {
         _this.spinning = false
         _this.spinning = false
       })
       })
     }
     }

+ 9 - 10
src/views/numsGoodsShelves/shelfSet/list.vue

@@ -51,8 +51,13 @@
         bordered>
         bordered>
         <!-- 货位数量 -->
         <!-- 货位数量 -->
         <template slot="shelfPlaceNum" slot-scope="text, record">
         <template slot="shelfPlaceNum" slot-scope="text, record">
-          <p v-if="record.shelfPlaceBindNum && record.shelfPlaceNum && record.shelfPlaceBindNum != record.shelfPlaceNum" style="margin: 0;"><span style="color: red;">{{ record.shelfPlaceBindNum }}</span> / {{ record.shelfPlaceNum }}</p>
-          <p v-else style="margin: 0;">{{ record.shelfPlaceNum }}</p>
+          <div v-if="record.finishFlag=='1'">{{ record.shelfPlaceNum }}</div>
+          <div v-else>
+            <p style="margin: 0;">
+              <span style="color: red;">{{ record.shelfPlaceBindNum||record.shelfPlaceBindNum==0 ? record.shelfPlaceBindNum:'' }}</span> /
+              {{ record.shelfPlaceNum }}
+            </p>
+          </div>
         </template>
         </template>
         <!-- 是否设置完成 -->
         <!-- 是否设置完成 -->
         <template slot="finishFlag" slot-scope="text, record">
         <template slot="finishFlag" slot-scope="text, record">
@@ -61,7 +66,7 @@
         </template>
         </template>
         <!-- 操作 -->
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
         <template slot="action" slot-scope="text, record">
-          <a-button size="small" type="link" class="button-primary" @click="handleSet(record)">{{ record.finishFlag?'修改':'设置' }}</a-button>
+          <a-button size="small" type="link" class="button-primary" @click="handleSet(record)">{{ record.finishFlag=='1'?'修改':'设置' }}</a-button>
         </template>
         </template>
       </s-table>
       </s-table>
     </a-spin>
     </a-spin>
@@ -93,7 +98,7 @@ export default {
       columns: [
       columns: [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
         { title: '货架名称', dataIndex: 'shelfName', width: '25%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '货架名称', dataIndex: 'shelfName', width: '25%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '关联客户', dataIndex: 'customerName', width: '25%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '关联客户', dataIndex: 'customerEntity.customerName', width: '25%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '货位数量', scopedSlots: { customRender: 'shelfPlaceNum' }, width: '15%', align: 'center' },
         { title: '货位数量', scopedSlots: { customRender: 'shelfPlaceNum' }, width: '15%', align: 'center' },
         { title: '是否设置完成', scopedSlots: { customRender: 'finishFlag' }, width: '20%', align: 'center' },
         { title: '是否设置完成', scopedSlots: { customRender: 'finishFlag' }, width: '20%', align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'left' }
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'left' }
@@ -189,9 +194,3 @@ export default {
   }
   }
 }
 }
 </script>
 </script>
-
-<style lang="less">
-  .shelfSetList-wrap{
-
-  }
-</style>

+ 9 - 7
src/views/numsGoodsShelves/shelfSet/set.vue

@@ -17,7 +17,7 @@
               <a-button icon="edit" size="small" type="link" style="margin-left: 20px;color: #39f;" @click.stop="handleInfoEdit">编辑</a-button>
               <a-button icon="edit" size="small" type="link" style="margin-left: 20px;color: #39f;" @click.stop="handleInfoEdit">编辑</a-button>
             </template>
             </template>
             <a-descriptions :column="3">
             <a-descriptions :column="3">
-              <a-descriptions-item label="关联客户">{{ (basicInfoData&&basicInfoData.customerName) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="关联客户">{{ (basicInfoData&&basicInfoData.customerEntity&&basicInfoData.customerEntity.customerName) || '--' }}</a-descriptions-item>
             </a-descriptions>
             </a-descriptions>
           </a-collapse-panel>
           </a-collapse-panel>
         </a-collapse>
         </a-collapse>
@@ -34,7 +34,7 @@
               </a-col>
               </a-col>
               <a-col :md="6" :sm="24">
               <a-col :md="6" :sm="24">
                 <a-form-item label="产品名称">
                 <a-form-item label="产品名称">
-                  <a-input id="shelfSet-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
+                  <a-input id="shelfSet-productName" v-model.trim="queryParam.productEntity.productName" allowClear placeholder="请输入产品名称"/>
                 </a-form-item>
                 </a-form-item>
               </a-col>
               </a-col>
               <a-col :md="6" :sm="24">
               <a-col :md="6" :sm="24">
@@ -47,7 +47,7 @@
           </a-form>
           </a-form>
         </div>
         </div>
         <!-- 操作按钮 -->
         <!-- 操作按钮 -->
-        <div class="table-operator" v-if="!(basicInfoData&&basicInfoData.finishFlag)">
+        <div class="table-operator" v-if="basicInfoData&&basicInfoData.finishFlag=='0'">
           <a-button id="shelfSet-import" type="primary" class="button-error" @click="openGuideModal=true">导入绑定产品</a-button>
           <a-button id="shelfSet-import" type="primary" class="button-error" @click="openGuideModal=true">导入绑定产品</a-button>
           <a-tooltip placement="top">
           <a-tooltip placement="top">
             <template slot="title">
             <template slot="title">
@@ -129,7 +129,9 @@ export default {
       disabled: false, //  查询、重置按钮是否可操作
       disabled: false, //  查询、重置按钮是否可操作
       queryParam: {
       queryParam: {
         productCode: '',
         productCode: '',
-        productName: ''
+        productEntity: {
+          productName: ''
+        }
       },
       },
       columns: [
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
@@ -186,9 +188,9 @@ export default {
     // 更换产品
     // 更换产品
     handleReplace (row) {
     handleReplace (row) {
       if (row.qty) {
       if (row.qty) {
-        this.handleProduct(row, 'replace')
-      } else {
         this.openTipsModal = true
         this.openTipsModal = true
+      } else {
+        this.handleProduct(row, 'replace')
       }
       }
     },
     },
     // 更换产品/绑定产品/修改信息
     // 更换产品/绑定产品/修改信息
@@ -219,7 +221,7 @@ export default {
     //  重置
     //  重置
     resetSearchForm () {
     resetSearchForm () {
       this.queryParam.productCode = ''
       this.queryParam.productCode = ''
-      this.queryParam.productName = ''
+      this.queryParam.productEntity.productName = ''
       this.$refs.table.refresh(true)
       this.$refs.table.refresh(true)
     },
     },
     //  返回列表
     //  返回列表

+ 2 - 1
vue.config.js

@@ -108,7 +108,8 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
     proxy: {
       '/api': {
       '/api': {
-        target: 'http://192.168.16.107:7300/mock/61aad8ea5688cb3878d81e39/qpls-md',
+        target: 'http://192.168.16.151:80/qpls-md',
+        // target: 'http://192.168.16.107:7300/mock/61aad8ea5688cb3878d81e39/qpls-md',
         // target: 'https://t.qpls.360arrow.com/qpls-md', //  Á·Ï°
         // target: 'https://t.qpls.360arrow.com/qpls-md', //  Á·Ï°
         // target: 'http://p.iscm.360arrow.com/qpls-md', //  Ô¤·¢²¼
         // target: 'http://p.iscm.360arrow.com/qpls-md', //  Ô¤·¢²¼
         // target: 'http://qpls-md.360arrow.com/qpls-md', //  Éú²ú
         // target: 'http://qpls-md.360arrow.com/qpls-md', //  Éú²ú