zhangdan hace 3 años
padre
commit
824c563ebc

+ 9 - 11
src/views/numsGoodsShelves/bondManagement/addbond.vue

@@ -160,11 +160,12 @@ export default {
       this.spinning = true
       this.spinning = true
       bondRecordDetail({ bondRecordSn: this.nowData ? this.nowData.bondRecordSn : '' }).then(res => {
       bondRecordDetail({ bondRecordSn: this.nowData ? this.nowData.bondRecordSn : '' }).then(res => {
         if (res.status == 200) {
         if (res.status == 200) {
+          this.form = Object.assign({}, res.data)
           this.dealerName = res.data.dealerName
           this.dealerName = res.data.dealerName
           this.shelfName = res.data.shelfName
           this.shelfName = res.data.shelfName
           this.storeName = res.data.storeName
           this.storeName = res.data.storeName
           this.form.bondAmount = res.data.bondAmount
           this.form.bondAmount = res.data.bondAmount
-          this.form = Object.assign({}, res.data)
+          // this.form = Object.assign({}, res.data)
         } else {
         } else {
         }
         }
         this.spinning = false
         this.spinning = false
@@ -203,18 +204,15 @@ export default {
     },
     },
     isshow (newValue, oldValue) {
     isshow (newValue, oldValue) {
       if (!newValue) {
       if (!newValue) {
-        this.form = {
-          dealerSn: undefined, // 经销商sn
-          bondAmount: '', // 保证金金额
-          storeSn: undefined, // 汽车修理厂sn
-          shelfSn: '' // 货架名称
+        if (!this.nowData) {
+          this.$refs.shelfList.resetForm()
         }
         }
         this.dealerName = ''
         this.dealerName = ''
         this.shelfName = ''
         this.shelfName = ''
         this.storeName =
         this.storeName =
-        this.$emit('close')
         this.$refs.ruleForm.resetFields()
         this.$refs.ruleForm.resetFields()
         this.titleText = '新增保证金'
         this.titleText = '新增保证金'
+        this.$emit('close')
       }
       }
     },
     },
     nowData: {
     nowData: {
@@ -234,9 +232,9 @@ export default {
 }
 }
 </script>
 </script>
 <style lang="less">
 <style lang="less">
-.addGoodsShelve-modal{
-  .ant-select-disabled .ant-select-selection{
-    background-color: none !important;
+  .addbond-modal{
+    .ant-input-number-handler-wrap{
+      display: none;
+    }
   }
   }
-}
 </style>
 </style>

+ 6 - 15
src/views/numsGoodsShelves/goodsShelvesAdministration/addGoodsShelve.vue

@@ -133,14 +133,6 @@ export default {
     }
     }
   },
   },
   methods: {
   methods: {
-    // 过滤空格
-    filterEmpty () {
-      let str = this.form.name
-      str = str.replace(/\ +/g, '')
-      str = str.replace(/[ ]/g, '')
-      str = str.replace(/[\r\n]/g, '')
-      this.form.name = str
-    },
     // 经销商 change
     // 经销商 change
     dealerChange (obj) {
     dealerChange (obj) {
       this.form.dealerSn = obj.key || undefined
       this.form.dealerSn = obj.key || undefined
@@ -213,14 +205,11 @@ export default {
     },
     },
     isshow (newValue, oldValue) {
     isshow (newValue, oldValue) {
       if (!newValue) {
       if (!newValue) {
-        this.form = {
-          dealerSn: undefined, // 经销商sn
-          ownerType: 1, // 平台
-          storeSn: undefined, // 汽车修理厂sn
-          shelfName: '', // 货架名称
-          images: '', // 图片
-          remarks: ''// 备注
+        if (!this.nowData) {
+          this.$refs.storeList.resetForm()
+          this.$refs.dealerList.resetForm()
         }
         }
+
         this.$refs.ruleForm.resetFields()
         this.$refs.ruleForm.resetFields()
         this.titleText = '新增数字货架'
         this.titleText = '新增数字货架'
         this.$emit('close')
         this.$emit('close')
@@ -233,6 +222,8 @@ export default {
             this.titleText = '编辑数字货架'
             this.titleText = '编辑数字货架'
             this.getShelfDetail()
             this.getShelfDetail()
           } else {
           } else {
+            this.$refs.storeList.resetForm()
+            this.$refs.dealerList.resetForm()
             this.titleText = '新增数字货架'
             this.titleText = '新增数字货架'
           }
           }
         }
         }

+ 11 - 11
src/views/numsGoodsShelves/goodsShelvesAdministration/goodsAllocationSet.vue

@@ -29,7 +29,7 @@
       </a-card>
       </a-card>
       <a-card :bordered="false" size="small" class="pages-wrap">
       <a-card :bordered="false" size="small" class="pages-wrap">
         <div class="goodsAllocationSet-baseInfo">
         <div class="goodsAllocationSet-baseInfo">
-          <a-button id="goodsAllocationSet-addHW" @click="pageInfo&&pageInfo.state=='NOT_ENABLE'? addHW(0,pageInfo):addHW(1,pageInfo)" type="primary">{{ pageInfo&&pageInfo.state=='NOT_ENABLE'? '批量导入货位':'新增' }}</a-button>
+          <a-button id="goodsAllocationSet-addHW" @click="pageInfo&&pageInfo.state=='NOT_ENABLE'? addHW(0,pageInfo):addHW(1,pageInfo)" type="primary">{{ pageInfo&&pageInfo.state=='NOT_ENABLE'? '批量导入货位':'新增货位' }}</a-button>
         </div>
         </div>
         <a-table
         <a-table
           class="sTable fixPagination"
           class="sTable fixPagination"
@@ -40,9 +40,9 @@
           :data-source="loadData"
           :data-source="loadData"
           bordered>
           bordered>
           <template slot="status" slot-scope="text, record">
           <template slot="status" slot-scope="text, record">
-            <a-button size="small" type="link" id="goodsAllocationSet-handleEdit" @click="handleEdit(record)" v-if="pageInfo&&pageInfo.state=='NOT_ENABLE' && !record.productCode">编辑</a-button>
-            <a-button size="small" type="link" id="goodsAllocationSet-handleDel" @click="handleDel(record)" v-if="pageInfo&&pageInfo.state=='NOT_ENABLE' && !record.productCode">删除</a-button>
-            <span v-if="pageInfo&&pageInfo.state!='NOT_ENABLE'" style="display: inline-block;padding-left: 7px;">--</span>
+            <a-button size="small" type="link" id="goodsAllocationSet-handleEdit" @click="handleEdit(record)" v-if=" !record.shelfProductEntity">编辑</a-button>
+            <a-button size="small" type="link" id="goodsAllocationSet-handleDel" @click="handleDel(record)" v-if=" !record.shelfProductEntity">删除</a-button>
+            <span v-if="record.shelfProductEntity" style="display: inline-block;padding-left: 7px;">--</span>
             <!-- <span v-if="!($hasPermissions('B_powerMD_user_edit') && record.superAdmin!=1) && !(record.loginFlag==1 && record.ownerOrgFlag==1 && $hasPermissions('B_powerMD_user_restPwd')) && !(record.loginFlag==0 && record.ownerOrgFlag==1 && $hasPermissions('B_powerMD_user_del'))">--</span> -->
             <!-- <span v-if="!($hasPermissions('B_powerMD_user_edit') && record.superAdmin!=1) && !(record.loginFlag==1 && record.ownerOrgFlag==1 && $hasPermissions('B_powerMD_user_restPwd')) && !(record.loginFlag==0 && record.ownerOrgFlag==1 && $hasPermissions('B_powerMD_user_del'))">--</span> -->
           </template>
           </template>
         </a-table>
         </a-table>
@@ -140,20 +140,20 @@ export default {
         },
         },
         {
         {
           title: '绑定产品编码',
           title: '绑定产品编码',
-          dataIndex: 'productCode',
-          width: '13%',
+          dataIndex: 'shelfProductEntity.productCode',
+          width: '10%',
           align: 'center',
           align: 'center',
           customRender: function (text) {
           customRender: function (text) {
-            return text || '--'
+            return text || ''
           }
           }
         },
         },
         {
         {
           title: '绑定产品',
           title: '绑定产品',
-          dataIndex: 'productName',
-          width: '13%',
-          align: 'center',
+          dataIndex: 'shelfProductEntity.productName',
+          width: '16%',
+          align: 'left',
           customRender: function (text) {
           customRender: function (text) {
-            return text || '--'
+            return text || ''
           }
           }
         },
         },
         {
         {

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

@@ -103,7 +103,7 @@
             </a-col>
             </a-col>
             <a-col :span="20">
             <a-col :span="20">
               <a-form-model-item :label="form.settleType=='CREDIT'?'超过授信额度':'超期未结算'" v-if="form.settleType">
               <a-form-model-item :label="form.settleType=='CREDIT'?'超过授信额度':'超期未结算'" v-if="form.settleType">
-                <a-checkbox id="settlementModifyModal-onChange" :checked="form.limitFlag==1" v-model="form.limitFlag">
+                <a-checkbox id="settlementModifyModal-onChange" :checked="form.limitFlag==1">
                   限制汽车修理厂无法使用数字货架
                   限制汽车修理厂无法使用数字货架
                 </a-checkbox>
                 </a-checkbox>
               </a-form-model-item>
               </a-form-model-item>
@@ -163,7 +163,7 @@ export default {
         creditWarnLimit: '', // 结算提醒金额
         creditWarnLimit: '', // 结算提醒金额
         settleDay: undefined, // 每月结算日
         settleDay: undefined, // 每月结算日
         warnBeforeDays: undefined, // 结算提醒提前天数
         warnBeforeDays: undefined, // 结算提醒提前天数
-        limitFlag: false// 是否限制使用
+        limitFlag: ''// 是否限制使用
       },
       },
       rules: {
       rules: {
         settleType: [ { required: true, message: '请选择结算方式', trigger: 'change' } ],
         settleType: [ { required: true, message: '请选择结算方式', trigger: 'change' } ],
@@ -193,14 +193,10 @@ export default {
       const _this = this
       const _this = this
       this.$refs.ruleForm.validate(valid => {
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
         if (valid) {
-          const params = JSON.parse(JSON.stringify(_this.form))
-          console.log(params.limitFlag, params, '!params.limitFlag')
-          if (params.limitFlag == undefined || params.limitFlag == false) {
+          const params = Object.assign({}, _this.form)
+          if (params.limitFlag == '') {
             params.limitFlag = 0
             params.limitFlag = 0
-          } else {
-            params.limitFlag = 1
           }
           }
-          console.log(params, 'params', _this.form)
           if (this.shelfInfo) {
           if (this.shelfInfo) {
             console.log(this.shelfInfo, 'this.nowData')
             console.log(this.shelfInfo, 'this.nowData')
             params.shelfSn = this.shelfInfo.shelfSn
             params.shelfSn = this.shelfInfo.shelfSn
@@ -240,6 +236,7 @@ export default {
         warnBeforeDays: undefined, // 结算提醒提前天数
         warnBeforeDays: undefined, // 结算提醒提前天数
         limitFlag: 0 // 是否限制使用
         limitFlag: 0 // 是否限制使用
       }
       }
+      this.$refs.ruleForm.resetFields()
       this.$emit('close')
       this.$emit('close')
     }
     }
   },
   },
@@ -250,7 +247,6 @@ export default {
     isshow (newValue, oldValue) {
     isshow (newValue, oldValue) {
       if (!newValue) {
       if (!newValue) {
         this.$refs.ruleForm.resetFields()
         this.$refs.ruleForm.resetFields()
-        this.form = {}
         this.$emit('close')
         this.$emit('close')
       }
       }
     }
     }

+ 50 - 54
src/views/numsGoodsShelves/partsDealerManagement/setSHModal.vue

@@ -2,53 +2,41 @@
   <div>
   <div>
     <a-modal
     <a-modal
       centered
       centered
-      wrapClassName="addGoodsShelve-modal"
+      wrapClassName="setSHModal-modal"
       :footer="null"
       :footer="null"
       :maskClosable="false"
       :maskClosable="false"
       title="设置结算账户"
       title="设置结算账户"
       v-model="isshow"
       v-model="isshow"
       @cancle="close"
       @cancle="close"
-      :width="450">
+      :width="550">
       <a-spin :spinning="spinning" tip="Loading...">
       <a-spin :spinning="spinning" tip="Loading...">
         <a-alert :message="message" type="info" />
         <a-alert :message="message" type="info" />
         <a-form-model
         <a-form-model
-          id="userEdit-form"
+          id="setSHModal-form"
           ref="ruleForm"
           ref="ruleForm"
           :model="form"
           :model="form"
           :rules="rules"
           :rules="rules"
-          :label-col="formItemLayout.labelCol"
-          :wrapper-col="formItemLayout.wrapperCol"
+          :labelCol="{span:5}"
+          :wrapperCol="{span:15}"
         >
         >
-          <a-row :gutter="24">
-            <a-col :span="24">
-              <a-form-model-item label="配件经销商" >
-                <span>{{ form.dealerEntity?form.dealerEntity.dealerName:'--' }}</span>
-              </a-form-model-item>
-            </a-col>
-            <a-col :span="24">
-              <a-form-model-item label="平台商户号" prop="merchantNo" >
-                <a-input id="userList-name" allowClear v-model.trim="form.merchantNo" placeholder="请输入平台商户号"/>
-              </a-form-model-item>
-            </a-col>
-            <a-col :span="24">
-              <a-form-model-item label="结算账户名" prop="bankAccount">
-                <a-input id="userList-name" allowClear v-model.trim="form.bankAccount" placeholder="请输入结算账户名"/>
-              </a-form-model-item>
-            </a-col>
-            <a-col :span="24">
-              <a-form-model-item label="结算账户号" prop="bankCard">
-                <a-input id="userList-name" allowClear v-model.trim="form.bankCard" placeholder="请输入结算账户号"/>
-              </a-form-model-item>
-            </a-col>
-            <a-col :span="24">
-              <a-form-model-item label="开户银行" prop="bankName">
-                <a-input id="userList-name" allowClear v-model.trim="form.bankName" placeholder="请输入开户银行"/>
-              </a-form-model-item>
-            </a-col>
-          </a-row>
+          <a-form-model-item label="配件经销商" >
+            <span>{{ form.dealerEntity?form.dealerEntity.dealerName:'--' }}</span>
+          </a-form-model-item>
+          <a-form-model-item label="平台商户号" prop="merchantNo" >
+            <a-input id="setSHModal-merchantNo" allowClear v-model.trim="form.merchantNo" placeholder="请输入平台商户号"/>
+          </a-form-model-item>
+          <a-form-model-item label="结算账户名" prop="bankAccount">
+            <a-input id="setSHModal-bankAccount" allowClear v-model.trim="form.bankAccount" placeholder="请输入结算账户名"/>
+          </a-form-model-item>
+          <a-form-model-item label="结算账户号" prop="bankCard">
+            <a-input id="setSHModal-bankCard" allowClear v-model.trim="form.bankCard" placeholder="请输入结算账户号"/>
+          </a-form-model-item>
+          <a-form-model-item label="开户银行" prop="bankName">
+            <a-input id="setSHModal-bankName" allowClear v-model.trim="form.bankName" placeholder="请输入开户银行"/>
+          </a-form-model-item>
           <a-form-model-item :label-col="{span: 0}" :wrapper-col="{span: 24}" style="text-align: center;">
           <a-form-model-item :label-col="{span: 0}" :wrapper-col="{span: 24}" style="text-align: center;">
-            <a-button type="primary" @click="handleSubmit()" :style="{ marginRight: '8px' }">保存</a-button>
-            <a-button :style="{ marginLeft: '8px' }" @click="close">取消</a-button>
+            <a-button type="primary" @click="handleSubmit()" :style="{ marginRight: '8px' }" id="setSHModal-handleSubmit">保存</a-button>
+            <a-button :style="{ marginLeft: '8px' }" @click="close" id="setSHModal-close">取消</a-button>
           </a-form-model-item>
           </a-form-model-item>
         </a-form-model>
         </a-form-model>
       </a-spin>
       </a-spin>
@@ -59,7 +47,7 @@
 <script>
 <script>
 import { saveMerchantAccount, merchantAccountDetail } from '@/api/merchantAccount.js'
 import { saveMerchantAccount, merchantAccountDetail } from '@/api/merchantAccount.js'
 export default {
 export default {
-  name: 'AddGoodsShelve',
+  name: 'SetSHModal',
   props: {
   props: {
     visible: {
     visible: {
       type: Boolean,
       type: Boolean,
@@ -79,10 +67,6 @@ export default {
       isshow: this.visible,
       isshow: this.visible,
       message: '以下结算账户信息需要与进件时填写的资料保持一直否则将无法体现成功',
       message: '以下结算账户信息需要与进件时填写的资料保持一直否则将无法体现成功',
       pageInfo: null,
       pageInfo: null,
-      formItemLayout: {
-        labelCol: { span: 6 },
-        wrapperCol: { span: 16 }
-      },
       form: {
       form: {
         dealerEntity: {
         dealerEntity: {
           dealerName: ''
           dealerName: ''
@@ -90,7 +74,7 @@ export default {
         bankName: '', // 开户行
         bankName: '', // 开户行
         bankAccount: '', // 账户名
         bankAccount: '', // 账户名
         bankCard: '', // 账户号
         bankCard: '', // 账户号
-        merchantNo: '' // 保证金金额
+        merchantNo: '' // 商户号
       },
       },
       rules: {
       rules: {
         merchantNo: [ { required: true, message: '请输入保证金金额', trigger: 'blur' } ],
         merchantNo: [ { required: true, message: '请输入保证金金额', trigger: 'blur' } ],
@@ -119,10 +103,12 @@ export default {
       this.spinning = true
       this.spinning = true
       merchantAccountDetail({ merchantSn: this.nowData.merchantSn, merchantType: this.nowData.merchantType }).then(res => {
       merchantAccountDetail({ merchantSn: this.nowData.merchantSn, merchantType: this.nowData.merchantType }).then(res => {
         if (res.status == 200) {
         if (res.status == 200) {
-          this.form = Object.assign({}, res.data)
+          this.form.merchantNo = res.data.merchantNo
+          this.form.dealerEntity.dealerName = res.data.dealerEntity.dealerName
           this.form.bankName = res.data.merchantBankAccountEntity.bankName
           this.form.bankName = res.data.merchantBankAccountEntity.bankName
           this.form.bankAccount = res.data.merchantBankAccountEntity.bankAccount
           this.form.bankAccount = res.data.merchantBankAccountEntity.bankAccount
           this.form.bankCard = res.data.merchantBankAccountEntity.bankCard
           this.form.bankCard = res.data.merchantBankAccountEntity.bankCard
+          this.pageInfo = Object.assign({}, res.data)
         } else {
         } else {
         }
         }
         this.spinning = false
         this.spinning = false
@@ -130,18 +116,25 @@ export default {
     },
     },
     // 保存提交
     // 保存提交
     handleSubmit () {
     handleSubmit () {
+      console.log('保存', 'handleSubmit')
       const _this = this
       const _this = this
       this.$refs.ruleForm.validate(valid => {
       this.$refs.ruleForm.validate(valid => {
+        console.log(valid, 'console.log(valid)')
         if (valid) {
         if (valid) {
-          // const params = JSON.parse(JSON.stringify(_this.form))
-          const params = Object.assign({}, _this.form)
-          if (params.bankName && params.bankAccount && params.bankCard) {
-            params.merchantBankAccountEntity.bankName = params.bankName
-            params.merchantBankAccountEntity.bankAccount = params.bankAccount
-            params.merchantBankAccountEntity.bankCard = params.bankCard
+          const params = JSON.parse(JSON.stringify(_this.pageInfo))
+          console.log(params, 'params')
+          if (params) {
+            params.merchantBankAccountEntity.bankName = _this.form.bankName
+            params.merchantBankAccountEntity.bankAccount = _this.form.bankAccount
+            params.merchantBankAccountEntity.bankCard = _this.form.bankCard
+            params.dealerEntity.dealerName = _this.form.dealerEntity.dealerName
+            params.merchantNo = _this.form.merchantNo
           }
           }
+          console.log(params, 'params')
           params.id = _this.nowData && _this.nowData.id ? _this.nowData.id : null
           params.id = _this.nowData && _this.nowData.id ? _this.nowData.id : null
+          params.dealerEntity.dealerSn = _this.nowData && _this.nowData.dealerEntity ? _this.nowData.dealerEntity.dealerSn : null
           _this.spinning = true
           _this.spinning = true
+          console.log(params, 'params')
           saveMerchantAccount(params).then(res => {
           saveMerchantAccount(params).then(res => {
             if (res.status == 200) {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$message.success(res.message)
@@ -167,9 +160,17 @@ export default {
     },
     },
     isshow (newValue, oldValue) {
     isshow (newValue, oldValue) {
       if (!newValue) {
       if (!newValue) {
-        this.form = {}
-        this.close()
+        this.form = {
+          dealerEntity: {
+            dealerName: ''
+          },
+          bankName: '', // 开户行
+          bankAccount: '', // 账户名
+          bankCard: '', // 账户号
+          merchantNo: '' // 保证金金额
+        }
         this.$refs.ruleForm.resetFields()
         this.$refs.ruleForm.resetFields()
+        this.close()
       } else {
       } else {
         this.getMerchantAccountDetail()
         this.getMerchantAccountDetail()
       }
       }
@@ -188,9 +189,4 @@ export default {
 }
 }
 </script>
 </script>
 <style lang="less">
 <style lang="less">
-.addGoodsShelve-modal{
-  .ant-select-disabled .ant-select-selection{
-    background-color: none !important;
-  }
-}
 </style>
 </style>