Commit 7a347964 by liwk

commit

1 parent e7918d9a
......@@ -253,7 +253,7 @@ export default {
this.refreshTable(true, true)
},
refreshTable (clearMuti = true, resetCurrentPage = false) {
refreshTable (clearMuti = true, resetCurrentPage = false, callBack) {
this.beforeSearchFn().then(res => {
// console.log(res)
// 清空多选
......@@ -279,6 +279,7 @@ export default {
this.data = data[this.tableParams.listName]
this.total = data.total
this.loading = false
if (callBack && typeof callBack == 'function') callBack()
}).catch(() => {
this.loading = false
})
......
......@@ -23,8 +23,8 @@ export default {
this.brandList = data
})
},
search() {
this.$refs.table.refreshTable()
search(callBack) {
this.$refs.table.refreshTable(true, false, callBack)
},
reset() {
this.date = ''
......
......@@ -48,6 +48,18 @@
</el-radio-group>
</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="品牌名称"
prop="brandName"
>
......@@ -75,18 +87,7 @@
maxlength="30"
></el-input>
</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="商品图片"
:required="ruleForm.appearance == 1"
......
......@@ -106,7 +106,7 @@
>
<el-button
type="text"
@click="jump(scope.scope,true)"
@click="jump(scope.scope)"
>编辑</el-button>
<el-button
type="text"
......@@ -184,7 +184,6 @@ export default {
label: '商品SKU',
minWidth: '200',
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>`
}
},
......@@ -239,22 +238,26 @@ export default {
}
})
},
jump ({ id }, edit) {
jump ({ id, status }) {
let url = './addGoods.html'
if (id) url = `${url}?id=${id}`
if (edit) url = `${url}&edit=true`
if (status == 0) url = `${url}&edit=true`
window.location.href = url
},
copy ({ id }) {
orderApi.getEquityGoodsById({ id }).then(({ code, data, message }) => {
if (code == 0) {
orderApi.createGoods(data).then(res => {
console.log(res)
if (res.code == 0) {
this.$message({
message: '复制成功!',
type: 'success'
})
this.search()
this.search(() => {
let [target] = this.$refs.table.data
this.jump(target)
})
} else {
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!