Commit ade08436 by liwk

修复BUG

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