|
@@ -18,17 +18,22 @@
|
|
:wrapper-col="formItemLayout.wrapperCol">
|
|
:wrapper-col="formItemLayout.wrapperCol">
|
|
<a-form-model-item label="货架名称">{{ nowData&&nowData.shelfName || '--' }}</a-form-model-item>
|
|
<a-form-model-item label="货架名称">{{ nowData&&nowData.shelfName || '--' }}</a-form-model-item>
|
|
<a-form-model-item label="货位号">{{ nowData&&nowData.shelfPlaceCode || '--' }}</a-form-model-item>
|
|
<a-form-model-item label="货位号">{{ nowData&&nowData.shelfPlaceCode || '--' }}</a-form-model-item>
|
|
- <a-form-model-item label="绑定产品" prop="customerSn">
|
|
|
|
- <custList ref="custList" @change="custChange"></custList>
|
|
|
|
|
|
+ <a-form-model-item :label="type == 'replace' ? '原绑定产品':'绑定产品'" v-if="type != 'bind'">
|
|
|
|
+ {{ productInfo&&productInfo.productCode }}
|
|
|
|
+ <p style="margin: 0;">{{ productInfo&&productInfo.productName || '--' }}</p>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
- <a-form-model-item label="销售价" prop="beginDay">
|
|
|
|
|
|
+ <a-form-model-item label="新绑定产品" prop="productSn" v-if="type == 'replace'">
|
|
|
|
+ <productJqList ref="productJqList" @change="productJqChange"></productJqList>
|
|
|
|
+ <span v-if="form.productSn">{{ productName || '--' }}</span>
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ <a-form-model-item label="销售价" prop="price">
|
|
<a-row>
|
|
<a-row>
|
|
<a-col :span="20">
|
|
<a-col :span="20">
|
|
<a-input-number
|
|
<a-input-number
|
|
- id="shelfSet-bindProduct-beginDay"
|
|
|
|
- v-model="form.beginDay"
|
|
|
|
|
|
+ id="shelfSet-bindProduct-price"
|
|
|
|
+ v-model="form.price"
|
|
:precision="2"
|
|
:precision="2"
|
|
- :min="0"
|
|
|
|
|
|
+ :min="0.01"
|
|
:max="999999"
|
|
:max="999999"
|
|
placeholder="请输入正数(最多允许两位小数)"
|
|
placeholder="请输入正数(最多允许两位小数)"
|
|
suffix="元"
|
|
suffix="元"
|
|
@@ -37,14 +42,14 @@
|
|
<a-col :span="4"><span style="margin-left: 10px;">元</span></a-col>
|
|
<a-col :span="4"><span style="margin-left: 10px;">元</span></a-col>
|
|
</a-row>
|
|
</a-row>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
- <a-form-model-item label="结算价" prop="beginDay">
|
|
|
|
|
|
+ <a-form-model-item label="结算价" prop="cost">
|
|
<a-row>
|
|
<a-row>
|
|
<a-col :span="20">
|
|
<a-col :span="20">
|
|
<a-input-number
|
|
<a-input-number
|
|
- id="shelfSet-bindProduct-beginDay"
|
|
|
|
- v-model="form.beginDay"
|
|
|
|
|
|
+ id="shelfSet-bindProduct-cost"
|
|
|
|
+ v-model="form.cost"
|
|
:precision="2"
|
|
:precision="2"
|
|
- :min="0"
|
|
|
|
|
|
+ :min="0.01"
|
|
:max="999999"
|
|
:max="999999"
|
|
placeholder="请输入正数(最多允许两位小数)"
|
|
placeholder="请输入正数(最多允许两位小数)"
|
|
suffix="元"
|
|
suffix="元"
|
|
@@ -53,20 +58,20 @@
|
|
<a-col :span="4"><span style="margin-left: 10px;">元</span></a-col>
|
|
<a-col :span="4"><span style="margin-left: 10px;">元</span></a-col>
|
|
</a-row>
|
|
</a-row>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
- <a-form-model-item label="最大库容" prop="beginDay">
|
|
|
|
|
|
+ <a-form-model-item label="最大库容" prop="maxQty">
|
|
<a-input-number
|
|
<a-input-number
|
|
- id="shelfSet-bindProduct-beginDay"
|
|
|
|
- v-model="form.beginDay"
|
|
|
|
|
|
+ id="shelfSet-bindProduct-maxQty"
|
|
|
|
+ v-model="form.maxQty"
|
|
:precision="0"
|
|
:precision="0"
|
|
:min="0"
|
|
:min="0"
|
|
:max="999999"
|
|
:max="999999"
|
|
- placeholder="请输入最大库容(正整数)"
|
|
|
|
|
|
+ placeholder="请输入最大库容(正整数或0)"
|
|
suffix="元"
|
|
suffix="元"
|
|
style="width: 100%;display: inline-block;" />
|
|
style="width: 100%;display: inline-block;" />
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-form-model>
|
|
</a-form-model>
|
|
<div class="btn-cont">
|
|
<div class="btn-cont">
|
|
- <a-button type="primary" id="shelfSet-bindProduct-modal-save" @click="handleSave">下一步</a-button>
|
|
|
|
|
|
+ <a-button type="primary" id="shelfSet-bindProduct-modal-save" @click="handleSave">保存</a-button>
|
|
<a-button id="shelfSet-bindProduct-modal-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
|
|
<a-button id="shelfSet-bindProduct-modal-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
|
|
</div>
|
|
</div>
|
|
</a-spin>
|
|
</a-spin>
|
|
@@ -76,11 +81,11 @@
|
|
<script>
|
|
<script>
|
|
import { commonMixin } from '@/utils/mixin'
|
|
import { commonMixin } from '@/utils/mixin'
|
|
import { VSelect } from '@/components'
|
|
import { VSelect } from '@/components'
|
|
-import custList from '@/views/common/custList.vue'
|
|
|
|
-import { getTenantList, allocLinkageOutSave } from '@/api/allocLinkageOut'
|
|
|
|
|
|
+import productJqList from '@/views/common/productJqList.vue'
|
|
|
|
+import { shelfProductSave, shelfProductDetail } from '@/api/shelf'
|
|
export default {
|
|
export default {
|
|
name: 'ShelfSetBasicInfoModal',
|
|
name: 'ShelfSetBasicInfoModal',
|
|
- components: { VSelect, custList },
|
|
|
|
|
|
+ components: { VSelect, productJqList },
|
|
mixins: [commonMixin],
|
|
mixins: [commonMixin],
|
|
props: {
|
|
props: {
|
|
openModal: { // 弹框显示状态
|
|
openModal: { // 弹框显示状态
|
|
@@ -107,14 +112,19 @@ export default {
|
|
wrapperCol: { span: 18 }
|
|
wrapperCol: { span: 18 }
|
|
},
|
|
},
|
|
form: {
|
|
form: {
|
|
- customerSn: undefined, // 调往对象
|
|
|
|
- beginDay: undefined
|
|
|
|
|
|
+ productSn: undefined,
|
|
|
|
+ price: '',
|
|
|
|
+ cost: '',
|
|
|
|
+ maxQty: ''
|
|
},
|
|
},
|
|
rules: {
|
|
rules: {
|
|
- customerSn: [{ required: true, message: '请选择关联客户', trigger: 'change' }],
|
|
|
|
- beginDay: [{ required: true, message: '请输入临配运费', trigger: 'blur' }]
|
|
|
|
|
|
+ productSn: [{ required: true, message: '请选择绑定产品', trigger: 'change' }],
|
|
|
|
+ price: [{ required: true, message: '请输入销售价', trigger: 'blur' }],
|
|
|
|
+ cost: [{ required: true, message: '请输入结算价', trigger: 'blur' }],
|
|
|
|
+ maxQty: [{ required: true, message: '请输入最大库容', trigger: 'blur' }]
|
|
},
|
|
},
|
|
- putTenantSnData: [] // 调往对象 下拉数据
|
|
|
|
|
|
+ productName: '',
|
|
|
|
+ productInfo: null
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -131,36 +141,51 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- // 客户 change
|
|
|
|
- custChange (obj) {
|
|
|
|
- this.form.customerSn = obj.key || undefined
|
|
|
|
|
|
+ // 产品 change
|
|
|
|
+ productJqChange (obj) {
|
|
|
|
+ this.form.productSn = obj.key || undefined
|
|
|
|
+ this.productName = obj && obj.row && obj.row.name || '--'
|
|
},
|
|
},
|
|
// 保存
|
|
// 保存
|
|
handleSave () {
|
|
handleSave () {
|
|
const _this = this
|
|
const _this = this
|
|
this.$refs.ruleForm.validate(valid => {
|
|
this.$refs.ruleForm.validate(valid => {
|
|
if (valid) {
|
|
if (valid) {
|
|
- _this.isShow = false
|
|
|
|
- _this.$router.push({ path: `/numsGoodsShelves/shelfSet/set/1` })
|
|
|
|
- // const form = JSON.parse(JSON.stringify(_this.form))
|
|
|
|
- // _this.spinning = true
|
|
|
|
- // allocLinkageOutSave(form).then(res => {
|
|
|
|
- // if (res.status == 200) {
|
|
|
|
- // _this.$message.success(res.message)
|
|
|
|
- // setTimeout(() => {
|
|
|
|
- // _this.isShow = false
|
|
|
|
- // _this.$emit('ok', res.data)
|
|
|
|
- // _this.spinning = false
|
|
|
|
- // }, 1000)
|
|
|
|
- // } else {
|
|
|
|
- // _this.spinning = false
|
|
|
|
- // }
|
|
|
|
- // })
|
|
|
|
|
|
+ const form = JSON.parse(JSON.stringify(_this.form))
|
|
|
|
+ form.shelfSn = _this.nowData && _this.nowData.shelfSn
|
|
|
|
+ form.shelfPlaceSn = _this.nowData && _this.nowData.shelfPlaceSn
|
|
|
|
+ _this.spinning = true
|
|
|
|
+ shelfProductSave(form).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ _this.$message.success(res.message)
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ _this.isShow = false
|
|
|
|
+ _this.$emit('ok', res.data)
|
|
|
|
+ _this.spinning = false
|
|
|
|
+ }, 1000)
|
|
|
|
+ } else {
|
|
|
|
+ _this.spinning = false
|
|
|
|
+ }
|
|
|
|
+ })
|
|
} else {
|
|
} else {
|
|
console.log('error submit!!')
|
|
console.log('error submit!!')
|
|
return false
|
|
return false
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
+ },
|
|
|
|
+ // 获取产品信息
|
|
|
|
+ getProductInfo () {
|
|
|
|
+ shelfProductDetail({ shelfPlaceSn: this.nowData && this.nowData.shelfPlaceSn, productSn: this.nowData && this.nowData.productSn }).then(res => {
|
|
|
|
+ if (res.status == 200 && res.data) {
|
|
|
|
+ this.productInfo = res.data
|
|
|
|
+ this.form.price = res.data.price
|
|
|
|
+ this.form.cost = res.data.cost
|
|
|
|
+ this.form.maxQty = res.data.maxQty
|
|
|
|
+ } else {
|
|
|
|
+ this.productInfo = null
|
|
|
|
+ this.$refs.ruleForm.resetFields()
|
|
|
|
+ }
|
|
|
|
+ })
|
|
}
|
|
}
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
@@ -170,10 +195,18 @@ export default {
|
|
},
|
|
},
|
|
// 重定义的弹框状态
|
|
// 重定义的弹框状态
|
|
isShow (newValue, oldValue) {
|
|
isShow (newValue, oldValue) {
|
|
- console.log(this.nowData)
|
|
|
|
if (!newValue) {
|
|
if (!newValue) {
|
|
this.$emit('close')
|
|
this.$emit('close')
|
|
this.$refs.ruleForm.resetFields()
|
|
this.$refs.ruleForm.resetFields()
|
|
|
|
+ if (this.$refs.productJqList) {
|
|
|
|
+ this.$refs.productJqList.resetForm()
|
|
|
|
+ }
|
|
|
|
+ this.productName = ''
|
|
|
|
+ this.productInfo = null
|
|
|
|
+ } else {
|
|
|
|
+ if (this.type != 'bind') { // 修改信息、更换产品
|
|
|
|
+ this.getProductInfo()
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|