Commit ade08436 by liwk

修复BUG

1 parent 45bcc799
......@@ -47,7 +47,6 @@
</el-form-item>
<el-form-item
label="品牌名称"
required
prop="brandName"
>
<el-select
......@@ -68,7 +67,6 @@
<el-form-item
label="商品名称"
prop="productName"
required
>
<el-input
v-model="ruleForm.productName"
......@@ -78,7 +76,6 @@
<el-form-item
label="商品编码"
prop="productId"
required
>
<el-input
v-model="ruleForm.productId"
......@@ -116,7 +113,6 @@
v-if="ruleForm.appearance != 1"
label="直充面额"
prop="denomination"
required
>
<el-input
v-model.number="ruleForm.denomination"
......@@ -130,7 +126,6 @@
<el-form-item
label="销售价"
prop="salesPrice"
required
>
<el-input
v-model.number="ruleForm.salesPrice"
......@@ -144,7 +139,6 @@
<el-form-item
label="成本含税价"
prop="costPrice"
required
>
<el-input
......@@ -159,7 +153,6 @@
<el-form-item
label="官方价/划线价"
prop="lineationPrice"
required
>
<el-input
......@@ -246,7 +239,7 @@
type="primary"
@click="onSubmit"
>提交</el-button>
<el-button @click="onSubmit">保存</el-button>
<el-button @click="onSubmit('save')">保存</el-button>
</el-form-item>
</div>
</el-form>
......@@ -448,7 +441,8 @@ export default {
}
}
},
onSubmit () {
onSubmit (flag) {
this.$refs.ruleForm.validate((valid) => {
if (!valid) {
console.log('error submit!!')
......@@ -462,6 +456,10 @@ export default {
if (e.brandId == this.ruleForm.brandId) this.ruleForm.brandName = e.brandName
})
console.log(this.ruleForm)
if (flag) {
this.createGoods()
return
}
let { supplier, brandId, productId } = this.ruleForm
orderApi.sameGoodsCheck({
supplier,
......
......@@ -66,7 +66,7 @@
v-for="item in brandNameList"
:key="item.id"
:label="item.brandName"
:value="item.id"
:value="item.brandName"
>
</el-option>
</el-select>
......@@ -93,7 +93,6 @@
>新增商品</el-button>
</div>
<d2-table
v-if="flag"
ref="table"
:searchForm="searchObj"
:tableParams="tableParams"
......@@ -110,7 +109,7 @@
>编辑</el-button>
<el-button
type="text"
@click="jump(scope.scope)"
@click="copy(scope.scope)"
>复制</el-button>
</span>
<template slot='custom'>
......@@ -243,6 +242,26 @@ export default {
if (edit) 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 => {
if (res.code == 0) {
this.$message({
message: '复制成功!',
type: 'success'
})
this.search()
} else {
this.$message.error(res.message)
}
})
} else {
this.$message.error(message)
}
})
},
toggleAll () {
let { goodsIndexMutiTable } = this.$refs.table.$refs
let { data } = goodsIndexMutiTable
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!