Commit 4829f2ed by liwk

commit

1 parent 9f3db0fa
......@@ -5,7 +5,8 @@
"scripts": {
"serve": "vue-cli-service serve --open",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
"lint": "vue-cli-service lint",
"dev": "npm run serve"
},
"dependencies": {
"axios": "^0.18.0",
......@@ -29,4 +30,4 @@
"script-loader": "^0.7.2",
"vue-template-compiler": "^2.5.17"
}
}
}
\ No newline at end of file
......@@ -53,8 +53,8 @@
>
<el-option
v-for="item in brandList"
:key="item.brandId"
:value="item.brandId"
:key="item.brandName"
:value="item.brandName"
:label="item.brandName"
></el-option>
</el-select>
......@@ -64,7 +64,10 @@
prop="appearance"
v-if="form.brandName"
>
<el-select v-model="form.appearance">
<el-select
v-model="form.appearance"
@change="changeAppearance"
>
<el-option
v-for="item in appearanceList"
:key="item.value"
......@@ -275,25 +278,25 @@ export default {
}
})
},
getAppearanceList (brandId) {
goodsEquityManageApi.getAppearanceList({ brandId }).then(({ data }) => {
getAppearanceList (brandName) {
goodsEquityManageApi.getAppearanceList({ brandName }).then(({ data }) => {
console.log(data)
data.map(i => i.label = { 1: '卡券', 2: '直充' }[i.appearance])
this.appearanceList = data
this.form.appearance = ''
})
},
changeAppearance (e) {
console.log(this.appearanceList)
this.appearanceList.map(i => {
if (i.label == e) this.form.brandId = i.brandId
})
},
changeBrandName (e) {
this.form.brandId = e
this.getAppearanceList(e)
this.brandList.map(i => {
if (i.brandId == e) {
this.form.brandName = i.brandName
this.form.equityName = i.brandName
}
})
},
submit (type) {
console.log(this.form)
let { form, isEdit } = this
let target = type == 1 ? carEquityManageApi : goodsEquityManageApi
this.$refs.ruleForm.validate((valid) => {
......@@ -304,7 +307,7 @@ export default {
}
let apiName = 'createEquity'
if (isEdit) apiName = 'updateEquity'
console.log(this.form)
target[apiName](this.form).then(({ code, data, message }) => {
if (code == 0) {
this.close()
......
......@@ -143,7 +143,7 @@ export default {
}
},
mounted () {
// this.init()
this.init()
},
methods: {
init () {
......
......@@ -345,13 +345,13 @@ export default {
}
},
mounted () {
this.getListWithPageOutGoods()
this.$root.eventBus.$on('params', ({ id, edit }) => {
console.log({ id, edit })
if (id) {
this.getEquityGoodsById(id)
this.isEdit = !edit
} else {
this.getListWithPageOutGoods()
this.isNewGoods = true
}
})
......@@ -380,7 +380,8 @@ export default {
})
},
getListWithPageOutGoods () {
orderApi.getListWithPageOutGoods().then(({ code, data: { list } }) => {
let { appearance } = this.ruleForm
orderApi.getListWithPageOutGoods({ appearance }).then(({ code, data: { list } }) => {
if (code == 0) {
this.brandNameList = list
}
......@@ -446,7 +447,9 @@ export default {
this.ruleForm.goodsImage = ''
},
changeAppearance () {
this.getListWithPageOutGoods()
this.$refs.ruleForm.resetFields()
},
onSubmit (flag) {
this.ruleForm.insertOperationType = flag == 'save' ? 0 : 1
......
......@@ -226,7 +226,8 @@ export default {
]
},
goodsBrandList: []
goodsBrandList: [],
selectStatus: false
}
},
mounted () {
......@@ -279,8 +280,9 @@ export default {
toggleAll () {
let { goodsIndexMutiTable } = this.$refs.table.$refs
let { data } = goodsIndexMutiTable
this.selectStatus = !this.selectStatus
data.map(row => {
goodsIndexMutiTable.toggleRowSelection(row)
goodsIndexMutiTable.toggleRowSelection(row, this.selectStatus)
})
},
// ['待上架', '上架', '下架'] //
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!