Browse Source

完善初始化必填逻辑

master
guoxing 10 months ago
parent
commit
458cd3b7cd
  1. 8
      src/views/goods/brands/brandsAdd.vue
  2. 18
      src/views/goods/category/categoryAdd.vue
  3. 2
      src/views/goods/category/index.vue
  4. 11
      src/views/goods/factory/factoryAdd.vue
  5. 11
      src/views/goods/goods/goodsAdd2.vue
  6. 12
      src/views/goods/unit/unitAdd.vue

8
src/views/goods/brands/brandsAdd.vue

@ -237,8 +237,16 @@
showAdd() {
console.log("this.imgList", this.imgList)
this.hideUploadBtn = this.imgList.length != 0
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
},
showEdit(row) {
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
req.initBrands(row.sid)
.then(resp => {
if (resp.success) {

18
src/views/goods/category/categoryAdd.vue

@ -66,8 +66,8 @@
<el-col :span="8">
<div class="span-sty"><span class="must">*</span> 出库规则</div>
<el-form-item prop="outStockRuleValue">
<el-select v-model="formobj.outStockRuleValue" placeholder="请选择出库规则" class="addinputw addinputInfo"
<el-form-item prop="outStockRuleVaule">
<el-select v-model="formobj.outStockRuleVaule" placeholder="请选择出库规则" class="addinputw addinputInfo"
@change="selectOutStockRuleChange">
<el-option v-for="item in outStockRuleList" :key="item.dictKey" :label="item.dictValue"
:value="item.dictKey" />
@ -168,7 +168,7 @@
percentageRate: '',
percentageAmount: '',
outStockRule: '',
outStockRuleValue: '',
outStockRuleVaule: '',
sids: '',
pname: '',
sortNo: '',
@ -190,7 +190,7 @@
message: '类别编码不能为空',
trigger: 'blur'
}],
outStockRuleValue: [{
outStockRuleVaule: [{
required: true,
message: '请选择出库规则',
trigger: 'change'
@ -309,8 +309,16 @@
},
showAdd() {
this.initData()
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
},
showEdit(row) {
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
this.initData()
req.initTypes(row.sid)
.then(resp => {
@ -335,7 +343,7 @@
const choose = this.outStockRuleList.filter((item) => item.dictKey == val)
console.log('>>>>>>>>>selectOutStockRuleChange', choose)
this.formobj.outStockRule = choose[0].dictKey
this.formobj.outStockRuleValue = choose[0].dictValue
this.formobj.outStockRuleVaule = choose[0].dictValue
},
}
}

2
src/views/goods/category/index.vue

@ -68,7 +68,7 @@
<el-table-column prop="pname" label="上级类别" align="center" />
<el-table-column prop="percentageRate" label="提成比例" align="center" />
<el-table-column prop="percentageAmount" label="提成金额" align="center" />
<el-table-column prop="outstockRulevalue" label="出库规则" align="center" />
<el-table-column prop="outStockRuleVaule" label="出库规则" align="center" />
</el-table>
</div>
<!-- End 项目列表 -->

11
src/views/goods/factory/factoryAdd.vue

@ -185,8 +185,17 @@
}
this.$emit('doback')
},
showAdd() {},
showAdd() {
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
},
showEdit(row) {
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
req.initFacturer(row.sid)
.then(resp => {
if (resp.success) {

11
src/views/goods/goods/goodsAdd2.vue

@ -429,12 +429,21 @@
// var sid = require('uuid').v1()
// console.log('>>>>>>>>>showAdd', sid)
// this.formobj.sid = sid
// this.formobj.sid = sid this.$nextTick(() => {
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
},
indexMethod(index) {
return index + 1
},
showEdit(row) {
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
req.initGoods(row.sid)
.then(resp => {
if (resp.success) {

12
src/views/goods/unit/unitAdd.vue

@ -124,8 +124,18 @@
}
this.$emit('doback')
},
showAdd() {},
showAdd() {
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
},
showEdit(row) {
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
req.initUnits(row.sid)
.then(resp => {
if (resp.success) {

Loading…
Cancel
Save