update 订单

This commit is contained in:
lb 2023-03-08 10:52:14 +08:00
parent 1bbb5c76de
commit a55d708a72
4 changed files with 211 additions and 51 deletions

View File

@ -277,6 +277,8 @@ export default {
typeCode: file.typeCode, typeCode: file.typeCode,
url: file.fileUrl, url: file.fileUrl,
})); }));
}
// console.log("[DialogJustForm] init():", this.dataForm);
} else { } else {
this.$message({ this.$message({
message: `${res.code}: ${res.msg}`, message: `${res.code}: ${res.msg}`,
@ -284,8 +286,6 @@ export default {
duration: 1500, duration: 1500,
}); });
} }
// console.log("[DialogJustForm] init():", this.dataForm);
}
this.loadingStatus = false; this.loadingStatus = false;
}) })
.catch((err) => { .catch((err) => {

View File

@ -211,12 +211,46 @@ export default {
}, },
inject: ["urls"], inject: ["urls"],
mounted() { mounted() {
this.initDataWhenLoad && this.getList(); this.getConfirmedList()
}, },
activated() { activated() {
this.refreshLayoutKey = this.layoutTable(); this.refreshLayoutKey = this.layoutTable();
}, },
methods: { methods: {
// get confirmed list
getConfirmedList(){
this.$http.post(this.urls.confirmedOrder, {
bomId: "0",
cate: "1",
code: "39999",
startTime: '2022-02-05T22:00:00',
endTime: '2022-02-06T22:00:00',
id: "0",
limit: 10,
page: 1,
shapeId: "1",
techId: "0",
types: 1 // 0 , 1 , 2 , 3 , 4 5 , 6
}).then(({data: res}) => {
if (res.code === 0) {
console.log('[get confirmed list]', res)
} else {
this.$message({
message: `${res.code}: ${res.msg}`,
type: 'error',
duration: 1500
})
}
})
},
// get unconfirmed list
getUnConfirmedList(){},
// get ended list
getEndedList(){
//
},
handleLoadSub({ tree, treeNode, resolve }) { handleLoadSub({ tree, treeNode, resolve }) {
// console.log("tree, treeNOde, resovle is:", tree, treeNode, resolve); // console.log("tree, treeNOde, resovle is:", tree, treeNode, resolve);
this.$http.get(`${this.urls.tree}?rootId=${tree.id}`).then(({ data: res }) => { this.$http.get(`${this.urls.tree}?rootId=${tree.id}`).then(({ data: res }) => {

View File

@ -86,21 +86,51 @@ export default function () {
}, },
]; ];
const headFormFields = [
const genHeadFormFields = type => ({
'ongoing': [
{ {
label: "原料名称/编码", label: '订单号',
prop: "key", prop: 'code',
input: true, input: true,
default: { value: "" }, bind: { placeholder: '请输入订单号' }
bind: { placeholder: "请输入原料名称或编码" },
}, },
{ {
// 时间段
timerange: true,
prop: 'timerange',
label: "时间段",
bind: {
placeholder: "选择日期时间",
type: "datetimerange",
"start-placeholder": "开始时间",
"end-placeholder": "结束时间",
},
},
{
// 查询
button: {
type: "primary",
name: "查询",
},
},
],
'pending': [
{
label: '订单号',
prop: 'code',
input: true,
bind: { placeholder: '请输入订单号' }
},
{
// 查询
button: { button: {
type: "primary", type: "primary",
name: "查询", name: "查询",
}, },
}, },
{ {
// 新增订单
button: { button: {
type: "primary", type: "primary",
name: "新增", name: "新增",
@ -110,7 +140,102 @@ export default function () {
plain: true, plain: true,
}, },
}, },
]; {
// 导入订单 - TODO: 需完善具体接口和功能
button: {
type: "success",
name: "导入订单",
},
bind: {
plain: true
}
},
],
'finished': [
{
// 查询
button: {
type: "primary",
name: "查询",
},
},
{
label: '订单号',
prop: 'code',
input: true,
bind: { placeholder: '请输入订单号' }
},
]
})[type]
// const headFormFields = [
// {
// label: '订单号',
// prop: 'code',
// input: true,
// bind: { placeholder: '请输入订单号' }
// },
// // {
// // label: '子订单号',
// // prop: 'cate',
// // input: true,
// // bind: { placeholder: '请输入子订单号', rules: [{ type: 'number', message: '请输入整数', trigger: 'blur', transform: val => Number(val) }] }
// // },
// // {
// // label: "配方",
// // prop: "bomId",
// // select: [],
// // fn: () => this.$http.get('/pms/bom/page', { params: { key: '', limit: 999, page: 1 } }),
// // bind: { placeholder: "请选择配方" },
// // },
// // {
// // label: '砖型',
// // prop: 'shapeId',
// // select: [],
// // fn: () => this.$http.get('/pms/shape/page', { params: { key: '', limit: 999, page: 1 } }),
// // bind: { placeholder: "请选择砖型" },
// // },
// // {
// // label: '工艺',
// // prop: 'techId',
// // select: [],
// // fn: () => this.$http.post('/pms/equipmentTech/pageView', { key: '', shape: '', wsId: 0, limit: 999, page: 1 }),
// // bind: { placeholder: "请选择砖型" },
// // },
// // {
// // label: '订单状态',
// // prop: 'types', // 0等待, 1确认, 2生产3暂停, 4结束, 5接受, 6拒绝
// // select: [
// // {label: '等待', value: 0},
// // {label: '确认', value: 1},
// // {label: '生产', value: 2},
// // {label: '暂停', value: 3},
// // {label: '结束', value: 4},
// // {label: '接受', value: 5},
// // {label: '拒绝', value: 6},
// // ],
// // // fn: () => this.$http.post('/pms/equipmentTech/pageView', { key: '', shape: '', wsId: 0, limit: 999, page: 1 }),
// // bind: { placeholder: "请选择订单状态" },
// // },
// {
// button: {
// type: "primary",
// name: "查询",
// },
// },
// {
// button: {
// type: "primary",
// name: "新增",
// permission: "",
// },
// bind: {
// plain: true,
// },
// },
// ];
/** /**
* dialog config 有两个版本一个适用于 DialogWithMenu 组件另一个适用于 DialogJustForm 组件 * dialog config 有两个版本一个适用于 DialogWithMenu 组件另一个适用于 DialogJustForm 组件
@ -275,8 +400,9 @@ export default function () {
finishedTable: genTableProps('finished'), finishedTable: genTableProps('finished'),
}, },
headFormConfigs: { headFormConfigs: {
rules: null, // 名称是由 BaseSearchForm.vue 组件固定的 ongoingTableSearch: genHeadFormFields('ongoing'),
fields: headFormFields, // 名称是由 BaseSearchForm.vue 组件固定的 pendingTableSearch: genHeadFormFields('pending'),
finishedTableSearch: genHeadFormFields('finished')
}, },
urls: { urls: {
confirmedOrder: '/pms/order/pageCom', confirmedOrder: '/pms/order/pageCom',

View File

@ -1,6 +1,6 @@
<template> <template>
<!-- <ListViewWithHead :table-configs="tableConfigs" :head-config="headFormConfigs" :dialog-configs="dialogConfigs" /> --> <ListViewWithHead :table-configs="tableConfigs" :head-config="headFormConfigs" :dialog-configs="dialogConfigs" />
<div style="padding: 16px; background: #fff; border-radius: 8px"> <!-- <div style="padding: 16px; background: #fff; border-radius: 8px">
<el-table :data="dataList"> <el-table :data="dataList">
<el-table-column key="id" prop="id" label="ID"></el-table-column> <el-table-column key="id" prop="id" label="ID"></el-table-column>
<el-table-column key="name" prop="name" label="名字"></el-table-column> <el-table-column key="name" prop="name" label="名字"></el-table-column>
@ -12,39 +12,39 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div> -->
</template> </template>
<script> <script>
import initConfig from "./config"; import initConfig from "./config";
// import ListViewWithHead from "./components/ListViewWithHead.vue"; import ListViewWithHead from "./components/ListViewWithHead.vue";
export default { export default {
name: "OrderView", name: "OrderView",
// components: { ListViewWithHead }, components: { ListViewWithHead },
provide() { provide() {
return { return {
urls: this.allUrls, urls: this.allUrls,
}; };
}, },
data() { data() {
// const { tableConfigs, headFormConfigs, urls, dialogConfigs } = initConfig.call(this); const { tableConfigs, headFormConfigs, urls, dialogConfigs } = initConfig.call(this);
// return {
// tableConfigs,
// headFormConfigs,
// allUrls: urls,
// dialogConfigs,
// };
return { return {
dataList: [ tableConfigs,
{ id: 1, name: "张三", age: 12 }, headFormConfigs,
{ id: 2, name: "李四", age: 13 }, allUrls: urls,
{ id: 3, name: "王五", age: 14 }, dialogConfigs,
{ id: 4, name: "陈鼻", age: 15 },
{ id: 5, name: "肖上唇", age: 16 },
],
limit: 20
}; };
// return {
// dataList: [
// { id: 1, name: "", age: 12 },
// { id: 2, name: "", age: 13 },
// { id: 3, name: "", age: 14 },
// { id: 4, name: "", age: 15 },
// { id: 5, name: "", age: 16 },
// ],
// limit: 20
// };
}, },
created() {}, created() {},
mounted() {}, mounted() {},