|
|
|
@ -30,8 +30,28 @@
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="24" >
|
|
|
|
|
<a-form-model-item label="审核人ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="financeId">
|
|
|
|
|
<a-input v-model="model.financeId" placeholder="请输入审核人" ></a-input>
|
|
|
|
|
<a-form-model-item label="物控员id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialId">
|
|
|
|
|
<a-input v-model="model.materialId" placeholder="请输入物控员id" ></a-input>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="24" >
|
|
|
|
|
<a-form-model-item label="物控员" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialClerk">
|
|
|
|
|
<a-input v-model="model.materialClerk" placeholder="请输入物控员" ></a-input>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="24" >
|
|
|
|
|
<a-form-model-item label="物控员备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialRemark">
|
|
|
|
|
<a-input v-model="model.materialRemark" placeholder="请输入物控员备注" ></a-input>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="24" >
|
|
|
|
|
<a-form-model-item label="物控审核时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialTime">
|
|
|
|
|
<j-date placeholder="请选择物控审核时间" v-model="model.materialTime" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="24" >
|
|
|
|
|
<a-form-model-item label="审核人id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="financeId">
|
|
|
|
|
<a-input v-model="model.financeId" placeholder="请输入审核人id" ></a-input>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="24" >
|
|
|
|
@ -50,33 +70,43 @@
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="24" >
|
|
|
|
|
<a-form-model-item label="派单人ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dispacherId">
|
|
|
|
|
<a-input v-model="model.dispacherId" placeholder="请输入派单人" ></a-input>
|
|
|
|
|
<a-form-model-item label="付款回执url" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="financeUrl">
|
|
|
|
|
<j-image-upload isMultiple v-model="model.financeUrl" ></j-image-upload>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="24" >
|
|
|
|
|
<a-form-model-item label="派单人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dispacher">
|
|
|
|
|
<a-input v-model="model.dispacher" placeholder="请输入派单人" ></a-input>
|
|
|
|
|
<a-form-model-item label="仓管员id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dispacherId">
|
|
|
|
|
<a-input v-model="model.dispacherId" placeholder="请输入仓管员id" ></a-input>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="24" >
|
|
|
|
|
<a-form-model-item label="物流单号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="logisticsId">
|
|
|
|
|
<a-input v-model="model.logisticsId" placeholder="请输入物流单号" ></a-input>
|
|
|
|
|
<a-form-model-item label="仓管员" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dispacher">
|
|
|
|
|
<a-input v-model="model.dispacher" placeholder="请输入仓管员" ></a-input>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="24" >
|
|
|
|
|
<a-form-model-item label="提货时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dispacherTime">
|
|
|
|
|
<j-date placeholder="请选择提货时间" v-model="model.dispacherTime" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="24" >
|
|
|
|
|
<a-form-model-item label="派发时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dispacherTime">
|
|
|
|
|
<j-date placeholder="请选择派发时间" v-model="model.dispacherTime" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
|
|
|
|
|
<a-form-model-item label="出库回执url" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dispacherUrl">
|
|
|
|
|
<j-image-upload isMultiple v-model="model.dispacherUrl" ></j-image-upload>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="24" >
|
|
|
|
|
<a-form-model-item label="派发意见" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dispacherRemark">
|
|
|
|
|
<a-input v-model="model.dispacherRemark" placeholder="请输入派单意见" ></a-input>
|
|
|
|
|
<a-form-model-item label="物流单号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="logisticsId">
|
|
|
|
|
<a-input v-model="model.logisticsId" placeholder="请输入物流单号" ></a-input>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="24" >
|
|
|
|
|
<a-form-model-item label="提货备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dispacherRemark">
|
|
|
|
|
<a-input v-model="model.dispacherRemark" placeholder="请输入提货备注" ></a-input>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="24" >
|
|
|
|
|
<a-form-model-item label="订单状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="state">
|
|
|
|
|
<j-dict-select-tag type="list" v-model="model.state" dictCode="orderState" placeholder="请选择状态" />
|
|
|
|
|
<a-form-model-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="state">
|
|
|
|
|
<a-input-number v-model="model.state" placeholder="请输入状态" style="width: 100%" />
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="24" >
|
|
|
|
@ -87,7 +117,7 @@
|
|
|
|
|
</a-row>
|
|
|
|
|
</a-form-model>
|
|
|
|
|
</j-form-container>
|
|
|
|
|
<!-- 子表单区域 -->
|
|
|
|
|
<!-- 子表单区域 -->
|
|
|
|
|
<a-tabs v-model="activeKey" @change="handleChangeTabs">
|
|
|
|
|
<a-tab-pane tab="订单详情" :key="refKeys[0]" :forceRender="true">
|
|
|
|
|
<j-vxe-table
|
|
|
|
@ -101,7 +131,7 @@
|
|
|
|
|
:rowNumber="true"
|
|
|
|
|
:rowSelection="true"
|
|
|
|
|
:toolbar="true"
|
|
|
|
|
/>
|
|
|
|
|
/>
|
|
|
|
|
</a-tab-pane>
|
|
|
|
|
</a-tabs>
|
|
|
|
|
</a-spin>
|
|
|
|
@ -109,164 +139,164 @@
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
|
|
|
|
import { getAction } from '@/api/manage'
|
|
|
|
|
import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js'
|
|
|
|
|
import { JVXETypes } from '@/components/jeecg/JVxeTable'
|
|
|
|
|
import { getRefPromise,VALIDATE_FAILED} from '@/components/jeecg/JVxeTable/utils/vxeUtils.js'
|
|
|
|
|
import { validateDuplicateValue } from '@/utils/util'
|
|
|
|
|
import JFormContainer from '@/components/jeecg/JFormContainer'
|
|
|
|
|
import { getAction } from '@/api/manage'
|
|
|
|
|
import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js'
|
|
|
|
|
import { JVXETypes } from '@/components/jeecg/JVxeTable'
|
|
|
|
|
import { getRefPromise,VALIDATE_FAILED} from '@/components/jeecg/JVxeTable/utils/vxeUtils.js'
|
|
|
|
|
import { validateDuplicateValue } from '@/utils/util'
|
|
|
|
|
import JFormContainer from '@/components/jeecg/JFormContainer'
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: 'OrderForm',
|
|
|
|
|
mixins: [JVxeTableModelMixin],
|
|
|
|
|
components: {
|
|
|
|
|
JFormContainer,
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
labelCol: {
|
|
|
|
|
xs: { span: 24 },
|
|
|
|
|
sm: { span: 5 },
|
|
|
|
|
export default {
|
|
|
|
|
name: 'OrdersForm',
|
|
|
|
|
mixins: [JVxeTableModelMixin],
|
|
|
|
|
components: {
|
|
|
|
|
JFormContainer,
|
|
|
|
|
},
|
|
|
|
|
wrapperCol: {
|
|
|
|
|
xs: { span: 24 },
|
|
|
|
|
sm: { span: 16 },
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
labelCol: {
|
|
|
|
|
xs: { span: 24 },
|
|
|
|
|
sm: { span: 5 },
|
|
|
|
|
},
|
|
|
|
|
wrapperCol: {
|
|
|
|
|
xs: { span: 24 },
|
|
|
|
|
sm: { span: 16 },
|
|
|
|
|
},
|
|
|
|
|
model:{
|
|
|
|
|
},
|
|
|
|
|
// 新增时子表默认添加几行空数据
|
|
|
|
|
addDefaultRowNum: 1,
|
|
|
|
|
validatorRules: {
|
|
|
|
|
addr: [
|
|
|
|
|
{ required: true, message: '请输入地址!'},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
refKeys: ['orderDetail', ],
|
|
|
|
|
tableKeys:['orderDetail', ],
|
|
|
|
|
activeKey: 'orderDetail',
|
|
|
|
|
// 订单详情
|
|
|
|
|
orderDetailTable: {
|
|
|
|
|
loading: false,
|
|
|
|
|
dataSource: [],
|
|
|
|
|
columns: [
|
|
|
|
|
{
|
|
|
|
|
title: '主单id',
|
|
|
|
|
key: 'orderId',
|
|
|
|
|
type: JVXETypes.input,
|
|
|
|
|
width:"200px",
|
|
|
|
|
placeholder: '请输入${title}',
|
|
|
|
|
defaultValue:'',
|
|
|
|
|
validateRules: [{ required: true, message: '${title}不能为空' }],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '产品id',
|
|
|
|
|
key: 'goodsId',
|
|
|
|
|
type: JVXETypes.input,
|
|
|
|
|
width:"200px",
|
|
|
|
|
placeholder: '请输入${title}',
|
|
|
|
|
defaultValue:'',
|
|
|
|
|
validateRules: [{ required: true, message: '${title}不能为空' }],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '产品名称',
|
|
|
|
|
key: 'goodsName',
|
|
|
|
|
type: JVXETypes.input,
|
|
|
|
|
width:"200px",
|
|
|
|
|
placeholder: '请输入${title}',
|
|
|
|
|
defaultValue:'',
|
|
|
|
|
validateRules: [{ required: true, message: '${title}不能为空' }],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '产品数量',
|
|
|
|
|
key: 'goodsNo',
|
|
|
|
|
type: JVXETypes.input,
|
|
|
|
|
width:"200px",
|
|
|
|
|
placeholder: '请输入${title}',
|
|
|
|
|
defaultValue:'',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '备注',
|
|
|
|
|
key: 'remark',
|
|
|
|
|
type: JVXETypes.input,
|
|
|
|
|
width:"200px",
|
|
|
|
|
placeholder: '请输入${title}',
|
|
|
|
|
defaultValue:'',
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
url: {
|
|
|
|
|
add: "/erp/orders/add",
|
|
|
|
|
edit: "/erp/orders/edit",
|
|
|
|
|
queryById: "/erp/orders/queryById",
|
|
|
|
|
orderDetail: {
|
|
|
|
|
list: '/erp/orders/queryOrderDetailByMainId'
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
model:{
|
|
|
|
|
},
|
|
|
|
|
// 新增时子表默认添加几行空数据
|
|
|
|
|
addDefaultRowNum: 1,
|
|
|
|
|
validatorRules: {
|
|
|
|
|
addr: [
|
|
|
|
|
{ required: true, message: '请输入地址!'},
|
|
|
|
|
],
|
|
|
|
|
props: {
|
|
|
|
|
//表单禁用
|
|
|
|
|
disabled: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
default: false,
|
|
|
|
|
required: false
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
refKeys: ['orderDetail', ],
|
|
|
|
|
tableKeys:['orderDetail', ],
|
|
|
|
|
activeKey: 'orderDetail',
|
|
|
|
|
// 订单详情
|
|
|
|
|
orderDetailTable: {
|
|
|
|
|
loading: false,
|
|
|
|
|
dataSource: [],
|
|
|
|
|
columns: [
|
|
|
|
|
{
|
|
|
|
|
title: '主单id',
|
|
|
|
|
key: 'orderId',
|
|
|
|
|
type: JVXETypes.input,
|
|
|
|
|
width:"200px",
|
|
|
|
|
placeholder: '请输入${title}',
|
|
|
|
|
defaultValue:'',
|
|
|
|
|
validateRules: [{ required: true, message: '${title}不能为空' }],
|
|
|
|
|
computed: {
|
|
|
|
|
formDisabled(){
|
|
|
|
|
return this.disabled
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '产品id',
|
|
|
|
|
key: 'goodsId',
|
|
|
|
|
type: JVXETypes.input,
|
|
|
|
|
width:"200px",
|
|
|
|
|
placeholder: '请输入${title}',
|
|
|
|
|
defaultValue:'',
|
|
|
|
|
validateRules: [{ required: true, message: '${title}不能为空' }],
|
|
|
|
|
},
|
|
|
|
|
created () {
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
addBefore(){
|
|
|
|
|
this.orderDetailTable.dataSource=[]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '产品名称',
|
|
|
|
|
key: 'goodsName',
|
|
|
|
|
type: JVXETypes.input,
|
|
|
|
|
width:"200px",
|
|
|
|
|
placeholder: '请输入${title}',
|
|
|
|
|
defaultValue:'',
|
|
|
|
|
validateRules: [{ required: true, message: '${title}不能为空' }],
|
|
|
|
|
getAllTable() {
|
|
|
|
|
let values = this.tableKeys.map(key => getRefPromise(this, key))
|
|
|
|
|
return Promise.all(values)
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '产品数量',
|
|
|
|
|
key: 'goodsNo',
|
|
|
|
|
type: JVXETypes.input,
|
|
|
|
|
width:"200px",
|
|
|
|
|
placeholder: '请输入${title}',
|
|
|
|
|
defaultValue:'',
|
|
|
|
|
/** 调用完edit()方法之后会自动调用此方法 */
|
|
|
|
|
editAfter() {
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
})
|
|
|
|
|
// 加载子表数据
|
|
|
|
|
if (this.model.id) {
|
|
|
|
|
let params = { id: this.model.id }
|
|
|
|
|
this.requestSubTableData(this.url.orderDetail.list, params, this.orderDetailTable)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '备注',
|
|
|
|
|
key: 'remark',
|
|
|
|
|
type: JVXETypes.input,
|
|
|
|
|
width:"200px",
|
|
|
|
|
placeholder: '请输入${title}',
|
|
|
|
|
defaultValue:'',
|
|
|
|
|
//校验所有一对一子表表单
|
|
|
|
|
validateSubForm(allValues){
|
|
|
|
|
return new Promise((resolve,reject)=>{
|
|
|
|
|
Promise.all([
|
|
|
|
|
]).then(() => {
|
|
|
|
|
resolve(allValues)
|
|
|
|
|
}).catch(e => {
|
|
|
|
|
if (e.error === VALIDATE_FAILED) {
|
|
|
|
|
// 如果有未通过表单验证的子表,就自动跳转到它所在的tab
|
|
|
|
|
this.activeKey = e.index == null ? this.activeKey : this.refKeys[e.index]
|
|
|
|
|
} else {
|
|
|
|
|
console.error(e)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
url: {
|
|
|
|
|
add: "/erp/order/add",
|
|
|
|
|
edit: "/erp/order/edit",
|
|
|
|
|
queryById: "/erp/order/queryById",
|
|
|
|
|
orderDetail: {
|
|
|
|
|
list: '/erp/order/queryOrderDetailByMainId'
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
props: {
|
|
|
|
|
//表单禁用
|
|
|
|
|
disabled: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
default: false,
|
|
|
|
|
required: false
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
formDisabled(){
|
|
|
|
|
return this.disabled
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
created () {
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
addBefore(){
|
|
|
|
|
this.orderDetailTable.dataSource=[]
|
|
|
|
|
},
|
|
|
|
|
getAllTable() {
|
|
|
|
|
let values = this.tableKeys.map(key => getRefPromise(this, key))
|
|
|
|
|
return Promise.all(values)
|
|
|
|
|
},
|
|
|
|
|
/** 调用完edit()方法之后会自动调用此方法 */
|
|
|
|
|
editAfter() {
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
})
|
|
|
|
|
// 加载子表数据
|
|
|
|
|
if (this.model.id) {
|
|
|
|
|
let params = { id: this.model.id }
|
|
|
|
|
this.requestSubTableData(this.url.orderDetail.list, params, this.orderDetailTable)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
//校验所有一对一子表表单
|
|
|
|
|
validateSubForm(allValues){
|
|
|
|
|
return new Promise((resolve,reject)=>{
|
|
|
|
|
Promise.all([
|
|
|
|
|
]).then(() => {
|
|
|
|
|
resolve(allValues)
|
|
|
|
|
}).catch(e => {
|
|
|
|
|
if (e.error === VALIDATE_FAILED) {
|
|
|
|
|
// 如果有未通过表单验证的子表,就自动跳转到它所在的tab
|
|
|
|
|
this.activeKey = e.index == null ? this.activeKey : this.refKeys[e.index]
|
|
|
|
|
} else {
|
|
|
|
|
console.error(e)
|
|
|
|
|
/** 整理成formData */
|
|
|
|
|
classifyIntoFormData(allValues) {
|
|
|
|
|
let main = Object.assign(this.model, allValues.formValue)
|
|
|
|
|
return {
|
|
|
|
|
...main, // 展开
|
|
|
|
|
orderDetailList: allValues.tablesValue[0].tableData,
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
/** 整理成formData */
|
|
|
|
|
classifyIntoFormData(allValues) {
|
|
|
|
|
let main = Object.assign(this.model, allValues.formValue)
|
|
|
|
|
return {
|
|
|
|
|
...main, // 展开
|
|
|
|
|
orderDetailList: allValues.tablesValue[0].tableData,
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
validateError(msg){
|
|
|
|
|
this.$message.error(msg)
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
validateError(msg){
|
|
|
|
|
this.$message.error(msg)
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|