Commit 4829f2ed by liwk

commit

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