Commit 7a347964 by liwk

commit

1 parent e7918d9a
...@@ -253,7 +253,7 @@ export default { ...@@ -253,7 +253,7 @@ export default {
this.refreshTable(true, true) this.refreshTable(true, true)
}, },
refreshTable (clearMuti = true, resetCurrentPage = false) { refreshTable (clearMuti = true, resetCurrentPage = false, callBack) {
this.beforeSearchFn().then(res => { this.beforeSearchFn().then(res => {
// console.log(res) // console.log(res)
// 清空多选 // 清空多选
...@@ -279,6 +279,7 @@ export default { ...@@ -279,6 +279,7 @@ export default {
this.data = data[this.tableParams.listName] this.data = data[this.tableParams.listName]
this.total = data.total this.total = data.total
this.loading = false this.loading = false
if (callBack && typeof callBack == 'function') callBack()
}).catch(() => { }).catch(() => {
this.loading = false this.loading = false
}) })
......
...@@ -23,8 +23,8 @@ export default { ...@@ -23,8 +23,8 @@ export default {
this.brandList = data this.brandList = data
}) })
}, },
search() { search(callBack) {
this.$refs.table.refreshTable() this.$refs.table.refreshTable(true, false, callBack)
}, },
reset() { reset() {
this.date = '' this.date = ''
......
...@@ -48,6 +48,18 @@ ...@@ -48,6 +48,18 @@
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
label="商品编码"
prop="productId"
>
<el-input
v-model="ruleForm.productId"
:disabled="isEdit"
placeholder="365淘券所对应的商品编码"
maxlength="20"
@blur="getEquityOutGoodsBySupplierProductId"
></el-input>
</el-form-item>
<el-form-item
label="品牌名称" label="品牌名称"
prop="brandName" prop="brandName"
> >
...@@ -75,18 +87,7 @@ ...@@ -75,18 +87,7 @@
maxlength="30" maxlength="30"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item
label="商品编码"
prop="productId"
>
<el-input
v-model="ruleForm.productId"
:disabled="isEdit"
placeholder="365淘券所对应的商品编码"
maxlength="20"
@blur="getEquityOutGoodsBySupplierProductId"
></el-input>
</el-form-item>
<el-form-item <el-form-item
label="商品图片" label="商品图片"
:required="ruleForm.appearance == 1" :required="ruleForm.appearance == 1"
......
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
> >
<el-button <el-button
type="text" type="text"
@click="jump(scope.scope,true)" @click="jump(scope.scope)"
>编辑</el-button> >编辑</el-button>
<el-button <el-button
type="text" type="text"
...@@ -184,7 +184,6 @@ export default { ...@@ -184,7 +184,6 @@ export default {
label: '商品SKU', label: '商品SKU',
minWidth: '200', minWidth: '200',
formatter: (cell) => { formatter: (cell) => {
if (cell.appearance != 1) console.log(cell)
return cell.appearance == 1 ? `${cell.brandName}${cell.productName}` : `<div>${cell.brandName}${cell.productName}</div><div>${cell.denomination}元</div>` return cell.appearance == 1 ? `${cell.brandName}${cell.productName}` : `<div>${cell.brandName}${cell.productName}</div><div>${cell.denomination}元</div>`
} }
}, },
...@@ -239,22 +238,26 @@ export default { ...@@ -239,22 +238,26 @@ export default {
} }
}) })
}, },
jump ({ id }, edit) { jump ({ id, status }) {
let url = './addGoods.html' let url = './addGoods.html'
if (id) url = `${url}?id=${id}` if (id) url = `${url}?id=${id}`
if (edit) url = `${url}&edit=true` if (status == 0) url = `${url}&edit=true`
window.location.href = url window.location.href = url
}, },
copy ({ id }) { copy ({ id }) {
orderApi.getEquityGoodsById({ id }).then(({ code, data, message }) => { orderApi.getEquityGoodsById({ id }).then(({ code, data, message }) => {
if (code == 0) { if (code == 0) {
orderApi.createGoods(data).then(res => { orderApi.createGoods(data).then(res => {
console.log(res)
if (res.code == 0) { if (res.code == 0) {
this.$message({ this.$message({
message: '复制成功!', message: '复制成功!',
type: 'success' type: 'success'
}) })
this.search() this.search(() => {
let [target] = this.$refs.table.data
this.jump(target)
})
} else { } else {
this.$message.error(res.message) this.$message.error(res.message)
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!