Переглянути джерело

Merge branch 'develop_szhj' of http://git.chelingzhu.com/jianguan-web/jq-repairFusion-html into develop

zhangdan 3 роки тому
батько
коміт
54cb2c3ef8

+ 26 - 19
src/views/numsGoodsShelves/goodsShelvesAdministration/addGoodsShelve.vue

@@ -21,13 +21,13 @@
           <a-row :gutter="24">
             <a-col :span="12">
               <a-form-model-item label="配件经销商" prop="dealerSn">
-                <dealerList ref="dealerList" @change="dealerChange" v-if="!nowData" id="addGoodsShelve-dealerChange"></dealerList>
+                <dealerList ref="dealerList" @change="dealerChange" v-if="!nowData?true:false" id="addGoodsShelve-dealerChange"></dealerList>
                 <span v-else>{{ form.dealerName }}</span>
               </a-form-model-item>
             </a-col>
             <a-col :span="12">
               <a-form-model-item label="汽车修理厂" prop="storeSn">
-                <storeList ref="storeList" @change="storeChange" v-if="!nowData" id="addGoodsShelve-storeChange"></storeList>
+                <storeList ref="storeList" @change="storeChange" v-if="!nowData?true:false" id="addGoodsShelve-storeChange"></storeList>
                 <span v-else>{{ form.storeName }}</span>
               </a-form-model-item>
             </a-col>
@@ -52,7 +52,7 @@
           </a-row>
           <a-row :gutter="24" v-if="form.ownerType===0">
             <a-col :span="24">
-              <a-form-model-item label="产品图片" prop="images" help="说明:请上传清晰、完整的图片,支持jpg/jpeg/png格式,不超过500KB(最多5张)。" :label-col="{span:3}" :wrapper-col="{span:20}">
+              <a-form-model-item label="货架图片" prop="images" help="说明:请上传清晰、完整的图片,支持jpg/jpeg/png格式,不超过500KB(最多5张)。" :label-col="{span:3}" :wrapper-col="{span:20}">
                 <Upload
                   class="upload"
                   id="addGoodsShelve-images"
@@ -68,7 +68,7 @@
           <a-row :gutter="24">
             <a-col :span="24">
               <a-form-model-item label="备注" prop="remarks" :label-col="{span: 3}" :wrapper-col="{span: 20}">
-                <a-textarea id="addGoodsShelve-remarks" v-model.trim="form.remarks":maxLength="500" allowClear placeholder="请输入备注(最多500个字符)"/>
+                <a-textarea id="addGoodsShelve-remarks" v-model.trim="form.remarks" :maxLength="500" allowClear placeholder="请输入备注(最多500个字符)"/>
               </a-form-model-item>
             </a-col>
           </a-row>
@@ -214,23 +214,30 @@ export default {
         this.$refs.ruleForm.resetFields()
         this.titleText = '新增数字货架'
         this.$emit('close')
-      }
-    },
-    nowData: {
-      handler (newValue, oldValue) {
-        if (this.isshow && newValue) {
-          if (this.nowData.id) { //  编辑
-            this.titleText = '编辑数字货架'
-            this.getShelfDetail()
-          } else {
-            this.$refs.storeList.resetForm()
-            this.$refs.dealerList.resetForm()
-            this.titleText = '新增数字货架'
-          }
+      } else {
+        if (this.nowData && this.nowData.id) { //  编辑
+          console.log(this.nowData.id, 'this.nowData.id')
+          this.titleText = '编辑数字货架'
+          this.getShelfDetail()
         }
-      },
-      deep: true
+      }
     }
+    // nowData: {
+    //   handler (newValue, oldValue) {
+    //     if (this.isshow && newValue) {
+    //       // if (this.nowData.id) { //  编辑
+    //       //   console.log(this.nowData.id, 'this.nowData.id')
+    //       //   this.titleText = '编辑数字货架'
+    //       //   this.getShelfDetail()
+    //       // } else {
+    //       //   // this.$refs.storeList.resetForm()
+    //       //   // this.$refs.dealerList.resetForm()
+    //       //   this.titleText = '新增数字货架'
+    //       // }
+    //     }
+    //   },
+    //   deep: true
+    // }
   }
 }
 </script>

+ 30 - 15
src/views/numsGoodsShelves/goodsShelvesAdministration/addHWModal.vue

@@ -46,10 +46,16 @@ export default {
       type: [String, Number],
       default: ''
     },
-    shelfPlaceSn: {
-      type: [String, Number],
-      default: ''
+    nowData: {
+      type: Object,
+      default: function () {
+        return {}
+      }
     }
+    // shelfPlaceSn: {
+    //   type: [String, Number],
+    //   default: ''
+    // }
   },
 
   data () {
@@ -79,7 +85,7 @@ export default {
     // 查询货位详情
     getShelfHWDetail () {
       this.spinning = true
-      shelfHWDetail({ shelfPlaceSn: this.shelfPlaceSn }).then(res => {
+      shelfHWDetail({ shelfPlaceSn: this.nowData.shelfPlaceSn }).then(res => {
         if (res.status == 200) {
           this.form = Object.assign({}, res.data)
         }
@@ -121,23 +127,32 @@ export default {
     },
     isshow (newValue, oldValue) {
       if (!newValue) {
+        console.log(!newValue, newValue)
         this.$refs.ruleForm.resetFields()
         this.form = {}
         this.textTitle = '新增货位'
         this.$emit('close')
-      }
-    },
-    shelfPlaceSn: {
-      handler (newValue, oldValue) {
-        if (this.isshow && newValue) {
-          if (this.shelfPlaceSn) { //  编辑
-            this.textTitle = '编辑货位'
-            this.getShelfHWDetail()
-          }
+      } else {
+        if (this.nowData && this.nowData.id) { //  编辑
+          console.log(this.shelfPlaceSn, 'this.shelfPlaceSn')
+          this.textTitle = '编辑货位'
+          this.getShelfHWDetail()
         }
-      },
-      deep: true
+      }
     }
+    // nowData: {
+    //   handler (newValue, oldValue) {
+    //     if (this.isshow && newValue) {
+    //       console.log(this.isshow, newValue, 'newValue')
+    //       if (this.nowData.id) { //  编辑
+    //         console.log(this.shelfPlaceSn, 'this.shelfPlaceSn')
+    //         this.textTitle = '编辑货位'
+    //         // this.getShelfHWDetail()
+    //       }
+    //     }
+    //   },
+    //   deep: true
+    // }
   }
 }
 </script>

+ 4 - 3
src/views/numsGoodsShelves/goodsShelvesAdministration/goodsAllocationSet.vue

@@ -50,7 +50,7 @@
       <!-- 导入货位模板 -->
       <importHuoweiModal :openModal="openModal" @close="openModal=false" @refresh="getHwList" :shelfSn="shelfSn" @ok="handleOk"></importHuoweiModal>
       <!-- 新增货位 -->
-      <addHWModal :openHWModal="openHWModal" @refresh="getHwList" :shelfSn="shelfSn" :shelfPlaceSn="shelfPlaceSn" @close="openHWModal=false"></addHWModal>
+      <addHWModal :openHWModal="openHWModal" @refresh="getHwList" :shelfSn="shelfSn" :nowData="itemData" @close="openHWModal=false"></addHWModal>
     </a-spin>
   </div>
 </template>
@@ -73,7 +73,6 @@ export default {
       pageInfo: null,
       itemData: null,
       shelfSn: '', // 货架sn
-      shelfPlaceSn: '', // 当前行huoweisn
       // 表头
       columns: [{
         title: '序号',
@@ -201,6 +200,7 @@ export default {
       if (type == 0) {
         this.openModal = true
       } else {
+        this.itemData=null
         this.openHWModal = true
       }
     },
@@ -237,8 +237,9 @@ export default {
     },
     // 编辑
     handleEdit (row) {
-      this.shelfPlaceSn = row.shelfPlaceSn
+      // this.shelfPlaceSn = row.shelfPlaceSn
       this.shelfSn = row.shelfSn
+      this.itemData=row
       this.openHWModal = true
     },
     // 货架详情

+ 11 - 4
src/views/numsGoodsShelves/goodsShelvesAdministration/list.vue

@@ -104,8 +104,8 @@ export default {
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
-        { title: '货架名称', dataIndex: 'shelfName', width: '17%', align: 'left', customRender: function (text) { return text || '--' } },
-        { title: '配件经销商', dataIndex: 'dealerName', width: '17%', align: 'left', customRender: function (text) { return text || '--' } },
+        { title: '货架名称', dataIndex: 'shelfName', width: '17%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '配件经销商', dataIndex: 'dealerName', width: '17%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '汽车修理厂', dataIndex: 'storeName', width: '17%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '货位数量', dataIndex: 'shelfPlaceNum', width: '7%', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
         { title: '结算方式', dataIndex: 'settleTypeDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -207,7 +207,7 @@ export default {
   },
   mounted () {
     this.pageInit()
-    // this.reset()
+    this.reset()
     // if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
     //   this.pageInit()
     //   this.reset()
@@ -215,8 +215,15 @@ export default {
   },
   beforeRouteEnter (to, from, next) {
     next(vm => {
-      vm.$refs.table.refresh()
+      if (from.name == 'goodsAllocationSet' || from.name == 'settlementSet') {
+        vm.$refs.table.refresh()
+      } else {
+        vm.reset()
+      }
     })
+    // next(vm => {
+    //   vm.$refs.table.refresh()
+    // })
   }
   // activated () {
   //   // 如果是新页签打开,则重置当前页面

+ 4 - 5
src/views/numsGoodsShelves/goodsShelvesAdministration/settlementModifyModal.vue

@@ -25,12 +25,13 @@
               </a-form-model-item>
             </a-col>
             <a-col :span="20">
-              <a-form-model-item label="结算方式" prop="settleType">
+              <a-form-model-item label="结算方式" prop="settleType">
                 <a-select
                   style="background-color: none;"
                   placeholder="请选择结算方式"
                   id="settlementModifyModal-settleType"
                   allowClear
+                  @change="changeSettleType"
                   v-model="form.settleType"
                 >
                   <a-select-option v-for="item in settlementTypeList" :key="item.code" :value="item.code" :disabled="settleInfo&&settleInfo.settleType==item.code?true:false">{{ item.name }}</a-select-option>
@@ -191,10 +192,8 @@ export default {
         this.form.limitFlag = 0
       }
     },
-    // 改变货架归属
-    changeRadio (e) {
-      this.form.loginFlag = e.target.value
-      console.log(e.target.value, '=========')
+    changeSettleType (value, option) {
+      this.form.settleType = value
     },
     // 保存提交
     handleSubmit () {

+ 8 - 1
src/views/numsGoodsShelves/goodsShelvesAdministration/settlementSet.vue

@@ -64,6 +64,7 @@
                       id="settlementSet-settleType"
                       code="SHELF_SETTLE_TYPE"
                       v-model="form.settleType"
+                      @change="changeSettleType"
                       allowClear
                       placeholder="请选择结算方式"
                       :disabled="pageInfo&&pageInfo.settleType?true:false">
@@ -258,6 +259,10 @@ export default {
         })
       }
     },
+    changeSettleType (value, option) {
+      this.form.settleType = value
+      console.log(value, this.form.settleType, 'this.form.settleType')
+    },
     onChange (e) {
       console.log(e.target.checked)
       if (e.target.checked) {
@@ -268,7 +273,9 @@ export default {
     },
     //
     changeRadio (e) {
-      this.isEdit = e.target.value
+      console.log(e.target.value, 'e.target.value')
+      // this.isEdit = e.target.value
+      this.isEdit = e.target.value == 1
     },
     getbondRecordList () {
       this.spinning = true