|
@@ -23,6 +23,7 @@
|
|
|
show-search
|
|
|
id="bulkWarehousingOrder-product-productSn"
|
|
|
ref="productSn"
|
|
|
+ :disabled="itemSn"
|
|
|
v-model="form.productSn"
|
|
|
placeholder="请选择"
|
|
|
:filter-option="false"
|
|
@@ -42,6 +43,7 @@
|
|
|
@change="changeWarehouseCascade"
|
|
|
v-model="form.warehouse"
|
|
|
expand-trigger="hover"
|
|
|
+ :disabled="itemSn"
|
|
|
:allowClear="false"
|
|
|
:options="warehouseCascadeData"
|
|
|
:fieldNames="{ label: 'name', value: 'sn', children: 'warehouseLocationList' }"
|
|
@@ -49,17 +51,9 @@
|
|
|
placeholder="请选择仓库仓位"
|
|
|
style="width: 100%;" />
|
|
|
</a-form-model-item>
|
|
|
- <a-form-model-item label="成本价" prop="productCost">
|
|
|
- <a-input-number
|
|
|
- id="bulkWarehousingOrder-product-productCost"
|
|
|
- v-model="form.productCost"
|
|
|
- :disabled="true"
|
|
|
- :precision="2"
|
|
|
- :min="0"
|
|
|
- :max="999999"
|
|
|
- placeholder="成本价"
|
|
|
- style="width: 50%;margin-right:20px;" />
|
|
|
- <a-checkbox v-model="isGift">是否为赠品</a-checkbox>
|
|
|
+ <a-form-model-item label="成本价">
|
|
|
+ <span style="margin-right:20px;">{{form.productCost || form.productCost == 0 ? form.productCost : '--'}}</span>
|
|
|
+ <a-checkbox v-if="productCost||isGift" :disabled="itemSn" v-model="isGift">是否为赠品</a-checkbox>
|
|
|
</a-form-model-item>
|
|
|
<a-form-model-item label="数量" prop="productQty">
|
|
|
<a-input-number
|
|
@@ -138,7 +132,7 @@ export default {
|
|
|
{ required: true, message: '请选择仓库仓位', trigger: 'change' }
|
|
|
],
|
|
|
productCost: [
|
|
|
- { required: true, message: '成本价不能为空', trigger: 'blur' }
|
|
|
+ { required: true, message: '该产品没有设置成本价', trigger: 'blur' }
|
|
|
],
|
|
|
productQty: [
|
|
|
{ required: true, message: '请输入数量', trigger: 'blur' }
|
|
@@ -182,7 +176,7 @@ export default {
|
|
|
this.form.productName = this.productData[ind].product.name
|
|
|
this.form.productCode = this.productData[ind].product.code
|
|
|
this.form.productOrigCode = this.productData[ind].product.origCode
|
|
|
- this.form.productCost = (this.productData[ind].cost && this.productData[ind].cost != 0) ? this.productData[ind].cost : ''
|
|
|
+ this.form.productCost = this.productData[ind].cost
|
|
|
this.productCost = this.form.productCost
|
|
|
this.form.productQty = ''
|
|
|
this.isGift = false
|
|
@@ -218,6 +212,10 @@ export default {
|
|
|
if (!_this.itemSn) {
|
|
|
delete form.id
|
|
|
delete form.sparePartsDetailSn
|
|
|
+ if(!this.productCost){
|
|
|
+ _this.$message.warning('该产品没有设置成本价!')
|
|
|
+ return false
|
|
|
+ }
|
|
|
}
|
|
|
_this.spinning = true
|
|
|
sparePartsSaveDetail(form).then(res => {
|
|
@@ -226,9 +224,13 @@ export default {
|
|
|
setTimeout(() => {
|
|
|
_this.$emit('ok', res.data)
|
|
|
_this.spinning = false
|
|
|
- _this.resetData()
|
|
|
- _this.$refs.productQty.blur()
|
|
|
- _this.$refs.productSn.focus()
|
|
|
+ if (!_this.itemSn) {
|
|
|
+ _this.resetData()
|
|
|
+ _this.$refs.productQty.blur()
|
|
|
+ _this.$refs.productSn.focus()
|
|
|
+ }else{
|
|
|
+ _this.isShow = false
|
|
|
+ }
|
|
|
})
|
|
|
} else {
|
|
|
_this.spinning = false
|
|
@@ -308,8 +310,8 @@ export default {
|
|
|
productCost: '',
|
|
|
productQty: ''
|
|
|
}
|
|
|
+ this.productCost = ''
|
|
|
this.isGift = false
|
|
|
- // this.$refs.productSn.focus()
|
|
|
}
|
|
|
},
|
|
|
watch: {
|