chenrui 4 سال پیش
والد
کامیت
e1cfb681f3

+ 6 - 5
src/api/warehouse.js

@@ -31,8 +31,9 @@ export const warehouseSave = params => {
 // 删除仓库
 export const warehouseDel = params => {
   return axios({
-    url: `/warehouse/del/${params.id}`,
-    method: 'post'
+    url: `/warehouse/delete/${params.id}`,
+    data: {},
+    method: 'get'
   })
 }
 
@@ -69,8 +70,8 @@ export const warehouseLocSave = params => {
 // 删除仓位
 export const warehouseLocDel = params => {
   return axios({
-    url: '/warehouseLoc/del',
-    data: params,
-    method: 'post'
+    url: `/warehouseLoc/delete/${params.id}`,
+    data: {},
+    method: 'get'
   })
 }

+ 1 - 1
src/config/router.config.js

@@ -750,7 +750,7 @@ export const asyncRouterMap = [
                 }
               },
               {
-                path: '/inventoryManagement/storingLocation/:id',
+                path: '/inventoryManagement/storingLocation/:sn',
                 name: 'storingLocationList',
                 component: () => import(/* webpackChunkName: "shop" */ '@/views/inventoryManagement/warehouse/storingLocation/list.vue'),
                 meta: {

+ 4 - 5
src/views/inventoryManagement/warehouse/editModal.vue

@@ -72,12 +72,12 @@ export default {
       },
       form: {
         name: '', // 仓库名称
-        sort: '',  //  排序
+        sort: ''  //  排序
       },
       rules: {
         name: [
           { required: true, message: '请输入仓库名称', trigger: 'blur' }
-        ],
+        ]
       }
     }
   },
@@ -86,7 +86,7 @@ export default {
     getDetail(){
       this.form = {
         name: this.nowData && this.nowData.name ? this.nowData.name : '',
-        sort: this.nowData && this.nowData.sort ? this.nowData.sort : ''
+        sort: this.nowData && (this.nowData.sort || this.nowData.sort == 0) ? this.nowData.sort : ''
       }
     },
     //  保存
@@ -97,8 +97,7 @@ export default {
           const params = {
             id: this.itemId ? this.itemId : undefined,
             name: this.form.name,  //  仓库名称
-            sort: this.form.sort,  //  排序
-            isDefault: 0  //  是否为默认仓库   0为非默认,1为默认
+            sort: this.form.sort  //  排序
           }
           warehouseSave(params).then(res => {
             if(res.status == 200){

+ 1 - 1
src/views/inventoryManagement/warehouse/list.vue

@@ -121,7 +121,7 @@ export default {
     },
     //  查看仓位
     goStoringLocation (row) {
-      this.$router.push({ path: `/inventoryManagement/storingLocation/${row.id}`, query: { name: row.name } })
+      this.$router.push({ path: `/inventoryManagement/storingLocation/${row.warehouseSn}`, query: { name: row.name } })
     }
   }
 }

+ 18 - 14
src/views/inventoryManagement/warehouse/storingLocation/editModal.vue

@@ -26,9 +26,9 @@
             placeholder="请输入仓位名称(最多30个字符)"
             allowClear />
         </a-form-model-item>
-        <a-form-model-item label="所属仓库" prop="whId">
-          <a-select id="storingLocationEdit-whId" disabled placeholder="请选择所属仓库" allowClear v-model="form.whId">
-            <a-select-option v-for="item in warehouseList" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
+        <a-form-model-item label="所属仓库" prop="warehouseSn">
+          <a-select id="storingLocationEdit-warehouseSn" disabled placeholder="请选择所属仓库" allowClear v-model="form.warehouseSn">
+            <a-select-option v-for="item in warehouseList" :key="item.id" :value="item.warehouseSn">{{ item.name }}</a-select-option>
           </a-select>
         </a-form-model-item>
         <a-form-model-item label="排序" prop="sort">
@@ -84,14 +84,14 @@ export default {
       },
       form: {
         name: '', // 仓位名称
-        whId: undefined, //  所属仓库
+        warehouseSn: undefined, //  所属仓库
         sort: '' //  排序
       },
       rules: {
         name: [
           { required: true, message: '请输入仓位名称', trigger: 'blur' }
         ],
-        whId: [
+        warehouseSn: [
           { required: true, message: '请选择所属仓库', trigger: 'change' }
         ]
       },
@@ -113,8 +113,8 @@ export default {
     getDetail () {
       this.form = {
         name: this.nowData && this.nowData.name ? this.nowData.name : '',
-        whId: this.nowData && this.nowData.whId ? this.nowData.whId : '',
-        sort: this.nowData && this.nowData.sort ? this.nowData.sort : ''
+        warehouseSn: this.nowData && this.nowData.warehouseSn ? this.nowData.warehouseSn : '',
+        sort: this.nowData && (this.nowData.sort || this.nowData.sort == 0) ? this.nowData.sort : ''
       }
     },
     //  保存
@@ -124,10 +124,9 @@ export default {
         if (valid) {
           const params = {
             id: this.itemId ? this.itemId : undefined,
-            whId: this.form.whId, //  所属仓库
+            warehouseSn: this.form.warehouseSn, //  所属仓库
             name: this.form.name, //  仓库名称
-            sort: this.form.sort, //  排序
-            isDefault: 0 //  是否为默认仓位   0为非默认,1为默认
+            sort: this.form.sort //  排序
           }
           warehouseLocSave(params).then(res => {
             if (res.status == 200) {
@@ -157,12 +156,17 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$refs.ruleForm.resetFields()
+        this.form = {
+          name: '',
+          warehouseSn: '',
+          sort: ''
+        }
         this.$emit('close')
       } else {
         this.getWarehouseList()
         this.form = {
           name: '',
-          whId: this.nowData && this.nowData.whId ? this.nowData.whId : '',
+          warehouseSn: this.nowData && this.nowData.warehouseSn ? this.nowData.warehouseSn : '',
           sort: ''
         }
       }
@@ -179,11 +183,11 @@ export default {
 <style lang="less">
   .storingLocationEdit-modal{
     .ant-modal-body {
-    	padding: 40px 40px 24px;
+      padding: 40px 40px 24px;
     }
     .btn-cont {
-    	text-align: center;
-    	margin: 35px 0 10px;
+      text-align: center;
+      margin: 35px 0 10px;
     }
   }
 </style>

+ 5 - 8
src/views/inventoryManagement/warehouse/storingLocation/list.vue

@@ -59,7 +59,7 @@ export default {
   data () {
     return {
       queryParam: { //  查询条件
-        whId: this.$route.params.id, //  仓库id
+        warehouseSn: this.$route.params.sn, //  仓库sn
         name: '' //  仓位名称
       },
       disabled: false, //  查询、重置按钮是否可操作
@@ -87,13 +87,10 @@ export default {
       nowData: null //  当前记录数据
     }
   },
-  mounted () {
-    console.log(this.$route.query.name)
-  },
   methods: {
     //  重置
     resetSearchForm () {
-      this.queryParam.whId = this.$route.params.id
+      this.queryParam.warehouseSn = this.$route.params.sn
       this.queryParam.name = ''
       this.$refs.table.refresh(true)
     },
@@ -101,11 +98,11 @@ export default {
     handleEdit (row) {
       if (row) {
         this.itemId = row.id
-        row.whId = this.$route.params.id
+        row.warehouseSn = this.$route.params.sn
         this.nowData = row
       } else {
         this.itemId = null
-        this.nowData = { whId: this.$route.params.id }
+        this.nowData = { warehouseSn: this.$route.params.sn }
       }
       this.openModal = true
     },
@@ -128,7 +125,7 @@ export default {
         onOk () {
           warehouseLocDel({
             id: row.id,
-            whId: _this.$route.params.id
+            warehouseSn: _this.$route.params.sn
           }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)

+ 1 - 1
vue.config.js

@@ -108,7 +108,7 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        target: 'http://192.168.16.104:8503/qpls-md',
+        target: 'http://192.168.16.102:8503/qpls-md',
         // target: 'http://it.test.zyucgj.com/zyit',
         // target: 'https://it.test.qiubcar.com/zyit',
         ws: false,