This commit is contained in:
lb 2023-03-08 16:04:30 +08:00
parent bbfd450c9f
commit 77eab26048
5 changed files with 99 additions and 83 deletions

View File

@ -39,8 +39,8 @@
<script> <script>
// window.SITE_CONFIG['apiURL'] = 'http://192.168.1.103:8080/pms-am'; // window.SITE_CONFIG['apiURL'] = 'http://192.168.1.103:8080/pms-am';
// window.SITE_CONFIG['apiURL'] = 'http://192.168.1.49:8080/pms-am'; // tengyun // window.SITE_CONFIG['apiURL'] = 'http://192.168.1.49:8080/pms-am'; // tengyun
// window.SITE_CONFIG['apiURL'] = 'http://192.168.1.62:8080/pms-am'; // tao window.SITE_CONFIG['apiURL'] = 'http://192.168.1.62:8080/pms-am'; // tao
window.SITE_CONFIG['apiURL'] = 'http://192.168.1.21:8080/pms-am'; // xv // window.SITE_CONFIG['apiURL'] = 'http://192.168.1.21:8080/pms-am'; // xv
</script> </script>
<% } %> <% } %>
<!-- 集成测试环境 --> <!-- 集成测试环境 -->

View File

@ -20,6 +20,11 @@ export default {
delete: '#FF5454', delete: '#FF5454',
preview: '#f09843', preview: '#f09843',
design: '#99089f', design: '#99089f',
'destroy-order': '#FF5454',
'confirm-order': '#37d97f',
'end-order': '#f09843',
'move-to-top': '#8833ff',
'move-to-bottom': '#8833ff',
// 'view-trend': 'red' // 'view-trend': 'red'
// add more... // add more...
}, },
@ -72,11 +77,11 @@ export default {
btns.push( btns.push(
h('el-button', h('el-button',
{ {
props: { type: 'text' }, props: { type: opt.type ?? 'text', icon: opt.icon ? `el-icon-${opt.icon}` : '', title: opt.label ?? opt.name },
style: { color: this.colors[opt.name] || '#0b58ff' }, style: { color: this.colors[opt.name] || '#0b58ff' },
on: { click: this.emit.bind(null, opt) } on: { click: this.emit.bind(null, opt) }
}, },
this.text[opt.name] opt.icon ? opt.showText ? this.text[opt.name] ?? opt.label : '' : ''
) )
) )
} }
@ -89,7 +94,7 @@ export default {
style: { color: this.colors[opt] || '#0b58ff' }, style: { color: this.colors[opt] || '#0b58ff' },
on: { click: this.emit.bind(null, opt) } on: { click: this.emit.bind(null, opt) }
}, },
this.text[opt] this.text[opt] ?? opt
) )
) )
} }

View File

@ -33,6 +33,7 @@
} }
: null : null
" "
:fixed="head.fixed || null"
v-bind="head.more" v-bind="head.more"
></el-table-column> ></el-table-column>
<!-- 普通的表头 --> <!-- 普通的表头 -->

View File

@ -24,9 +24,8 @@
v-loading="tableLoading" v-loading="tableLoading"
:table-config="null" :table-config="null"
:column-config="tableConfigs.ongoingTable" :column-config="tableConfigs.ongoingTable"
:table-data="dataList" :table-data="dataLists.ongoing"
@operate-event="handleOperate" @operate-event="handleOperate"
@load-sub="handleLoadSub"
:refresh-layout-key="refreshLayoutKey" :refresh-layout-key="refreshLayoutKey"
/> />
@ -55,7 +54,6 @@
:column-config="tableConfigs.pendingTable" :column-config="tableConfigs.pendingTable"
:table-data="dataList" :table-data="dataList"
@operate-event="handleOperate" @operate-event="handleOperate"
@load-sub="handleLoadSub"
:refresh-layout-key="refreshLayoutKey" :refresh-layout-key="refreshLayoutKey"
/> />
<el-pagination <el-pagination
@ -83,7 +81,6 @@
:column-config="tableConfigs.finishedTable" :column-config="tableConfigs.finishedTable"
:table-data="dataList" :table-data="dataList"
@operate-event="handleOperate" @operate-event="handleOperate"
@load-sub="handleLoadSub"
:refresh-layout-key="refreshLayoutKey" :refresh-layout-key="refreshLayoutKey"
/> />
@ -260,11 +257,31 @@ export default {
], ],
}, },
}, },
conditions: {
ongoing: {
limit: 20,
code: "",
page: 1,
},
pending: {
limit: 20,
page: 1,
},
finished: {
limit: 20,
page: 1,
},
},
dataLists: {
ongoing: [],
pending: [],
finished: [],
},
}; };
}, },
inject: ["urls"], inject: ["urls"],
mounted() { mounted() {
this.getConfirmedList(); this.getSpecificList("ongoing", this.conditions.ongoing);
console.log("[list view with head]", this.headConfigs); console.log("[list view with head]", this.headConfigs);
}, },
activated() { activated() {
@ -272,25 +289,28 @@ export default {
}, },
methods: { methods: {
// get confirmed list // get confirmed list
getConfirmedList() { getSpecificList(type, payload) {
this.$http let url = "#";
.post(this.urls.confirmedOrder, { switch (type) {
bomId: "0", case "ongoing":
cate: "1", url = this.urls.confirmedOrder;
code: "39999", break;
startTime: "2022-02-05T22:00:00", case "pending":
endTime: "2022-02-06T22:00:00", url = this.urls.unConfirmedOrder;
id: "0", break;
limit: 10, case "finished":
page: 1, url = this.urls.finishedOrder;
shapeId: "1", break;
techId: "0", }
types: 1, // 0 , 1 , 2 , 3 , 4 5 , 6
}) this.$http.post(url, payload).then(({ data: res }) => {
.then(({ data: res }) => { if (res.code === 0 && res.data) {
if (res.code === 0) { if ("list" in res.data) {
console.log("[get confirmed list]", res); console.log("list .............", res.data.list);
this.dataLists[type] = res.data.list
} else console.log("没有res.data.list属性");
} else { } else {
this.dataLists[type].splice(0)
this.$message({ this.$message({
message: `${res.code}: ${res.msg}`, message: `${res.code}: ${res.msg}`,
type: "error", type: "error",
@ -299,29 +319,6 @@ export default {
} }
}); });
}, },
// get unconfirmed list
getUnConfirmedList() {},
// get ended list
getEndedList() {
//
},
handleLoadSub({ tree, treeNode, resolve }) {
// console.log("tree, treeNOde, resovle is:", tree, treeNode, resolve);
this.$http.get(`${this.urls.tree}?rootId=${tree.id}`).then(({ data: res }) => {
if (res.code === 0 && res.data) {
resolve(
res.data.map((item) => {
if (item.children) item.hasChildren = true;
/** TODO: 合并物料类型 和 类别 */
return item;
})
);
}
});
},
layoutTable() { layoutTable() {
return Math.random(); return Math.random();
@ -441,17 +438,25 @@ export default {
location.reload(); location.reload();
}, },
handleBtnClick({ btnName, payload }) { handleBtnClick(type, { btnName, payload }) {
console.log("[search] form handleBtnClick", btnName, payload); switch (type) {
switch (btnName) { case "ongoing": {
case "新增": }
this.openDialog(); case "pending":
break; break;
case "查询": { case "finished":
this.getList(payload);
break; break;
} }
} // console.log("[search] form handleBtnClick", type, btnName, payload);
// switch (btnName) {
// case "":
// this.openDialog();
// break;
// case "": {
// this.getList(payload);
// break;
// }
// }
}, },
/** 导航器的操作 */ /** 导航器的操作 */

View File

@ -22,35 +22,39 @@ export default function () {
const operations = { const operations = {
'ongoing': [ 'ongoing': [
{ name: 'view-detail', label: '查看详情' }, // { name: 'view-detail', label: '查看详情' },
{ name: 'end-order', label: '结束订单' }, { name: 'confirm-order', label: '确认', icon: 'success', showText: true },
{ name: 'confirm-order', label: '确认订单' }, { name: 'end-order', label: '结束', icon: 'error', showText: true },
{ name: 'move-to-top', label: 'to top', icon: 'top' }, { name: 'move-up', label: '上移', icon: 'caret-top', showText: true },
{ name: 'move-up', label: 'up', icon: 'top' }, { name: 'move-down', label: '下移', icon: 'caret-bottom', showText: true },
{ name: 'move-down', label: 'down', icon: 'top' }, { name: 'move-to-top', label: '至顶', icon: 'upload2', showText: true },
{ name: 'move-to-bottom', label: 'to bottom', icon: 'top' }, { name: 'move-to-bottom', label: '至底', icon: 'download', showText: true },
{ name: 'destroy-order', label: '废除订单' }, { name: 'destroy-order', label: '废除', icon: 'delete-solid', showText: true },
], ],
'pending': [ 'pending': [
{ name: 'confirm-order', label: '确认订单' }, { name: 'confirm-order', label: '确认订单' },
{ name: 'edit' }, { name: 'edit' },
{ name: 'move-to-top', label: 'to top' }, { name: 'move-up', label: '上移', icon: 'caret-top' },
{ name: 'move-up', label: 'up' }, { name: 'move-down', label: '下移', icon: 'caret-bottom' },
{ name: 'move-down', label: 'down' }, { name: 'move-to-top', label: '移至顶部', icon: 'upload2' },
{ name: 'move-to-bottom', label: 'to bottom' }, { name: 'move-to-bottom', label: '移至底部', icon: 'download' },
// { name: 'move-to-top', label: 'to top' },
// { name: 'move-up', label: 'up' },
// { name: 'move-down', label: 'down' },
// { name: 'move-to-bottom', label: 'to bottom' },
{ name: 'delete' }, { name: 'delete' },
], ],
'finished': [ 'finished': [
{ name: 'view-detail', label: '查看详情' } // { name: 'view-detail', label: '查看详情' }
] ]
} }
const genTableProps = (type /** ongoing, pending, finished */) => const genTableProps = (type /** ongoing, pending, finished */) =>
[ [
{ width: 80, type: 'index', label: '序号' }, { width: 80, type: 'index', label: '序号', fixed: true },
{ width: 120, prop: "code", label: "订单号", fixed: 'left' },
{ width: 120, prop: "createTime", label: "添加时间", filter: timeFilter }, { width: 120, prop: "createTime", label: "添加时间", filter: timeFilter },
{ width: 200, prop: "code", label: "订单号" },
{ width: 120, prop: "statusDictValue", label: "订单状态", filter: dictFilter('order_status') }, // 不可编辑 { width: 120, prop: "statusDictValue", label: "订单状态", filter: dictFilter('order_status') }, // 不可编辑
{ width: 200, prop: "cate", label: "子订单号" }, { width: 200, prop: "cate", label: "子订单号" },
{ width: 200, prop: "productCode", label: "物料编号" }, // select, filterable { width: 200, prop: "productCode", label: "物料编号" }, // select, filterable
@ -71,18 +75,19 @@ export default function () {
{ width: 200, prop: "saleNo", label: "销售订单号" }, { width: 200, prop: "saleNo", label: "销售订单号" },
{ width: 200, prop: "saleOrderItem", label: "销售订单item号" }, { width: 200, prop: "saleOrderItem", label: "销售订单item号" },
{ width: 200, prop: "packTechCode", label: "包装工艺代码" }, // select, filterable { width: 200, prop: "packTechCode", label: "包装工艺代码" }, // select, filterable
{ width: 80, prop: "specifications", label: "生产订单类型" }, { width: 120, prop: "specifications", label: "生产订单类型" },
{ width: 120, prop: "deliveryTime", label: "发货时间" }, { width: 120, prop: "deliveryTime", label: "发货时间" },
{ width: 120, prop: "customerCode", label: "客户" }, { width: 120, prop: "customerCode", label: "客户" },
// { prop: "description", label: "详情", subcomponent: TableTextComponent },
{ width: 120, prop: "pcsKilnCar", label: "托盘码放砖数", }, { width: 120, prop: "pcsKilnCar", label: "托盘码放砖数", },
{ width: 200, prop: "remark", label: "备注" }, { width: 200, prop: "remark", label: "备注" },
{ prop: "description", label: "详情", subcomponent: TableTextComponent },
{ {
prop: "operations", prop: "operations",
name: "操作", name: "操作",
fixed: "right", fixed: "right",
subcomponent: TableOperaionComponent, subcomponent: TableOperaionComponent,
options: operations[type] options: operations[type],
width: operations[type].length * 64
}, },
]; ];