【init】 创建erp 项目

develop
NH-LHG 2 years ago
parent 6337a97a12
commit 89c3b0a296

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

Loading…
Cancel
Save