|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<a-modal
|
|
|
centered
|
|
|
- class="bulkWarehousingOrder-product-modal"
|
|
|
+ class="purchaseReceipt-product-modal"
|
|
|
:footer="null"
|
|
|
:maskClosable="false"
|
|
|
:title="(itemSn ? '编辑' : '新增') + '产品'"
|
|
@@ -10,7 +10,7 @@
|
|
|
:width="800">
|
|
|
<a-spin :spinning="spinning" tip="Loading...">
|
|
|
<a-form-model
|
|
|
- id="bulkWarehousingOrder-product-form"
|
|
|
+ id="purchaseReceipt-product-form"
|
|
|
ref="ruleForm"
|
|
|
:model="form"
|
|
|
:rules="rules"
|
|
@@ -21,7 +21,7 @@
|
|
|
<a-form-model-item label="产品编码" :prop="!itemSn?'productSn':''">
|
|
|
<a-select
|
|
|
show-search
|
|
|
- id="bulkWarehousingOrder-product-productSn"
|
|
|
+ id="purchaseReceipt-product-productSn"
|
|
|
ref="productSn"
|
|
|
v-if="!itemSn"
|
|
|
v-model="form.productSn"
|
|
@@ -42,7 +42,7 @@
|
|
|
<a-form-model-item label="仓库仓位" prop="warehouseLocationSn">
|
|
|
{{ (nowData&&nowData.warehouseName) || '--' }} >
|
|
|
<a-select
|
|
|
- id="bulkWarehousingOrder-product-warehouse"
|
|
|
+ id="purchaseReceipt-product-warehouse"
|
|
|
@change="changeWarehouseCascade"
|
|
|
placeholder="请选择仓位"
|
|
|
:allowClear="false"
|
|
@@ -58,7 +58,7 @@
|
|
|
</a-form-model-item>
|
|
|
<a-form-model-item label="采购数量" prop="productQty">
|
|
|
<a-input-number
|
|
|
- id="bulkWarehousingOrder-product-productQty"
|
|
|
+ id="purchaseReceipt-product-productQty"
|
|
|
ref="productQty"
|
|
|
v-model="form.productQty"
|
|
|
:precision="0"
|
|
@@ -68,8 +68,8 @@
|
|
|
style="width: 50%;margin-right:20px;" /><span>个</span>
|
|
|
</a-form-model-item>
|
|
|
<div class="btn-cont">
|
|
|
- <a-button id="bulkWarehousingOrder-product-modal-back" @click="isShow = false" style="margin-right: 15px;">取消</a-button>
|
|
|
- <a-button type="primary" id="bulkWarehousingOrder-product-modal-save" @click="handleSave">{{ itemSn?'保存':'保存并新增' }}</a-button>
|
|
|
+ <a-button id="purchaseReceipt-product-modal-back" @click="isShow = false" style="margin-right: 15px;">取消</a-button>
|
|
|
+ <a-button type="primary" id="purchaseReceipt-product-modal-save" @click="handleSave">{{ itemSn?'保存':'保存并新增' }}</a-button>
|
|
|
</div>
|
|
|
</a-form-model>
|
|
|
</a-spin>
|
|
@@ -78,13 +78,15 @@
|
|
|
|
|
|
<script>
|
|
|
import { commonMixin } from '@/utils/mixin'
|
|
|
-import { VSelect } from '@/components'
|
|
|
import debounce from 'lodash/debounce'
|
|
|
+// 组件
|
|
|
+import { VSelect } from '@/components'
|
|
|
+// 接口
|
|
|
import { supplierProductList } from '@/api/supplier'
|
|
|
import { warehouseCascadeList } from '@/api/warehouse'
|
|
|
import { savePurchaseDetail, getDetailData } from '@/api/purchase'
|
|
|
export default {
|
|
|
- name: 'BulkWarehousingOrderBasicInfoModal',
|
|
|
+ name: 'PurchaseReceiptAddModal',
|
|
|
mixins: [commonMixin],
|
|
|
components: { VSelect },
|
|
|
props: {
|
|
@@ -106,24 +108,26 @@ export default {
|
|
|
data () {
|
|
|
this.fetchUser = debounce(this.fetchUser, 800)
|
|
|
return {
|
|
|
- isShow: this.openModal, // 是否打开弹框
|
|
|
spinning: false,
|
|
|
+ isShow: this.openModal, // 是否打开弹框
|
|
|
+ // form 表单设置
|
|
|
formItemLayout: {
|
|
|
labelCol: { span: 5 },
|
|
|
wrapperCol: { span: 16 }
|
|
|
},
|
|
|
form: {
|
|
|
supplierSn: '', // 供应商
|
|
|
- productSn: undefined,
|
|
|
- productName: '',
|
|
|
- productCode: '',
|
|
|
- productOrigCode: '',
|
|
|
- warehouseSn: '',
|
|
|
- warehouseLocationSn: undefined,
|
|
|
- productCost: '',
|
|
|
- productQty: ''
|
|
|
+ productSn: undefined, // 产品sn
|
|
|
+ productName: '', // 产品名称
|
|
|
+ productCode: '', // 产品编码
|
|
|
+ productOrigCode: '', // 产品原厂编码
|
|
|
+ warehouseSn: '', // 仓库
|
|
|
+ warehouseLocationSn: undefined, // 仓位
|
|
|
+ productCost: '', // 产品成本价
|
|
|
+ productQty: ''// 产品数量
|
|
|
},
|
|
|
- productCost: '',
|
|
|
+ productCost: '', // 成本价
|
|
|
+ // 必填项规则验证
|
|
|
rules: {
|
|
|
productSn: [
|
|
|
{ required: true, message: '请选择产品编码', trigger: 'change' }
|
|
@@ -138,12 +142,11 @@ export default {
|
|
|
{ required: true, message: '请输入数量', trigger: 'blur' }
|
|
|
]
|
|
|
},
|
|
|
- fetching: false,
|
|
|
- productData: [],
|
|
|
+ fetching: false, // 当下拉列表为空时显示的内容
|
|
|
+ productData: [], // 产品信息
|
|
|
warehouseCascadeData: [], // 仓库仓位 下拉数据
|
|
|
warehouseSnBackups: '', // 仓库备份数据
|
|
|
- warehouseLocationSnBackups: '', // 仓位备份数据
|
|
|
- isGift: false
|
|
|
+ warehouseLocationSnBackups: '' // 仓位备份数据
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -178,7 +181,6 @@ export default {
|
|
|
this.form.productCost = this.productData[ind].cost
|
|
|
this.productCost = this.form.productCost
|
|
|
this.form.productQty = ''
|
|
|
- this.isGift = false
|
|
|
this.$refs.productQty.focus()
|
|
|
this.$refs.ruleForm.validate()
|
|
|
},
|
|
@@ -223,6 +225,7 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ // 选择仓位
|
|
|
changeWarehouseCascade (val) {
|
|
|
this.$refs.productQty.focus()
|
|
|
this.$refs.ruleForm.validate()
|
|
@@ -248,6 +251,7 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ // 重置
|
|
|
resetData () {
|
|
|
this.$refs.ruleForm.resetFields()
|
|
|
this.form = {
|
|
@@ -289,7 +293,7 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style lang="less">
|
|
|
- .bulkWarehousingOrder-product-modal{
|
|
|
+ .purchaseReceipt-product-modal{
|
|
|
.ant-modal-body {
|
|
|
padding: 40px 40px 24px;
|
|
|
.ant-form-item{
|