|
@@ -16,6 +16,12 @@
|
|
:label-col="formItemLayout.labelCol"
|
|
:label-col="formItemLayout.labelCol"
|
|
:wrapper-col="formItemLayout.wrapperCol"
|
|
:wrapper-col="formItemLayout.wrapperCol"
|
|
>
|
|
>
|
|
|
|
+ <a-form-model-item label="供应商" v-if="pageType=='modal'">
|
|
|
|
+ <a-input
|
|
|
|
+ disabled
|
|
|
|
+ v-model.trim="formData.supplierName"
|
|
|
|
+ />
|
|
|
|
+ </a-form-model-item>
|
|
<a-form-model-item label="产品名称" prop="name">
|
|
<a-form-model-item label="产品名称" prop="name">
|
|
<a-input
|
|
<a-input
|
|
id="productInfoEdit-name"
|
|
id="productInfoEdit-name"
|
|
@@ -41,7 +47,6 @@
|
|
<a-input
|
|
<a-input
|
|
id="productInfoEdit-origCode"
|
|
id="productInfoEdit-origCode"
|
|
:maxLength="200"
|
|
:maxLength="200"
|
|
- :disabled="isEdit"
|
|
|
|
v-model.trim="form.origCode"
|
|
v-model.trim="form.origCode"
|
|
placeholder="请输入原厂编码(最多200个字符,多个编码用逗号隔开)"
|
|
placeholder="请输入原厂编码(最多200个字符,多个编码用逗号隔开)"
|
|
ref="origCode"
|
|
ref="origCode"
|
|
@@ -108,7 +113,32 @@
|
|
ref="productType"
|
|
ref="productType"
|
|
@keydown.enter.native="nextFocus('productType', 'specialPrice', $event)" />
|
|
@keydown.enter.native="nextFocus('productType', 'specialPrice', $event)" />
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
- <a-form-model-item label="经销批发价" prop="specialPrice">
|
|
|
|
|
|
+ <a-form-model-item label="成本价" v-if="pageType=='modal'" prop="putCost">
|
|
|
|
+ <a-input-number
|
|
|
|
+ id="productInfoEdit-putCost"
|
|
|
|
+ v-model="form.putCost"
|
|
|
|
+ :min="0"
|
|
|
|
+ :max="999999"
|
|
|
|
+ :precision="2"
|
|
|
|
+ style="width: 90%;margin-right: 5px;"
|
|
|
|
+ placeholder="请输入成本价(1~999999)"
|
|
|
|
+ ref="putCost"
|
|
|
|
+ @keydown.enter.native="nextFocus('putCost', 'putQty', $event)"
|
|
|
|
+ allowClear /><span>元</span>
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ <a-form-model-item label="数量" v-if="pageType=='modal'" prop="putQty">
|
|
|
|
+ <a-input-number
|
|
|
|
+ id="productInfoEdit-specialPrice"
|
|
|
|
+ v-model="form.putQty"
|
|
|
|
+ :precision="0"
|
|
|
|
+ :min="1"
|
|
|
|
+ :max="999999"
|
|
|
|
+ style="width: 90%;"
|
|
|
|
+ placeholder="请输入数量(1~999999)"
|
|
|
|
+ ref="putQty"
|
|
|
|
+ allowClear />
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ <a-form-model-item v-if="pageType=='pages'" label="经销批发价" prop="specialPrice">
|
|
<a-input-number
|
|
<a-input-number
|
|
id="productInfoEdit-specialPrice"
|
|
id="productInfoEdit-specialPrice"
|
|
v-model="form.specialPrice"
|
|
v-model="form.specialPrice"
|
|
@@ -121,7 +151,7 @@
|
|
@keydown.enter.native="nextFocus('specialPrice', 'terminalPrice', $event)"
|
|
@keydown.enter.native="nextFocus('specialPrice', 'terminalPrice', $event)"
|
|
allowClear /><span>元</span>
|
|
allowClear /><span>元</span>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
- <a-form-model-item label="终端价" prop="terminalPrice">
|
|
|
|
|
|
+ <a-form-model-item v-if="pageType=='pages'" label="终端价" prop="terminalPrice">
|
|
<a-input-number
|
|
<a-input-number
|
|
id="productInfoEdit-terminalPrice"
|
|
id="productInfoEdit-terminalPrice"
|
|
v-model="form.terminalPrice"
|
|
v-model="form.terminalPrice"
|
|
@@ -134,7 +164,7 @@
|
|
@keydown.enter.native="nextFocus('terminalPrice', 'carOwnersPrice', $event)"
|
|
@keydown.enter.native="nextFocus('terminalPrice', 'carOwnersPrice', $event)"
|
|
allowClear /><span>元</span>
|
|
allowClear /><span>元</span>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
- <a-form-model-item label="车主价" prop="carOwnersPrice">
|
|
|
|
|
|
+ <a-form-model-item v-if="pageType=='pages'" label="车主价" prop="carOwnersPrice">
|
|
<a-input-number
|
|
<a-input-number
|
|
id="productInfoEdit-carOwnersPrice"
|
|
id="productInfoEdit-carOwnersPrice"
|
|
v-model="form.carOwnersPrice"
|
|
v-model="form.carOwnersPrice"
|
|
@@ -148,7 +178,13 @@
|
|
allowClear /><span>元</span>
|
|
allowClear /><span>元</span>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
<a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;">
|
|
<a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;">
|
|
- <a-button type="primary" @click="handleSubmit" size="large" id="productInfoEdit-btn-submit" style="padding: 0 60px;">保存</a-button>
|
|
|
|
|
|
+ <a-button
|
|
|
|
+ type="primary"
|
|
|
|
+ :loading="saveing"
|
|
|
|
+ @click="handleSubmit"
|
|
|
|
+ size="large"
|
|
|
|
+ id="productInfoEdit-btn-submit"
|
|
|
|
+ style="padding: 0 60px;">保存</a-button>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-form-model>
|
|
</a-form-model>
|
|
<!-- 新增/编辑产品品牌 -->
|
|
<!-- 新增/编辑产品品牌 -->
|
|
@@ -173,6 +209,16 @@ export default {
|
|
pageType: { // 页面表现形式,pages 新页签打开的页面,modal 弹框里的页面
|
|
pageType: { // 页面表现形式,pages 新页签打开的页面,modal 弹框里的页面
|
|
type: String,
|
|
type: String,
|
|
default: 'pages'
|
|
default: 'pages'
|
|
|
|
+ },
|
|
|
|
+ paramsData: {
|
|
|
|
+ type: Object,
|
|
|
|
+ default: function () {
|
|
|
|
+ return null
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ saveing: {
|
|
|
|
+ type: Boolean,
|
|
|
|
+ default: false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -187,6 +233,7 @@ export default {
|
|
labelCol: { span: 4 },
|
|
labelCol: { span: 4 },
|
|
wrapperCol: { span: 16 }
|
|
wrapperCol: { span: 16 }
|
|
},
|
|
},
|
|
|
|
+ formData: this.paramsData,
|
|
form: {
|
|
form: {
|
|
name: '', // 产品名称
|
|
name: '', // 产品名称
|
|
code: '', // 产品编码
|
|
code: '', // 产品编码
|
|
@@ -197,7 +244,9 @@ export default {
|
|
productType: [], // 产品分类
|
|
productType: [], // 产品分类
|
|
specialPrice: '', // 经销价
|
|
specialPrice: '', // 经销价
|
|
terminalPrice: '', // 终端价
|
|
terminalPrice: '', // 终端价
|
|
- carOwnersPrice: '' // 车主价
|
|
|
|
|
|
+ carOwnersPrice: '', // 车主价
|
|
|
|
+ putCost: '',
|
|
|
|
+ putQty: ''
|
|
},
|
|
},
|
|
rules: {
|
|
rules: {
|
|
name: [
|
|
name: [
|
|
@@ -211,6 +260,12 @@ export default {
|
|
],
|
|
],
|
|
productType: [
|
|
productType: [
|
|
{ required: true, message: '请选择产品分类', trigger: 'change' }
|
|
{ required: true, message: '请选择产品分类', trigger: 'change' }
|
|
|
|
+ ],
|
|
|
|
+ putCost: [
|
|
|
|
+ { required: true, type: 'number', message: '请输入成本价', trigger: 'change' }
|
|
|
|
+ ],
|
|
|
|
+ putQty: [
|
|
|
|
+ { required: true, type: 'number', message: '请输入数量', trigger: 'change' }
|
|
]
|
|
]
|
|
},
|
|
},
|
|
fetching: false,
|
|
fetching: false,
|
|
@@ -282,14 +337,12 @@ export default {
|
|
dealerProductSave(form).then(res => {
|
|
dealerProductSave(form).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
_this.$message.success(res.message)
|
|
_this.$message.success(res.message)
|
|
- setTimeout(() => {
|
|
|
|
- if (_this.pageType == 'pages') {
|
|
|
|
- _this.$router.push({ path: '/productManagement/productInfo/list' })
|
|
|
|
- } else {
|
|
|
|
- _this.$emit('saveOk', form)
|
|
|
|
- }
|
|
|
|
|
|
+ if (_this.pageType == 'pages') {
|
|
|
|
+ _this.$router.push({ path: '/productManagement/productInfo/list' })
|
|
_this.spinning = false
|
|
_this.spinning = false
|
|
- }, 1000)
|
|
|
|
|
|
+ } else {
|
|
|
|
+ _this.$emit('saveOk', _this.form)
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
_this.spinning = false
|
|
_this.spinning = false
|
|
}
|
|
}
|
|
@@ -369,6 +422,10 @@ export default {
|
|
if (this.$route.params.id) { // 编辑页
|
|
if (this.$route.params.id) { // 编辑页
|
|
this.getGoodsDetail()
|
|
this.getGoodsDetail()
|
|
}
|
|
}
|
|
|
|
+ // 如果是其它页面新建产品
|
|
|
|
+ if (this.pageType == 'modal') {
|
|
|
|
+ this.form = Object.assign(this.form, this.formData)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted () {
|
|
mounted () {
|