Browse Source

编辑货位号

lilei 1 year ago
parent
commit
e6445791c7

+ 1 - 1
src/api/product.js

@@ -344,7 +344,7 @@ export const stackPlaceExport = (params) => {
 // 导入产品货位-导出错误
 export const stackPlaceExportError = (params) => {
   return axios({
-    url: '/product/stackPlace/exportImportError',
+    url: '/product/stackPlace/exportError',
     data: params,
     method: 'post',
     responseType: 'blob'

+ 3 - 3
src/views/productManagement/shelfNoManage/changeRecordModal.vue

@@ -9,10 +9,10 @@
     width="50%">
     <a-descriptions size="small" :column="1">
       <a-descriptions-item label="产品编码">
-        {{ detailData&&detailData.productVO.code || '--' }}
+        {{ detailData&&detailData.product.code || '--' }}
       </a-descriptions-item>
       <a-descriptions-item label="产品名称">
-        {{ detailData&&detailData.productVO.name || '--' }}
+        {{ detailData&&detailData.product.name || '--' }}
       </a-descriptions-item>
     </a-descriptions>
     <a-spin :spinning="spinning" tip="Loading...">
@@ -66,7 +66,7 @@ export default {
         this.spinning = true
         delete parameter.tableId
         delete parameter.index
-        return stackPlaceListHistory({ productSn: this.detailData.productVO.productSn }).then(res => {
+        return stackPlaceListHistory({ productSn: this.detailData.product.productSn }).then(res => {
           let data
           if (res.status == 200) {
             data = res.data

+ 30 - 20
src/views/productManagement/shelfNoManage/editHwModal.vue

@@ -17,8 +17,8 @@
         :label-col="formItemLayout.labelCol"
         :wrapper-col="formItemLayout.wrapperCol">
         <div v-if="type=='edit'">
-          <a-form-model-item label="产品编码">{{ nowData&&nowData.productVO.code || '--' }}</a-form-model-item>
-          <a-form-model-item label="产品名称">{{ nowData&&nowData.productVO.name || '--' }}</a-form-model-item>
+          <a-form-model-item label="产品编码">{{ nowData&&nowData.product.code || '--' }}</a-form-model-item>
+          <a-form-model-item label="产品名称">{{ nowData&&nowData.product.name || '--' }}</a-form-model-item>
           <a-form-model-item label="仓库">{{ nowData&&nowData.warehouseName || '--' }}</a-form-model-item>
         </div>
         <div v-if="type=='add'">
@@ -80,17 +80,15 @@ export default {
         wrapperCol: { span: 18 }
       },
       form: {
-        shelfPlaceCode: '',
+        stackPlaceCode: '',
         productSn: undefined,
         productCode: undefined,
-        price: '',
-        cost: '',
-        maxQty: ''
+        warehouseSn: undefined
       },
       rules: {
-        shelfPlaceCode: [
-          { required: true, message: '请输入货位编号', trigger: 'blur' }
-        ],
+        // stackPlaceCode: [
+        //   { required: true, message: '请输入货位编号', trigger: 'blur' }
+        // ],
         productSn: [
           { required: true, message: '请选择产品', trigger: 'blur' }
         ],
@@ -109,16 +107,11 @@ export default {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
-          const form = JSON.parse(JSON.stringify(_this.form))
-          const params = {
-            'stackPlaceCode': form.stackPlaceCode ? form.stackPlaceCode.toUpperCase() : '',
-            'product': {
-              'productSn': _this.nowData.productVO.productSn
-            }
-          }
+          const form = _this.form
+          form.stackPlaceCode = form.stackPlaceCode.toUpperCase()
           // 开始提交数据
           _this.spinning = true
-          stackPlaceSave(params).then(res => {
+          stackPlaceSave(form).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.isShow = false
@@ -140,9 +133,16 @@ export default {
     },
     resetData () {
       this.productName = ''
-      this.$refs.productCodeList.resetForm()
-      this.form.stackPlaceCode = undefined
-      this.$refs.ruleForm.resetFields()
+      if (this.type == 'add'){
+         this.$refs.productCodeList&&this.$refs.productCodeList.resetForm()
+         this.$refs.ruleForm.resetFields()
+      }
+      this.form.stackPlaceCode = ''
+      this.form.stackPlaceSn = undefined
+      this.form.productSn = undefined
+      this.form.productCode = undefined
+      this.form.warehouseSn = undefined
+      this.form.id = undefined
     }
   },
   watch: {
@@ -159,7 +159,17 @@ export default {
         this.type = this.nowData ? 'edit' : 'add'
         this.title = (this.nowData ? '编辑' : '新增') + '货位编号'
         if (this.type == 'edit') {
+          this.form.id = this.nowData.id
           this.form.stackPlaceCode = this.nowData.stackPlaceCode
+          this.form.stackPlaceSn = this.nowData.stackPlaceSn
+          this.form.productSn = this.nowData.productSn
+          this.form.productCode = this.nowData.product.code
+          this.form.warehouseSn = this.nowData.warehouseSn
+        }else{
+          this.form.stackPlaceCode = ''
+          this.$nextTick(()=>{
+            this.$refs.ruleForm.resetFields()
+          })
         }
       }
     }

+ 6 - 6
src/views/productManagement/shelfNoManage/list.vue

@@ -107,7 +107,7 @@
         bordered>
         <!-- 产品分类 -->
         <template slot="productType" slot-scope="text, record">
-          <span v-if="record.productVO.productTypeName2 || record.productVO.productTypeName3">{{ record.productVO.productTypeName2 }} {{ record.productVO.productTypeName3 ? '>' : '' }} {{ record.productVO.productTypeName3 }}</span>
+          <span v-if="record.product.productTypeName2 || record.product.productTypeName3">{{ record.product.productTypeName2 }} {{ record.product.productTypeName3 ? '>' : '' }} {{ record.product.productTypeName3 }}</span>
           <span v-else>--</span>
         </template>
         <!-- 操作 -->
@@ -210,12 +210,12 @@ export default {
 	  columns () {
 	    const arr = [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productVO.code', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productVO.name', align: 'center', width: '20%', ellipsis: true, customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'productVO.origCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品品牌', dataIndex: 'productVO.productBrandName', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'product.code', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'product.name', align: 'center', width: '20%', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '原厂编码', dataIndex: 'product.origCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品品牌', dataIndex: 'product.productBrandName', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: '10%', align: 'center' },
-        { title: '产品状态', dataIndex: 'productVO.stateDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品状态', dataIndex: 'product.stateDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '仓库', dataIndex: 'warehouseName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '货位编号', dataIndex: 'stackPlaceCode', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }

+ 2 - 2
vue.config.js

@@ -108,9 +108,9 @@ const vueConfig = {
     // If you want to turn on the proxy, please remosve the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        // target: 'http://192.168.2.111/ocs-admin',
+        target: 'http://192.168.2.111/ocs-admin',
         // target: 'https://t.ocs.360arrow.com/ocs-admin', //  练习
-        target: 'https://p.ocs.360arrow.com/ocs-admin', //  预发布
+        // target: 'https://p.ocs.360arrow.com/ocs-admin', //  预发布
         ws: false,
         changeOrigin: true,
         pathRewrite: {