Compare commits

..

41 Commits

Author SHA1 Message Date
lb
6b978fa93b done 1019 again 2023-10-19 16:22:56 +08:00
lb
82171c8ea8 done 1019 again 2023-10-19 16:14:00 +08:00
lb
41f2f01fd7 done 1019 2023-10-19 16:12:33 +08:00
lb
002c5a80e5 update 1019 2023-10-19 14:47:18 +08:00
lb
31b2cfcee6 add car maintain 2023-09-26 09:43:43 +08:00
lb
506cab65a4 bugfix 0922 2023-09-22 14:41:11 +08:00
lb
33d13b3eb4 update docs0918 2023-09-19 15:17:30 +08:00
lb
3c44fbc636 update 2023-09-15 16:56:51 +08:00
lb
61ca7b82cd update 2023-09-15 15:19:39 +08:00
lb
eafb0f7c2a update 2023-09-15 09:20:22 +08:00
lb
1f99830600 update 2023-09-14 17:03:23 +08:00
lb
1bd826b21c update 0913 2023-09-13 10:50:10 +08:00
lb
71851b65e0 update orderimport template 2023-09-11 15:46:40 +08:00
lb
13de0ce8ea update 订单-导出 2023-09-08 14:18:35 +08:00
lb
bd73613803 update 0904docs 2023-09-05 10:49:37 +08:00
lb
847b2c787c update docs_0825 2023-08-25 15:21:27 +08:00
lb
7de3355106 update print dom 2023-08-25 11:04:27 +08:00
lb
807766f83f add 包装报工-检测线报工 2023-08-25 10:51:16 +08:00
lb
521563bd00 Merge branch 'docs_0815' 2023-08-23 16:38:09 +08:00
lb
d4a427ec5e update docs_0822 2023-08-23 16:30:59 +08:00
lb
a28544b671 add 生成托盘弹窗 2023-08-22 10:36:46 +08:00
lb
7513d82d4d add 报工历史 2023-08-21 16:16:23 +08:00
lb
02c8538d47 update dialog style 2023-08-21 13:30:42 +08:00
lb
7b0f53f677 add 库存订单表 2023-08-21 10:56:21 +08:00
lb
a33784740d update 订单编辑相关页面 2023-08-21 09:37:33 +08:00
lb
0939b96386 update report dialog 2023-08-21 08:58:41 +08:00
lb
58f86a9b2b update 压机报工页面 2023-08-18 11:02:01 +08:00
lb
3adabb68b8 add 报工预览 2023-08-17 17:01:53 +08:00
lb
725fa19bd1 update 批量打印 2023-08-16 16:58:55 +08:00
lb
cdaa2c1f6c update 压机报工的search logic 2023-08-16 11:30:16 +08:00
lb
84a4b2999d add 压机报工 2023-08-15 13:24:39 +08:00
lb
99619fdc0a bug PrintDom 打印成功也会提示失败 2023-08-15 10:41:43 +08:00
lb
d1bc97f42a update 更新包装托盘打印 2023-08-14 17:00:28 +08:00
lb
62f625197f add print logic 2023-08-11 16:23:58 +08:00
lb
4addca6d97 update docs_0811 2023-08-11 11:05:05 +08:00
lb
09c6a609b8 update docs_0810 2023-08-10 16:14:53 +08:00
lb
e3346be048 Merge branch 'docs_0727' 2023-08-09 14:12:46 +08:00
lb
bc5b6c2868 update 订单管理的cell-class-name 2023-08-09 14:11:57 +08:00
lb
bfd6a42349 update blender-order 2023-08-09 10:52:02 +08:00
lb
42a7fb8bc9 Merge branch 'docs_0727' 2023-08-03 10:00:55 +08:00
lb
c5b99b3ec4 Merge branch 'docs_0727' 2023-07-27 17:01:09 +08:00
149 changed files with 5378 additions and 1158 deletions

View File

@ -1,5 +1,5 @@
{ {
"printWidth": 120, "printWidth": 108,
"bracketSameLine": true, "bracketSameLine": true,
"htmlWhitespaceSensitivity": "ignore", "htmlWhitespaceSensitivity": "ignore",
"semi": true, "semi": true,

View File

@ -17,12 +17,15 @@
"babel-plugin-component": "^1.1.1", "babel-plugin-component": "^1.1.1",
"code-brick-zj": "^0.0.7", "code-brick-zj": "^0.0.7",
"core-js": "^3.6.5", "core-js": "^3.6.5",
"dayjs": "^1.11.9",
"echarts": "^5.3.3", "echarts": "^5.3.3",
"element-theme": "^2.0.1", "element-theme": "^2.0.1",
"element-ui": "^2.15.7", "element-ui": "^2.15.7",
"js-cookie": "^2.2.1", "js-cookie": "^2.2.1",
"jsbarcode": "^3.11.5",
"lodash": "^4.17.19", "lodash": "^4.17.19",
"moment": "^2.29.4", "moment": "^2.29.4",
"qrcode": "^1.5.3",
"qs": "^6.9.4", "qs": "^6.9.4",
"quill": "^1.3.7", "quill": "^1.3.7",
"sass": "^1.26.5", "sass": "^1.26.5",

Binary file not shown.

View File

@ -38,10 +38,10 @@
<% if (process.env.VUE_APP_NODE_ENV === 'dev') { %> <% if (process.env.VUE_APP_NODE_ENV === 'dev') { %>
<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.67:8080/pms-am'; // wenzhang // window.SITE_CONFIG['apiURL'] = 'http://192.168.1.67:8080/pms-am'; // wenzhang
// 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
// window.SITE_CONFIG['apiURL'] = 'http://localhost:3000/p//////ms-am'; // xv // window.SITE_CONFIG['apiURL'] = 'http://localhost:3000/p//////ms-am'; // xv
</script> </script>
<% } %> <% } %>
@ -60,7 +60,7 @@
<!-- 生产环境 --> <!-- 生产环境 -->
<% if (process.env.VUE_APP_NODE_ENV === 'prod') { %> <% if (process.env.VUE_APP_NODE_ENV === 'prod') { %>
<script> <script>
window.SITE_CONFIG['apiURL'] = 'http://10.196.233.155:8080/pms-am'; window.SITE_CONFIG['apiURL'] = 'http://10.196.233.155/pms-am';
</script> </script>
<% } %> <% } %>
</head> </head>

View File

@ -538,7 +538,7 @@ img {
.aui-content { .aui-content {
position: relative; position: relative;
padding: $content--padding; padding: $content--padding;
min-height: calc(100vh - #{$navbar--height}); min-height: calc(100vh - 30px - #{$navbar--height});
&__wrapper { &__wrapper {
position: relative; position: relative;
margin-left: $sidebar--width; margin-left: $sidebar--width;
@ -673,7 +673,8 @@ img {
z-index: 830; z-index: 830;
} }
> .el-tab-pane { > .el-tab-pane {
min-height: calc(#{$content--fill-height-tabs}); // min-height: calc(#{$content--fill-height-tabs});
min-height: calc(100vh - 144px);
> .aui-card--fill > .el-card__body { > .aui-card--fill > .el-card__body {
min-height: calc(#{$content--fill-height-tabs} - 2px); min-height: calc(#{$content--fill-height-tabs} - 2px);
} }

View File

@ -11,8 +11,7 @@
row-key="id" row-key="id"
:cell-style="{ padding: 0 }" :cell-style="{ padding: 0 }"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
border border>
>
<!-- :cell-style="{ padding: 0 }" --> <!-- :cell-style="{ padding: 0 }" -->
<!-- @cell-mouse-enter="(row, col, cell, event) => $emit('cell-mouse-enter', row, col, cell, event)"> --> <!-- @cell-mouse-enter="(row, col, cell, event) => $emit('cell-mouse-enter', row, col, cell, event)"> -->
<!-- @cell-mouse-leave="(row, col, cell, event) => $emit('cell-mouse-leave', row, col, cell, event)"> --> <!-- @cell-mouse-leave="(row, col, cell, event) => $emit('cell-mouse-leave', row, col, cell, event)"> -->
@ -34,8 +33,7 @@
} }
: null : null
" "
v-bind="head.more" v-bind="head.more"></el-table-column>
></el-table-column>
<!-- 普通的表头 --> <!-- 普通的表头 -->
<el-table-column <el-table-column
v-else v-else
@ -50,8 +48,7 @@
:align="head.align || null" :align="head.align || null"
:class-name="head.className ?? 'initial-column-class'" :class-name="head.className ?? 'initial-column-class'"
v-bind="head.more" v-bind="head.more"
:show-overflow-tooltip="head.showOverflowTooltip ?? !(head.prop === 'operations')" :show-overflow-tooltip="head.showOverflowTooltip ?? !(head.prop === 'operations')">
>
<!-- :show-overflow-tooltip="head.showOverflowTooltip || true" --> <!-- :show-overflow-tooltip="head.showOverflowTooltip || true" -->
<!-- 子组件 --> <!-- 子组件 -->
<template v-if="head.prop" slot-scope="scope"> <template v-if="head.prop" slot-scope="scope">
@ -60,15 +57,17 @@
:is="head.subcomponent" :is="head.subcomponent"
:key="idx + 'sub'" :key="idx + 'sub'"
:inject-data="{ ...scope.row, head }" :inject-data="{ ...scope.row, head }"
@emit-data="handleSubEmitData" @emit-data="handleSubEmitData" />
/>
<!-- 直接展示数据或应用过滤器 --> <!-- 直接展示数据或应用过滤器 -->
<span v-else>{{ scope.row[head.prop] | commonFilter(head.filter) }}</span> <span v-else>{{ scope.row[head.prop] | commonFilter(head.filter) }}</span>
</template> </template>
<!-- 多级表头 --> <!-- 多级表头 -->
<template v-if="!head.prop && head.children"> <template v-if="!head.prop && head.children">
<TableHead v-for="(subhead, subindex) in head.children" :key="'subhead-' + idx + '-subindex-' + subindex" :opt="subhead" /> <TableHead
v-for="(subhead, subindex) in head.children"
:key="'subhead-' + idx + '-subindex-' + subindex"
:opt="subhead" />
</template> </template>
</el-table-column> </el-table-column>
</template> </template>
@ -109,12 +108,16 @@ export default {
type: Number, type: Number,
default: 0, default: 0,
}, },
selectProps: {
type: Array,
default: null,
},
}, },
// inject: ["urls"], // inject: ["urls"],
data() { data() {
return { return {
dataList: [], dataList: [],
selections: [] selections: [],
}; };
}, },
watch: { watch: {
@ -124,15 +127,31 @@ export default {
}, },
methods: { methods: {
handleSubEmitData(payload) { handleSubEmitData(payload) {
console.log("[component] BaseListTable handleSubEmitData(): ", payload); //console.log("[component] BaseListTable handleSubEmitData(): ", payload);
this.$emit("operate-event", payload); this.$emit("operate-event", payload);
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
// this.selections = val; // this.selections = val;
console.log('selections change: ', val) //console.log("selections change: ", val);
this.$emit('select', val.map(item => item.id)) if (this.selectProps.length == 0)
this.$emit(
"select",
val.map((item) => item.id)
);
else {
this.$emit(
"select",
val.map((item) => {
const payload = {};
this.selectProps.forEach((key) => {
payload[key] = item[key];
});
return payload;
})
);
} }
}, },
},
}; };
</script> </script>

View File

@ -34,6 +34,32 @@
</span> </span>
</el-option> </el-option>
</el-select> </el-select>
<el-select
v-if="opt.complexSelect"
v-model="dataForm[opt.prop]"
v-bind="opt.bind"
clearable
size="small"
@keydown.enter.native.prevent="handleBtnClick('查询')">
<el-option
v-for="item in opt.complexSelect"
:key="item.value + Math.random().toString()"
:label="item.label"
:value="item.value">
<span>{{ item.label }}</span>
<span v-if="opt.customLabel" style="display: inline-clock; margin-left: 12px; font-size: 0.9em">
{{ item[opt.customLabel] || "无描述" }}
</span>
<template v-if="opt.customLabels">
<span
v-for="(label, idx) in opt.customLabels"
:key="Math.random()"
style="display: inline-clock; margin-left: 12px; font-size: 0.9em">
{{ item[label] || " - " }}
</span>
</template>
</el-option>
</el-select>
<el-date-picker <el-date-picker
v-if="opt.timerange" v-if="opt.timerange"
v-model="dataForm[opt.prop]" v-model="dataForm[opt.prop]"
@ -77,20 +103,9 @@ export default {
dataForm: {}, dataForm: {},
}; };
}, },
// watch ......
// watch: {
// dataForm: {
// handler: (val) => {
// console.log("[BaseSearchForm::watcher::dataForm]", val);
// },
// deep: true,
// },
// },
created() {}, created() {},
mounted() { mounted() {
console.log("[BaseSearchForm] configs:", JSON.parse(JSON.stringify(this.headConfig))); //console.log("[BaseSearchForm] configs:", JSON.parse(JSON.stringify(this.headConfig)));
this.headConfig.fields.forEach((field, index) => { this.headConfig.fields.forEach((field, index) => {
// field.prop // field.prop
@ -114,20 +129,33 @@ export default {
if (res.code === 0 && res.data) { if (res.code === 0 && res.data) {
// TODO: // TODO:
if ("list" in res.data) { if ("list" in res.data) {
this.$set( const optionProp = "complexSelect" in field ? "complexSelect" : "select";
field, let options = [];
"select", if (field.customLabel) {
"customLabel" in field options = res.data.list.map((item) => ({
? res.data.list.map((item) => ({
label: optionLabel ? item[optionLabel] : item.name, label: optionLabel ? item[optionLabel] : item.name,
value: optionValue ? item[optionValue] : item.id, value: optionValue ? item[optionValue] : item.id,
[field.customLabel]: item[field.customLabel], [field.customLabel]: item[field.customLabel],
})) }));
: res.data.list.map((item) => ({ } else if (field.customLabels) {
options = res.data.list.map((item) => {
let extraOptions = {};
field.customLabels.forEach((label) => {
extraOptions[label] = item[label];
});
return {
label: optionLabel ? item[optionLabel] : item.name, label: optionLabel ? item[optionLabel] : item.name,
value: optionValue ? item[optionValue] : item.id, value: optionValue ? item[optionValue] : item.id,
})) ...extraOptions,
); };
});
} else {
options = res.data.list.map((item) => ({
label: optionLabel ? item[optionLabel] : item.name,
value: optionValue ? item[optionValue] : item.id,
}));
}
this.$set(field, optionProp, options);
} }
} else { } else {
this.$message({ this.$message({
@ -143,7 +171,7 @@ export default {
// TODO: ... // TODO: ...
if (field.watch) { if (field.watch) {
// const { index: innerIdx, condition } = field.watch; // const { index: innerIdx, condition } = field.watch;
// console.log("=====field.watch=====", innerIdx, this.searchForm[innerIdx], this.headConfig.fields[innerIdx].default); // //console.log("=====field.watch=====", innerIdx, this.searchForm[innerIdx], this.headConfig.fields[innerIdx].default);
// // // //
// this.$watch( // this.$watch(
// () => this.searchForm[innerIdx], // () => this.searchForm[innerIdx],
@ -153,19 +181,19 @@ export default {
// // queryParams // // queryParams
// // }) // // })
// this.$http(field.url, queryParams).then((res) => { // this.$http(field.url, queryParams).then((res) => {
// console.log("[==>] !!!", queryParams, res); // //console.log("[==>] !!!", queryParams, res);
// // index // // index
// this.searchForm[index] = Math.floor(Math.random() * 10); // this.searchForm[index] = Math.floor(Math.random() * 10);
// }); // });
// } // }
// ); // );
// console.log("[BaseSearchForm] mounted(): ", this.searchForm); // //console.log("[BaseSearchForm] mounted(): ", this.searchForm);
// // // //
// if (this.searchForm[innerIdx]) { // if (this.searchForm[innerIdx]) {
// // TODO: ... // // TODO: ...
// console.log("TODO: ..."); // //console.log("TODO: ...");
// } else { // } else {
// console.log("TODO: ..."); // //console.log("TODO: ...");
// } // }
} }
}); });

View File

@ -100,15 +100,6 @@ export default {
methods: { methods: {
/** init **/ /** init **/
init(id) { init(id) {
if (!id) {
this.$message({
message: `没有传 id!`,
type: "error",
duration: 1500,
});
console.log("[*] 传入car payload对话框的id是", id);
return;
}
this.showPaination = false; this.showPaination = false;
this.id = id; this.id = id;
this.getList(); this.getList();
@ -130,7 +121,7 @@ export default {
params, params,
}) })
.then(({ data: res }) => { .then(({ data: res }) => {
console.log("[car payload dialog] [http response] res is: ", res); //console.log("[car payload dialog] [http response] res is: ", res);
if (res.code === 0) { if (res.code === 0) {
// page : // page :
@ -183,7 +174,7 @@ export default {
}, },
handleBtnClick(payload) { handleBtnClick(payload) {
console.log("btn click payload: ", payload); //console.log("btn click payload: ", payload);
if ("name" in payload) { if ("name" in payload) {
switch (payload.name) { switch (payload.name) {
@ -199,7 +190,7 @@ export default {
// break; // break;
} }
} else { } else {
console.log("[x] 不是这么用的! 缺少name属性"); //console.log("[x] ! name");
} }
}, },

View File

@ -1,17 +1,14 @@
<template> <template>
<el-dialog <el-dialog
class="dialog-just-form" class="dialog-just-form"
custom-class="pms-dialog"
:visible="dialogVisible" :visible="dialogVisible"
@close="handleClose" @close="handleClose"
:destroy-on-close="false" :width="configs.width || '50%'"
:close-on-click-modal="configs.clickModalToClose ?? false" :destroy-on-close="false">
:width="configs.dialogWidth ?? '50%'"> <span slot="title" class="dialog-title">
<!-- title -->
<div slot="title" class="dialog-title">
<h1 class="">
{{ detailMode ? "查看详情" : dataForm.id ? "编辑" : "新增" }} {{ detailMode ? "查看详情" : dataForm.id ? "编辑" : "新增" }}
</h1> </span>
</div>
<!-- form --> <!-- form -->
<el-form ref="dataForm" :model="dataForm" v-loading="loadingStatus"> <el-form ref="dataForm" :model="dataForm" v-loading="loadingStatus">
@ -75,7 +72,9 @@
:label="opt.label" :label="opt.label"
:value="opt.value"> :value="opt.value">
<span>{{ opt.label }}</span> <span>{{ opt.label }}</span>
<span v-if="col.customLabel" style="display: inline-clock; margin-left: 12px; font-size: 0.9em"> <span
v-if="col.customLabel"
style="display: inline-clock; margin-left: 12px; font-size: 0.9em">
{{ opt[col.customLabel] || "无描述" }} {{ opt[col.customLabel] || "无描述" }}
</span> </span>
<template v-if="col.customLabels"> <template v-if="col.customLabels">
@ -256,7 +255,7 @@ export default {
const promiseHistory = {}; const promiseHistory = {};
const getData = (col, param) => { const getData = (col, param) => {
// console.log("getData: ", col.prop, "/", param ?? "no param!"); // //console.log("getData: ", col.prop, "/", param ?? "no param!");
// - // -
promiseHistory[col.prop] = col.fetchData(param).then(({ data: res }) => { promiseHistory[col.prop] = col.fetchData(param).then(({ data: res }) => {
if (res.code === 0) { if (res.code === 0) {
@ -296,13 +295,13 @@ export default {
// //
if ("injectTo" in col) { if ("injectTo" in col) {
console.log("set watcher: ", col.prop); //console.log("set watcher: ", col.prop);
const valueProp = "optionValue" in col ? col.optionValue : "id"; const valueProp = "optionValue" in col ? col.optionValue : "id";
const unwatch = this.$watch( const unwatch = this.$watch(
() => this.dataForm[col.prop], () => this.dataForm[col.prop],
(val) => { (val) => {
console.log("do watcher: ", col.prop); //console.log("do watcher: ", col.prop);
if (col.disableWatcherOnEdit && this.editMode) return; if (col.disableWatcherOnEdit && this.editMode) return;
if (!val) { if (!val) {
col.injectTo.map((item) => { col.injectTo.map((item) => {
@ -318,7 +317,7 @@ export default {
this.$forceUpdate(); this.$forceUpdate();
}); });
} else { } else {
console.log('[x] if ("injectTo" in col) {'); //console.log('[x] if ("injectTo" in col) {');
} }
}, },
{ {
@ -357,14 +356,14 @@ export default {
// //
if ("injectTo" in col && !col.watcher) { if ("injectTo" in col && !col.watcher) {
console.log("set watcher: ", col.prop); //console.log("set watcher: ", col.prop);
const valueProp = "optionValue" in col ? col.optionValue : "id"; const valueProp = "optionValue" in col ? col.optionValue : "id";
const unwatch = this.$watch( const unwatch = this.$watch(
() => this.dataForm[col.prop], () => this.dataForm[col.prop],
(val) => { (val) => {
if (col.disableWatcherOnEdit && this.editMode) return; if (col.disableWatcherOnEdit && this.editMode) return;
console.log("do watcher: ", col.prop); //console.log("do watcher: ", col.prop);
if (!val) { if (!val) {
col.injectTo.map((item) => { col.injectTo.map((item) => {
this.$set(this.dataForm, item[0], null); this.$set(this.dataForm, item[0], null);
@ -379,7 +378,7 @@ export default {
this.$forceUpdate(); this.$forceUpdate();
}); });
} else { } else {
console.log('[x] if ("injectTo" in col) {'); //console.log('[x] if ("injectTo" in col) {');
} }
}, },
{ {
@ -400,16 +399,16 @@ export default {
} }
}); });
console.log("after getData: ", promiseHistory); //console.log("after getData: ", promiseHistory);
}; };
/** 处理函数 */ /** 处理函数 */
const handleFn = (prevProp, anchorField, anchorValue, targetField, col) => { const handleFn = (prevProp, anchorField, anchorValue, targetField, col) => {
console.log("[handleFn]: ", prevProp, anchorField, anchorValue, targetField); //console.log("[handleFn]: ", prevProp, anchorField, anchorValue, targetField);
/** 此时 cachedList 已经确保可用了 */ /** 此时 cachedList 已经确保可用了 */
const target = this.cachedList[prevProp].find((i) => i[anchorField] === anchorValue); const target = this.cachedList[prevProp].find((i) => i[anchorField] === anchorValue);
const param = target ? target[targetField] : ""; const param = target ? target[targetField] : "";
console.log("((( chosenObject )))", target); //console.log("((( chosenObject )))", target);
getData(col, param); getData(col, param);
}; };
@ -428,13 +427,13 @@ export default {
row.forEach((col) => { row.forEach((col) => {
if (col == null) return; if (col == null) return;
if (col.fetchData && typeof col.fetchData === "function" && col.hasPrev) { if (col.fetchData && typeof col.fetchData === "function" && col.hasPrev) {
console.log("[hasPrev] set watcher: ", col.hasPrev); //console.log("[hasPrev] set watcher: ", col.hasPrev);
// - // -
const unwatch = this.$watch( const unwatch = this.$watch(
() => this.dataForm[col.hasPrev], () => this.dataForm[col.hasPrev],
(val) => { (val) => {
console.log("[hasPrev] do watcher: ", col.hasPrev); //console.log("[hasPrev] do watcher: ", col.hasPrev);
if (!val) { if (!val) {
col.injectTo.map((item) => { col.injectTo.map((item) => {
this.$set(this.dataForm, item[0], null); this.$set(this.dataForm, item[0], null);
@ -468,11 +467,11 @@ export default {
if (this.configs.extraFields) if (this.configs.extraFields)
this.configs.extraFields.forEach((cnf) => { this.configs.extraFields.forEach((cnf) => {
if (cnf.listenTo) { if (cnf.listenTo) {
console.log("set watcher for: ", cnf.prop); //console.log("set watcher for: ", cnf.prop);
const unwatch = this.$watch( const unwatch = this.$watch(
() => this.dataForm[cnf.listenTo.prop], () => this.dataForm[cnf.listenTo.prop],
(carId) => { (carId) => {
console.log("do watcher for: ", cnf.prop); //console.log("do watcher for: ", cnf.prop);
if (!carId) return; if (!carId) return;
if (cnf.disableWatcherOnEdit && this.editMode) return; if (cnf.disableWatcherOnEdit && this.editMode) return;
cnf.listenTo.handler.call(this, this.cachedList[cnf.listenTo.prop], carId); cnf.listenTo.handler.call(this, this.cachedList[cnf.listenTo.prop], carId);
@ -528,14 +527,14 @@ export default {
resetSpecificFields(fields) { resetSpecificFields(fields) {
Object.keys(this.dataForm).forEach((key) => { Object.keys(this.dataForm).forEach((key) => {
// console.log(`${key} ${fields}`, key in fields, fields.indexOf(key)) // //console.log(`${key} ${fields}`, key in fields, fields.indexOf(key))
if (fields.indexOf(key) !== -1) { if (fields.indexOf(key) !== -1) {
// console.log(`key ${key} in fields`) // //console.log(`key ${key} in fields`)
// this.dataForm[key] = null; // this.dataForm[key] = null;
this.$set(this.dataForm, key, null); this.$set(this.dataForm, key, null);
} }
}); });
console.log("this.dataform", this.dataForm); //console.log("this.dataform", this.dataForm);
}, },
resetForm(excludeId = false, immediate = false) { resetForm(excludeId = false, immediate = false) {
@ -557,9 +556,9 @@ export default {
/** init **/ /** init **/
init(id, detailMode, tagInfo, extraParams) { init(id, detailMode, tagInfo, extraParams) {
// console.log("[DialogJustForm] init", this.dataForm, id, detailMode); // //console.log("[DialogJustForm] init", this.dataForm, id, detailMode);
if (this.$refs.dataForm) { if (this.$refs.dataForm) {
// console.log("[DialogJustForm] clearing form validation..."); // //console.log("[DialogJustForm] clearing form validation...");
// dialog dataForm [0] // dialog dataForm [0]
this.$refs.dataForm.clearValidate(); this.$refs.dataForm.clearValidate();
} }
@ -570,7 +569,7 @@ export default {
/** 判断 extraParams */ /** 判断 extraParams */
if (extraParams && typeof extraParams === "object") { if (extraParams && typeof extraParams === "object") {
for (const [key, value] of Object.entries(extraParams)) { for (const [key, value] of Object.entries(extraParams)) {
// console.log("[dialog] dataForm | key | value", this.dataForm, key, value); // //console.log("[dialog] dataForm | key | value", this.dataForm, key, value);
this.$set(this.dataForm, key, value); this.$set(this.dataForm, key, value);
} }
} }
@ -603,7 +602,7 @@ export default {
url: file.fileUrl, url: file.fileUrl,
})); }));
} }
// console.log("[DialogJustForm] init():", this.dataForm); // //console.log("[DialogJustForm] init():", this.dataForm);
} else { } else {
this.$message({ this.$message({
message: `${res.code}: ${res.msg}`, message: `${res.code}: ${res.msg}`,
@ -629,7 +628,7 @@ export default {
handleButtonClick(col) { handleButtonClick(col) {
if (!("onClick" in col)) { if (!("onClick" in col)) {
console.log("[handleButtonClick] 配置文件config.js 里没有绑定 onClick"); //console.log("[handleButtonClick] config.js onClick");
return; return;
} }
@ -640,7 +639,7 @@ export default {
handleSelectChange(col, eventValue) { handleSelectChange(col, eventValue) {
if ("autoUpdateProp" in col) { if ("autoUpdateProp" in col) {
// //
// console.log(col.options, eventValue, this.savedDatalist); // //console.log(col.options, eventValue, this.savedDatalist);
const item = this.savedDatalist[col.prop].find((item) => item.id === eventValue); const item = this.savedDatalist[col.prop].find((item) => item.id === eventValue);
this.shadowDataForm[col.autoUpdateProp] = item.cate ?? null; this.shadowDataForm[col.autoUpdateProp] = item.cate ?? null;
} }
@ -648,17 +647,17 @@ export default {
}, },
handleSwitchChange(val) { handleSwitchChange(val) {
console.log("[dialog] switch change: ", val, this.dataForm); //console.log("[dialog] switch change: ", val, this.dataForm);
}, },
handleComponentModelUpdate(propName, { subject, payload: { data } }) { handleComponentModelUpdate(propName, { subject, payload: { data } }) {
this.dataForm[propName] = JSON.stringify(data); this.dataForm[propName] = JSON.stringify(data);
console.log("[DialogJustForm] handleComponentModelUpdate", this.dataForm[propName]); //console.log("[DialogJustForm] handleComponentModelUpdate", this.dataForm[propName]);
}, },
addOrUpdate(method = "POST", url) { addOrUpdate(method = "POST", url) {
if ("parentId" in this.dataForm) { if ("parentId" in this.dataForm) {
console.log("[DialogJustForm parentId]", this.dataForm.parentId); //console.log("[DialogJustForm parentId]", this.dataForm.parentId);
// parentId cascader ["xxx"]xxx // parentId cascader ["xxx"]xxx
const lastItem = this.dataForm.parentId.length - 1; const lastItem = this.dataForm.parentId.length - 1;
this.dataForm.parentId = this.dataForm.parentId[lastItem]; this.dataForm.parentId = this.dataForm.parentId[lastItem];
@ -710,7 +709,7 @@ export default {
data: httpPayload, data: httpPayload,
}) })
.then(({ data: res }) => { .then(({ data: res }) => {
console.log("[add&update] res is: ", res); //console.log("[add&update] res is: ", res);
this.loadingStatus = false; this.loadingStatus = false;
if (res.code === 0) { if (res.code === 0) {
this.$message.success(method === "POST" ? "添加成功" : "更新成功"); this.$message.success(method === "POST" ? "添加成功" : "更新成功");
@ -736,7 +735,7 @@ export default {
}, },
handleBtnClick(payload) { handleBtnClick(payload) {
console.log("btn click payload: ", payload); //console.log("btn click payload: ", payload);
if ("name" in payload) { if ("name" in payload) {
switch (payload.name) { switch (payload.name) {
@ -748,7 +747,7 @@ export default {
break; break;
case "resetSpecific": case "resetSpecific":
// qualityInspectionRecord config // qualityInspectionRecord config
console.log("resetFields", this.resetFields); //console.log("resetFields", this.resetFields);
this.resetSpecificFields(this.resetFields); this.resetSpecificFields(this.resetFields);
break; break;
case "add": case "add":
@ -763,18 +762,18 @@ export default {
break; break;
} }
case "add-car-payload": { case "add-car-payload": {
console.log("edit-car-payload", payload); //console.log("edit-car-payload", payload);
this.addOrUpdate("POST", this.urls.payloadFormUrl); this.addOrUpdate("POST", this.urls.payloadFormUrl);
break; break;
} }
} }
} else { } else {
console.log("[x] 不是这么用的! 缺少name属性"); //console.log("[x] ! name");
} }
}, },
handleUploadChange(file, fileList) { handleUploadChange(file, fileList) {
console.log("[Upload] handleUploadChange...", file, fileList); //console.log("[Upload] handleUploadChange...", file, fileList);
}, },
handleClose() { handleClose() {
@ -787,20 +786,19 @@ export default {
<style scoped> <style scoped>
.dialog-just-form >>> .el-dialog__body { .dialog-just-form >>> .el-dialog__body {
/* padding-top: 16px !important;
padding-bottom: 16px !important; */
padding-top: 0 !important; padding-top: 0 !important;
padding-bottom: 0 !important; padding-bottom: 0 !important;
} }
.dialog-just-form >>> .el-form {
padding: 16px;
max-height: 56vh;
overflow-y: auto;
}
.el-select, .el-select,
.el-cascader, .el-cascader,
.el-date-editor { .el-date-editor {
width: 100% !important; width: 100% !important;
} }
.dialog-just-form >>> .el-dialog__header {
padding: 10px 20px 10px;
/* background: linear-gradient(to bottom, rgba(0, 0, 0, 0.25), white); */
}
</style> </style>

View File

@ -4,6 +4,7 @@
element-loading-text="处理中,请耐心等待..." element-loading-text="处理中,请耐心等待..."
element-loading-background="rgba(0,0,0,0.1)" element-loading-background="rgba(0,0,0,0.1)"
class="dialog-just-form" class="dialog-just-form"
custom-class="pms-dialog"
:visible="visible" :visible="visible"
@close="handleClose" @close="handleClose"
width="30%" width="30%"
@ -136,7 +137,7 @@ export default {
}, },
handleSuccess(response, file, fileList) { handleSuccess(response, file, fileList) {
console.log("success response", response); //console.log("success response", response);
this.loadingStatus = false this.loadingStatus = false
try { try {
if ("code" in response && response.code === 500) { if ("code" in response && response.code === 500) {
@ -177,7 +178,7 @@ export default {
handleError(err, file, fileList) { handleError(err, file, fileList) {
this.loadingStatus = false this.loadingStatus = false
console.log("err", err); //console.log("err", err);
}, },
handleBtnClick(payload) { handleBtnClick(payload) {
@ -210,7 +211,7 @@ export default {
}, },
handleUploadChange(file, fileList) { handleUploadChange(file, fileList) {
// console.log("[Upload] handleUploadChange...", file, fileList); // //console.log("[Upload] handleUploadChange...", file, fileList);
}, },
handleClose() { handleClose() {
@ -229,7 +230,7 @@ export default {
/* padding-top: 16px !important; /* padding-top: 16px !important;
padding-bottom: 16px !important; */ padding-bottom: 16px !important; */
padding-top: 0 !important; padding-top: 0 !important;
padding-bottom: 0 !important; padding-bottom: 12px !important;
} }
.el-select, .el-select,
@ -238,11 +239,6 @@ export default {
width: 100% !important; width: 100% !important;
} }
.dialog-just-form >>> .el-dialog__header {
padding: 10px 20px 10px;
/* background: linear-gradient(to bottom, rgba(0, 0, 0, 0.25), white); */
}
.h0 { .h0 {
height: 0; height: 0;
width: 0; width: 0;

View File

@ -12,12 +12,9 @@
:destroy-on-close="false" :destroy-on-close="false"
@close="handleClose" @close="handleClose"
:close-on-click-modal="configs.clickModalToClose ?? false"> :close-on-click-modal="configs.clickModalToClose ?? false">
<!-- title --> <h1 slot="title" class="dialog-title">
<div slot="title" class="dialog-title">
<h1 class="">
{{ detailMode ? "查看详情" : dataForm.id ? "编辑" : "新增" }} {{ detailMode ? "查看详情" : dataForm.id ? "编辑" : "新增" }}
</h1> </h1>
</div>
<div class="dialog-body__inner relative"> <div class="dialog-body__inner relative">
<!-- v-if="dataForm.id && !detailMode && /属性|详情/.test(activeMenu) && $hasPermission()" --> <!-- v-if="dataForm.id && !detailMode && /属性|详情/.test(activeMenu) && $hasPermission()" -->
@ -100,7 +97,9 @@
:label="opt.label" :label="opt.label"
:value="opt.value"> :value="opt.value">
<span>{{ opt.label }}</span> <span>{{ opt.label }}</span>
<span v-if="col.customLabel" style="display: inline-clock; margin-left: 12px; font-size: 0.9em"> <span
v-if="col.customLabel"
style="display: inline-clock; margin-left: 12px; font-size: 0.9em">
{{ opt[col.customLabel] || "无描述" }} {{ opt[col.customLabel] || "无描述" }}
</span> </span>
</el-option> </el-option>
@ -169,7 +168,9 @@
<!-- 附件标签页 --> <!-- 附件标签页 -->
<div v-if="dataForm.id && tab.key === 'attachment'" key="attachment"> <div v-if="dataForm.id && tab.key === 'attachment'" key="attachment">
<div class="upload-tips" style="font-size: 0.8em; margin-bottom: 12px">文件大小不要超过 2MB</div> <div class="upload-tips" style="font-size: 0.8em; margin-bottom: 12px">
文件大小不要超过 2MB
</div>
<!-- 附件列表 --> <!-- 附件列表 -->
<div class="" v-loading="loadingStatus"> <div class="" v-loading="loadingStatus">
<ul class="file-list"> <ul class="file-list">
@ -212,6 +213,7 @@
:url="urls.subase" :url="urls.subase"
:configs="configs.subDialog" :configs="configs.subDialog"
:related-id="dataForm.id" :related-id="dataForm.id"
:code="extraCode"
@refreshDataList="getSubList"></small-dialog> @refreshDataList="getSubList"></small-dialog>
<!-- footer --> <!-- footer -->
@ -293,11 +295,12 @@ export default {
if (col.fetchData) if (col.fetchData)
col.fetchData().then(({ data: res }) => { col.fetchData().then(({ data: res }) => {
console.log("[Fetch Data]", "list" in res.data, res.data, res.data.list); //console.log("[Fetch Data]", "list" in res.data, res.data, res.data.list);
if (res.code === 0) { if (res.code === 0) {
if (col.cacheFetchedData) { if (col.cacheFetchedData) {
// cache fetched data // cache fetched data
cached[col.prop] = "list" in res.data ? res.data.list : Array.isArray(res.data) ? res.data : []; cached[col.prop] =
"list" in res.data ? res.data.list : Array.isArray(res.data) ? res.data : [];
} }
if (!col.options || !col.options.length) { if (!col.options || !col.options.length) {
@ -329,7 +332,9 @@ export default {
} }
// col.options = res.data.list; // col.options = res.data.list;
else if (col.options.length) { else if (col.options.length) {
"list" in res.data ? res.data.list.unshift(...col.options) : res.data.unshift(...col.options); "list" in res.data
? res.data.list.unshift(...col.options)
: res.data.unshift(...col.options);
this.$set( this.$set(
col, col,
"options", "options",
@ -352,7 +357,7 @@ export default {
else if (col.fetchTreeData) { else if (col.fetchTreeData) {
// parentId 0 // parentId 0
col.fetchTreeData().then(({ data: res }) => { col.fetchTreeData().then(({ data: res }) => {
console.log("[Fetch Tree Data]", res.data); //console.log("[Fetch Tree Data]", res.data);
if (res.code === 0) { if (res.code === 0) {
// //
const obj = {}; const obj = {};
@ -368,7 +373,7 @@ export default {
} }
// //
let filteredList = reConstructTreeData(obj); let filteredList = reConstructTreeData(obj);
console.log("** filteredList **", filteredList); //console.log("** filteredList **", filteredList);
// options // options
this.$set(col, "options", filteredList); this.$set(col, "options", filteredList);
} else { } else {
@ -381,6 +386,7 @@ export default {
}); });
return { return {
extraCode: null,
// configs, // configs,
btnLoading: false, btnLoading: false,
loadingStatus: false, loadingStatus: false,
@ -438,11 +444,16 @@ export default {
() => this.dataForm[col.prop], () => this.dataForm[col.prop],
(val) => { (val) => {
if (val && col.prop in this.cached) { if (val && col.prop in this.cached) {
console.log("here changeReflects", col.prop, col.changeReflects.toProp, this.cached[col.prop]); //console.log(
// "here changeReflects",
// col.prop,
// col.changeReflects.toProp,
// this.cached[col.prop]
// );
if (typeof col.changeReflects.fromKey === "string") { if (typeof col.changeReflects.fromKey === "string") {
this.dataForm[col.changeReflects.toProp] = this.cached[col.prop].find((item) => item.id === val)?.[ this.dataForm[col.changeReflects.toProp] = this.cached[col.prop].find(
col.changeReflects.fromKey (item) => item.id === val
]; )?.[col.changeReflects.fromKey];
} else if (Array.isArray(col.changeReflects.fromKey) && col.changeReflects.delimiter) { } else if (Array.isArray(col.changeReflects.fromKey) && col.changeReflects.delimiter) {
const foundItem = (this.dataForm[col.changeReflects.toProp] = this.cached[col.prop].find( const foundItem = (this.dataForm[col.changeReflects.toProp] = this.cached[col.prop].find(
(item) => item.id === val (item) => item.id === val
@ -452,7 +463,7 @@ export default {
this.dataForm[col.changeReflects.toProp] = values.join(col.changeReflects.delimiter); this.dataForm[col.changeReflects.toProp] = values.join(col.changeReflects.delimiter);
} else { } else {
this.dataForm[col.changeReflects.toProp] = col.changeReflects.delimiter; this.dataForm[col.changeReflects.toProp] = col.changeReflects.delimiter;
console.log("[DialogWithMenu] mounted() 没找到对应数据"); //console.log("[DialogWithMenu] mounted() ");
} }
} }
} }
@ -510,14 +521,16 @@ export default {
const addMode = !operate.showOnEdit && !this.dataForm.id; const addMode = !operate.showOnEdit && !this.dataForm.id;
const permission = operate.permission ? this.$hasPermission(operate.permission) : true; const permission = operate.permission ? this.$hasPermission(operate.permission) : true;
const currentMenuKey = this.configs.menu.find((item) => item.name === this.activeMenu)?.key; const currentMenuKey = this.configs.menu.find((item) => item.name === this.activeMenu)?.key;
return notDetailMode && (showAlways || ((editMode || addMode) && permission)) && currentMenuKey === "info"; return (
notDetailMode && (showAlways || ((editMode || addMode) && permission)) && currentMenuKey === "info"
);
}, },
resetForm(excludeId = false, immediate = false) { resetForm(excludeId = false, immediate = false) {
setTimeout( setTimeout(
() => { () => {
Object.keys(this.dataForm).forEach((key) => { Object.keys(this.dataForm).forEach((key) => {
console.log("reset form, key", key); //console.log("reset form, key", key);
if (excludeId && key === "id") return; if (excludeId && key === "id") return;
if ("files" in this.dataForm) this.dataForm.files = []; if ("files" in this.dataForm) this.dataForm.files = [];
else if ("fileIds" in this.dataForm) this.dataForm.fileIds = []; else if ("fileIds" in this.dataForm) this.dataForm.fileIds = [];
@ -528,7 +541,7 @@ export default {
}); });
this.activeMenu = this.configs.menu[0].name; this.activeMenu = this.configs.menu[0].name;
this.$refs.dataForm[0].resetFields(); this.$refs.dataForm[0].resetFields();
console.log("清除Form...", this.dataForm); //console.log("Form...", this.dataForm);
}, },
immediate ? 0 : 200 immediate ? 0 : 200
); );
@ -538,7 +551,7 @@ export default {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (this.watingToRefreshQueue.length) { if (this.watingToRefreshQueue.length) {
this.watingToRefreshQueue.forEach((opt) => { this.watingToRefreshQueue.forEach((opt) => {
console.log("[刷新数据, ", opt, "]"); //console.log("[, ", opt, "]");
if ("fetchData" in opt) { if ("fetchData" in opt) {
opt.fetchData(this.dataForm.id ? this.dataForm.id : -1).then(({ data: res }) => { opt.fetchData(this.dataForm.id ? this.dataForm.id : -1).then(({ data: res }) => {
if (res.code === 0) { if (res.code === 0) {
@ -574,7 +587,7 @@ export default {
// dialog dataForm [0] // dialog dataForm [0]
this.$refs.dataForm[0].clearValidate(); this.$refs.dataForm[0].clearValidate();
} }
console.log("[dialog] DialogWithHead init():", id, detailMode); //console.log("[dialog] DialogWithHead init():", id, detailMode);
this.detailMode = detailMode ?? false; this.detailMode = detailMode ?? false;
this.$nextTick(() => { this.$nextTick(() => {
@ -590,11 +603,11 @@ export default {
this.$http.get(this.urls.base + `/${this.dataForm.id}`).then(({ data: res }) => { this.$http.get(this.urls.base + `/${this.dataForm.id}`).then(({ data: res }) => {
if (res && res.code === 0) { if (res && res.code === 0) {
const dataFormKeys = Object.keys(this.dataForm); const dataFormKeys = Object.keys(this.dataForm);
console.log("[DialogWithMenu] dataFormKeys -------->", dataFormKeys); //console.log("[DialogWithMenu] dataFormKeys -------->", dataFormKeys);
this.dataForm = __pick(res.data, dataFormKeys); this.dataForm = __pick(res.data, dataFormKeys);
if ("files" in res.data) { if ("files" in res.data) {
console.log("[DialogWithMenu] fileList===>", res.data.files, this.fileList); //console.log("[DialogWithMenu] fileList===>", res.data.files, this.fileList);
/** 返回的文件列表 */ /** 返回的文件列表 */
this.fileList = res.data.files this.fileList = res.data.files
? res.data.files.map((file) => ({ ? res.data.files.map((file) => ({
@ -635,7 +648,7 @@ export default {
responseType: "blob", responseType: "blob",
}) })
.then(({ data: res }) => { .then(({ data: res }) => {
console.log("preivew", res); //console.log("preivew", res);
if (/image/i.test(res.type)) { if (/image/i.test(res.type)) {
// //
this.currentImgUrl = URL.createObjectURL(res); this.currentImgUrl = URL.createObjectURL(res);
@ -646,9 +659,9 @@ export default {
a.setAttribute("target", "_blank"); a.setAttribute("target", "_blank");
a.href = URL.createObjectURL(res); a.href = URL.createObjectURL(res);
a.click(); a.click();
console.log("before remove a ", a); //console.log("before remove a ", a);
a.remove(); a.remove();
console.log("removed a ", a); //console.log("removed a ", a);
} else { } else {
this.$message({ this.$message({
message: "非图片和PDF文件请下载后预览", message: "非图片和PDF文件请下载后预览",
@ -728,7 +741,7 @@ export default {
}, },
handleUploadSuccess(response, file, fileList) { handleUploadSuccess(response, file, fileList) {
console.log("[DialogWithMenu] uploadedFileList", response, file, fileList); //console.log("[DialogWithMenu] uploadedFileList", response, file, fileList);
if (response.code === 0) { if (response.code === 0) {
const uploadedFile = response.data[0]; const uploadedFile = response.data[0];
@ -768,7 +781,7 @@ export default {
}, },
handleUploadCheck(file) { handleUploadCheck(file) {
console.log("[before upload]", file); //console.log("[before upload]", file);
const LIMIT = 2 * 1024 * 1024; // bytes const LIMIT = 2 * 1024 * 1024; // bytes
if (file.size > LIMIT) { if (file.size > LIMIT) {
this.$message({ this.$message({
@ -782,16 +795,16 @@ export default {
handleComponentModelUpdate(propName, { subject, payload: { data } }) { handleComponentModelUpdate(propName, { subject, payload: { data } }) {
this.dataForm[propName] = JSON.stringify(data); this.dataForm[propName] = JSON.stringify(data);
console.log("[DialogJustForm] handleComponentModelUpdate", this.dataForm[propName]); //console.log("[DialogJustForm] handleComponentModelUpdate", this.dataForm[propName]);
}, },
handleSelectChange(col, eventValue) { handleSelectChange(col, eventValue) {
console.log("[dialog] select change: ", col, eventValue); //console.log("[dialog] select change: ", col, eventValue);
}, },
handleSwitchChange(val) { handleSwitchChange(val) {
console.log("[dialog] switch change: ", val, this.dataForm); //console.log("[dialog] switch change: ", val, this.dataForm);
}, },
handleBtnClick(payload) { handleBtnClick(payload) {
console.log("btn click payload: ", payload); //console.log("btn click payload: ", payload);
if ("name" in payload) { if ("name" in payload) {
switch (payload.name) { switch (payload.name) {
@ -832,7 +845,7 @@ export default {
// this.configs.excludeProps.forEach((prop) => { // this.configs.excludeProps.forEach((prop) => {
// delete actualPayload[prop]; // delete actualPayload[prop];
// }); // });
// console.log('actualPayload', actualPayload); // //console.log('actualPayload', actualPayload);
// } // }
// //
@ -848,7 +861,7 @@ export default {
.then(({ data: res }) => { .then(({ data: res }) => {
this.btnLoading = false; this.btnLoading = false;
this.loadingStatus = false; this.loadingStatus = false;
console.log("[add&update] res is: ", res); //console.log("[add&update] res is: ", res);
if (res.code === 0) { if (res.code === 0) {
this.$message.success(payload.name === "add" ? "添加成功" : "更新成功"); this.$message.success(payload.name === "add" ? "添加成功" : "更新成功");
this.$emit("refreshDataList"); this.$emit("refreshDataList");
@ -857,7 +870,7 @@ export default {
// if (this.watingToRefreshQueue.length) { // if (this.watingToRefreshQueue.length) {
// // // //
// this.watingToRefreshQueue.forEach((opt) => { // this.watingToRefreshQueue.forEach((opt) => {
// console.log("[, ", opt, "]"); // //console.log("[, ", opt, "]");
// if ("fetchData" in opt) { // if ("fetchData" in opt) {
// opt.fetchData().then(({ data: res }) => { // opt.fetchData().then(({ data: res }) => {
// if (res.code === 0) { // if (res.code === 0) {
@ -898,7 +911,7 @@ export default {
} }
}, },
handleTabClick(payload) { handleTabClick(payload) {
// console.log("tab click payload: ", this.activeMenu); // //console.log("tab click payload: ", this.activeMenu);
// if (this.activeMenu === this.configs.menu[1].name) { // if (this.activeMenu === this.configs.menu[1].name) {
// // // //
// this.getSubList(); // this.getSubList();
@ -936,7 +949,7 @@ export default {
} }
} }
this.$http.get(this.urls.subpage, { params }).then(({ data: res }) => { this.$http.get(this.urls.subpage, { params }).then(({ data: res }) => {
console.log("[DialogWithMenu] getSubList:", res); //console.log("[DialogWithMenu] getSubList:", res);
if (res.code === 0 && res.data?.list) { if (res.code === 0 && res.data?.list) {
// //
this.subList = res.data.list; this.subList = res.data.list;
@ -962,20 +975,21 @@ export default {
/** 列表handlers */ /** 列表handlers */
handleAddItem() { handleAddItem() {
// console.log('[dialog] handleAddItem ot list...'); // //console.log('[dialog] handleAddItem ot list...');
this.showBaseDialog = true; this.showBaseDialog = true;
this.$nextTick(() => { this.$nextTick(() => {
console.log("[sub-dialog] ", this.$refs["sub-dialog"].init()); //console.log("[sub-dialog] ", this.$refs["sub-dialog"].init());
}); });
}, },
handleTableRowOperate({ type, data }) { handleTableRowOperate({ type, data }) {
console.log("handleTableRowOperate", type, data); //console.log("handleTableRowOperate", type, data);
switch (type) { switch (type) {
case "delete": { case "delete": {
// //
console.log("delete....", data); //console.log("delete....", data);
const itemName = typeof data === "object" ? data.attrName || data.name || data.material || data.id : data; const itemName =
typeof data === "object" ? data.attrName || data.name || data.material || data.id : data;
return this.$confirm(`是否删除条目: ${itemName}`, "提示", { return this.$confirm(`是否删除条目: ${itemName}`, "提示", {
confirmButtonText: "确认", confirmButtonText: "确认",
cancelButtonText: "我再想想", cancelButtonText: "我再想想",
@ -1002,6 +1016,7 @@ export default {
.catch((err) => {}); .catch((err) => {});
} }
case "edit": { case "edit": {
this.extraCode = this.subList?.find((item) => item.id == data)?.code;
this.handleAddParam(data); /** data is ==> id */ this.handleAddParam(data); /** data is ==> id */
break; break;
} }
@ -1024,10 +1039,6 @@ export default {
/* background: #0f02 !important; */ /* background: #0f02 !important; */
} }
/* .el-menu--horizontal > .el-menu-item.is-active { */
/* border-bottom-color: #0b58ff; */
/* } */
.dialog-with-menu >>> .el-dialog__body { .dialog-with-menu >>> .el-dialog__body {
/* padding-top: 16px !important; /* padding-top: 16px !important;
padding-bottom: 16px !important; */ padding-bottom: 16px !important; */
@ -1035,16 +1046,15 @@ export default {
padding-bottom: 0 !important; padding-bottom: 0 !important;
} }
/* .dialog-with-menu >>> .dialog-body__inner {
padding: 16px;
} */
.el-select, .el-select,
.el-cascader { .el-cascader {
width: 100% !important; width: 100% !important;
} }
.dialog-with-menu >>> .el-dialog__header {
padding: 10px 20px 10px;
/* background: linear-gradient(to bottom, rgba(0, 0, 0, 0.25), white); */
}
.relative { .relative {
position: relative; position: relative;
} }

345
src/components/PrintDom.vue Normal file
View File

@ -0,0 +1,345 @@
<!--
filename: PrintDom.vue
author: liubin
date: 2023-08-11 13:59:22
description:
-->
<template>
<div
class="print-area"
style="
box-sizing: border-box;
margin: 4px;
border: 1px solid #000;
padding: 8px;
display: inline-block;
width: calc(6cm - 8px);
height: 14.5cm;
font-family: Arial, Helvetica, sans-serif;
">
<!-- 6cm - margin -->
<h4
class="datetime"
style="
font-size: 10px;
margin: 0 0 10px 0;
font-weight: 400;
display: flex;
align-items: center;
justify-content: space-between;
">
<span>{{ datetime.toLocaleDateString() }}</span>
<span>{{ datetime.toLocaleTimeString() }}</span>
</h4>
<!-- 物料号 -->
<h2 class="material-code" style="font-size: 20px; margin: 10px 0">{{ dataForm.pdtCode }}</h2>
<!-- 牌号 -->
<h2 class="brand" style="font-size: 16px; letter-spacing: 1px; margin: 10px 0">{{ dataForm.brand }}</h2>
<!-- 配方号 -->
<h3 class="bom-code" style="font-size: 14px; margin: 10px 0">{{ dataForm.bomCode }}</h3>
<!-- 砖型 -->
<h2 class="shape" style="font-size: 20px; letter-spacing: 1px; margin: 10px 0">
{{ dataForm.shapeCode }}
</h2>
<!-- 生产订单 -->
<h3 class="order-id" style="font-size: 14px; margin: 10px 0">{{ dataForm.orderCode }}</h3>
<!-- 客户 -->
<h3 class="client" style="font-size: 14px; text-transform: uppercase; margin: 10px 0">
{{ dataForm.customer }}
</h3>
<h2
class="sale-order-id sale-item-id"
style="
display: flex;
align-items: center;
font-size: 20px;
justify-content: space-between;
margin: 10px 0;
">
<!-- 托盘号 -->
<span>{{ dataForm.code }}</span>
<!-- 销售订单号 -->
<span>{{ dataForm.saleNo }}</span>
</h2>
<!-- 销售订单发货时间 -->
<h2 class="delivery-time" style="font-size: 18px; margin: 10px 0">
{{ new Date(dataForm.deliveryTime).toLocaleDateString() }}
<!-- {{
new Date(dataForm.deliveryTime).toLocaleDateString() +
" " +
new Date(dataForm.deliveryTime).toLocaleTimeString()
}} -->
</h2>
<!-- 托盘类型 满托 尾托 余托 -->
<h2
class="pan-no"
style="
padding: 4px;
border: 1px solid #000;
font-size: 18px;
margin: 10px 0;
font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', '微软雅黑',
'Microsoft YaHei UI', 'Microsoft YaHei', 'Source Han Sans SC', 'Noto Sans CJK SC',
'WenQuanYi Micro Hei', sans-serif;
/* background: #000; */
/* color: #fff; */
">
{{ palletType }}
<!-- {{ dataForm.code }} -->
</h2>
<div
class="bottom-area"
style="margin-bottom: 8px; display: flex; align-items: flex-start; justify-content: space-between">
<!-- 二维码 -->
<div
class="qrcode"
style="flex-shrink: 0; width: 128px; height: 128px; /* border: 1px solid #0003; */">
<img id="qrcode" style="width: 100%; height: 100%" />
</div>
<div class="" style="text-align: right">
<!-- 订单生产总砖数 -->
<h2 class="shape-count" style="font-size: 20px; margin: 0 0 10px 8px">{{ dataForm.prodqty }}</h2>
<!-- 实际码放在托盘上的砖数 -->
<h2 class="shape-placed" style="font-size: 20px; margin: 0 0 10px 8px">{{ dataForm.realQty }}</h2>
<!-- 需要码放 24 托木托盘每托120块砖 -->
<h2 class="shape-24" style="font-size: 20px; margin: 0 0 10px 8px">{{ dataForm.fpText }}</h2>
<!-- 需要码放 1 托木托盘每托10块砖 -->
<h2 class="shape-1" style="font-size: 20px; margin: 0 0 10px 8px">{{ dataForm.tpText }}</h2>
</div>
</div>
<!-- <h2 class="pack-code" style="font-size: 20px; margin: 0 0 10px">S653</h2> -->
<svg id="barcode"></svg>
</div>
</template>
<script>
import JsBarcode from "jsbarcode";
import QRCode from "qrcode";
import { getLodop } from "@/utils/Lodop";
export default {
name: "PrintDom",
components: {},
props: {},
data() {
return {
lodop: null,
datetime: new Date(),
dataForm: {
pdtCode: null,
brand: null,
bomCode: null,
shapeCode: null,
orderCode: null,
customer: null,
code: null,
saleNo: null,
deliveryTime: null,
typeDictValue: null,
prodqty: null,
realQty: null,
fpText: null,
tpText: null,
packTechCode: null,
hu: null,
},
jobId: null,
palletId: null,
};
},
computed: {
// comp120() {
// if (this.dataForm.realQty == null) return 0;
// return Math.floor(this.dataForm.realQty / 120);
// },
// comp10() {
// if (this.dataForm.realQty == null) return 0;
// return Math.ceil((this.dataForm.realQty % 120) / 10);
// },
palletType() {
switch (this.dataForm.typeDictValue?.toString()) {
case "0":
return "满 托";
case "1":
return "尾 托";
case "2":
return "余 托";
default:
return "-";
}
},
},
methods: {
/**
*
* @param {string|object} data 当source为api时data为id当source为local时data为对象
* @param {'api'|'local'} source 数据来源
*/
async print(data, source = "api") {
//
if (!this.initPrintPlugin()) return this.close();
if (source === "api") {
this.palletId = data;
await this.printByApi(data);
} else {
await this.printByLocalData(data);
}
this.close();
},
async printByApi(id) {
const { data: res } = await this.$http.get("/pms/pallet/" + id);
this.dataForm = res.data;
await this.printByLocalData(res.data);
// this.getPrintStatus(id);
},
async printByLocalData(data) {
//
this.paintBarCode(data.packTechCode || "0000-0000-0000");
// HU
await this.paintQrCode(data.hu || "- 无HU数据 -");
this.handlePrint();
},
initPrintPlugin() {
this.lodop = getLodop();
if (!this.lodop) {
return this.$confirm("请先安装打印控件", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
window.open("http://www.c-lodop.com/download.html");
})
.catch(() => {
return false;
});
}
return true;
},
paintBarCode(data) {
JsBarcode("#barcode", data, {
format: "CODE128",
width: 2.5,
height: 48,
displayValue: true,
margin: 0,
});
},
async paintQrCode(data) {
try {
const url = await QRCode.toDataURL(data, {
width: 128,
height: 128,
});
document.querySelector("#qrcode").src = url;
} catch (err) {
document.querySelector(".qrcode").innerHTML = "NO QRCode";
}
},
// handlePrint() {
// return new Promise((resolve, reject) => {
// this.lodop.PRINT_INIT("RGV");
// //
// this.lodop.SET_PRINT_MODE("CATCH_PRINT_STATUS", true);
// if (this.lodop.CVERSION) {
// // jobId
// this.lodop.On_Return = (TaskID, Value) => {
// this.jobId = Value;
// resolve();
// };
// }
// // 60mm150mm
// this.lodop.SET_PRINT_PAGESIZE(1, 600, 1500, "ZebraT231 Tag Paper");
// this.lodop.ADD_PRINT_HTM(0, 0, "100%", "100%", document.querySelector(".print-area").outerHTML);
// this.lodop.PRINT();
// });
// },
// getPrintStatus(id) {
// return new Promise((resolve, reject) => {
// if (!this.jobId || !this.lodop) reject(-1);
// this.lodop.SET_PRINT_MODE("CATCH_PRINT_STATUS", true);
// if (this.lodop.CVERSION) {
// this.lodop.On_Return = (TaskID, Value) => {
// //console.log("this.lodop.On_Return", this.lodop.On_Return, this.jobId, Value);
// if (Value.toString() == "1") {
// //
// this.sendSuccess()
// .then(() => {
// this.$message.success(` ${id} `);
// this.$emit("refresh-list");
// resolve();
// })
// .catch((err) => {
// this.$message.error(err);
// reject(err);
// });
// } else {
// this.$message.error(` ${id} `);
// }
// };
// this.lodop.GET_VALUE("PRINT_STATUS_OK", this.jobId);
// }
// });
// },
handlePrint() {
this.lodop.PRINT_INIT("RGV小票打印");
// 60mm150mm
this.lodop.SET_PRINT_PAGESIZE(1, 600, 1500, "ZebraT231 Tag Paper");
this.lodop.ADD_PRINT_HTM(0, 0, "100%", "100%", document.querySelector(".print-area").outerHTML);
this.lodop.PRINT();
},
// getPrintStatus(id) {
// //
// this.sendSuccess()
// .then(() => {
// this.$message.success(` ${id} `);
// this.$emit("refresh-list");
// })
// .catch((err) => {
// this.$message.error("code" in err && "msg" in err ? `${err.code}: ${err.msg}` : err);
// });
// },
// sendSuccess() {
// return this.$http({
// url: "/pms/pallet/print",
// method: "post",
// data: this.palletId,
// headers: {
// "Content-Type": "application/json",
// },
// }).then(({ data: res }) => {
// if (res.code == 0) return;
// else throw new Error(res.msg);
// });
// },
close() {
this.$emit("destroy");
},
},
};
</script>
<style scoped lang="scss">
.print-area {
position: fixed;
top: 0;
left: 0;
opacity: 0;
visibility: hidden;
}
</style>

View File

@ -0,0 +1,347 @@
<!--
filename: ReportDialog.vue
author: liubin
date: 2023-08-17 14:46:32
description: 报工弹窗
-->
<template>
<el-dialog
:visible.sync="visible"
width="700px"
v-bind="$attrs"
@close="close"
@closed="$emit('destroy')"
custom-class="pms-dialog">
<!-- :class="{ 'pms-dialog--rotate-down': startLeave }"> -->
<span slot="title" class="dialog-title">报工预览</span>
<!-- 面包屑导航 -->
<div style="padding: 12px; background: #f7f7f7">
<el-breadcrumb separator="/">
<el-breadcrumb-item>预报工单</el-breadcrumb-item>
<el-breadcrumb-item v-if="mode.includes('form')">编辑</el-breadcrumb-item>
</el-breadcrumb>
</div>
<transition class="l" mode="out-in">
<BaseListTable
v-if="mode.includes('table')"
v-loading="loading"
:column-config="tableProps"
:table-data="dataList"
@operate-event="handleOperate"
:current-page="page"
:current-size="size" />
<el-form
v-if="mode.includes('form')"
ref="dataForm"
:model="dataForm"
size="small"
style="padding: 16px"
v-loading="formLoading">
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="订单号" prop="orderCode" :rules="null">
<el-input v-model="dataForm.orderCode" disabled placeholder="-" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="订单子号" prop="orderCate" :rules="null">
<el-input v-model="dataForm.orderCate" disabled placeholder="-" />
</el-form-item>
</el-col>
<el-col :span="8">
<!-- 总量 - 前端计算 -->
<el-form-item label="生产总量" prop="qty" :rules="null">
<el-input v-model="dataForm.qty" disabled placeholder="-" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="合格砖数量" prop="goodqty" :rules="[$fv.isRequired, $fv.isNumber]">
<el-input v-model="dataForm.goodqty" placeholder="请输入合格砖数量" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="报废砖数量" prop="badqty" :rules="[$fv.isRequired, $fv.isNumber]">
<el-input v-model="dataForm.badqty" placeholder="请输入报废砖数量" />
</el-form-item>
</el-col>
<el-col :span="8">
<!-- 报废率 - 前端计算 -->
<el-form-item label="报废率" prop="badratio" :rules="null">
<el-input v-model="dataForm.badratio" disabled placeholder="-" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="报工班次" prop="team" :rules="null">
<el-select v-model="dataForm.team" placeholder="请选择报工班次">
<el-option label="早班" value="0" />
<el-option label="中班" value="1" />
<el-option label="晚班" value="2" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8" style="padding-top: 32px">
<el-button type="primary" size="small" @click="handleSaveEdit">预保存</el-button>
<el-button size="small" @click="mode = 'table'">取消</el-button>
</el-col>
</el-row>
</el-form>
</transition>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="close">取消</el-button>
<el-button size="small" type="primary" @click="handleConfirm">提交更改</el-button>
</div>
</el-dialog>
</template>
<script>
import BaseListTable from "@/components/BaseListTable.vue";
import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent";
export default {
name: "ReportDialog",
components: { BaseListTable },
props: ["ids"],
data() {
return {
mode: "table",
visible: false,
loading: false,
dataList: [],
page: 1,
dataForm: {
id: null,
orderCate: null,
orderCode: null,
qty: null,
goodqty: null,
badqty: null,
badratio: null,
team: null,
},
formLoading: false,
dataFormList: [],
tableProps: [
{ prop: "orderCode", label: "订单号" },
{ prop: "orderCate", label: "订单子号" },
{ width: 90, prop: "qty", label: "生产量" },
{ width: 90, prop: "goodqty", label: "合格数量" },
{ width: 90, prop: "badqty", label: "报废数量" },
{ width: 90, prop: "badratio", label: "报废率", filter: (val) => (val ?? "-") + "%" },
{
width: 64,
prop: "team",
label: "班次",
filter: (val) => (val != null ? ["早班", "中班", "晚班"][val] : "-"),
},
{
prop: "operations",
name: "操作",
fixed: "right",
width: 90,
subcomponent: TableOperaionComponent,
options: [
{ name: "edit", label: "编辑", icon: "edit-outline", emitFull: true },
// {
// name: "delete",
// icon: "delete",
// label: "",
// emitFull: true,
// permission: "pms:carOrderReport:delete",
// },
],
},
],
currentEditing: null,
};
},
computed: {
size() {
return this.dataList.length;
},
},
inject: ['urls'],
watch: {
"dataForm.goodqty"(val) {
const qty = +val + +this.dataForm.badqty;
this.dataForm.qty = qty;
this.dataForm.badratio = ((+this.dataForm.badqty / qty) * 100).toFixed(2);
},
"dataForm.badqty"(val) {
const qty = +val + +this.dataForm.goodqty;
this.dataForm.qty = qty;
this.dataForm.badratio = ((+val / qty) * 100).toFixed(2);
},
},
methods: {
async init() {
this.visible = true;
this.loading = true;
// const { data: res } = await this.$http.post("/pms/workReport/pressReportPre", {
const { data: res } = await this.$http.post(this.urls.reportPre, {
datas: [],
ids: this.ids,
});
if (res.code === 0) {
this.dataList = res.data.map((item, index) => ({
...item,
qty: item.goodqty + item.badqty,
// __LOCAL_INDEX
__LOCAL_INDEX: index,
}));
}
this.loading = false;
},
close() {
this.visible = false;
},
handleOperate({ type, data }) {
//console.log("payload", type, data);
switch (type) {
case "edit":
this.mode = "form";
this.currentEditing = data.__LOCAL_INDEX;
const { id, orderCate, orderCode, qty, goodqty, badqty, badratio, team } = data;
this.dataForm = {
id,
orderCate,
orderCode,
qty,
goodqty,
badqty,
badratio,
team,
};
break;
}
},
async handleConfirm() {
this.loading = true;
const { data: res } = await this.$http.post(this.urls.report, {
datas: this.dataList,
ids: this.ids,
});
this.loading = false;
if (res.code === 0) {
this.$message.success("提交成功");
this.$emit("refresh-list");
this.close();
}
},
//
handleSaveEdit() {
Object.keys(this.dataForm).forEach((key) => {
this.dataList[this.currentEditing][key] = this.dataForm[key];
});
this.mode = "table";
this.$nextTick(() => {
this.clearDataForm();
});
},
//
clearDataForm() {
this.currentEditing = null;
this.dataForm = {
id: null,
orderCate: null,
orderCode: null,
qty: null,
goodqty: null,
badqty: null,
badratio: null,
team: null,
};
},
},
};
</script>
<style scoped>
.dialog-just-form >>> .dialog-title {
color: #000;
}
.dialog-just-form >>> .el-dialog__body {
/* padding-top: 16px !important;
padding-bottom: 16px !important; */
padding-top: 0 !important;
padding-bottom: 0 !important;
}
.el-select,
.el-cascader,
.el-date-editor {
width: 100% !important;
}
.dialog-just-form >>> .el-dialog__header {
padding: 10px 20px 10px;
/* background: linear-gradient(to bottom, rgba(0, 0, 0, 0.25), white); */
}
</style>
<style>
.pms-dialog {
box-shadow: 0 0 24px 8px rgba(0, 0, 0, 0.125);
border-radius: 4px;
transition: transform 1.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}
.pms-dialog .el-dialog__header {
padding: 16px;
border-bottom: 1px solid #eaeaea;
}
.pms-dialog .el-dialog__header .dialog-title {
font-size: 1.2rem;
}
.pms-dialog .el-dialog__body {
padding: 0;
overflow-x: hidden;
}
.pms-dialog .el-dialog__footer {
background: #fafafa;
min-height: 3.2rem;
padding: 0;
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
text-align: unset;
display: flex;
justify-content: flex-end;
padding: 8px 16px;
align-items: center;
}
.v-enter,
.v-leave-to {
opacity: 0;
/* transform: translateX(20px); */
transform: scale(0);
}
.v-enter-active,
.v-leave-active {
transition: all 0.3s;
}
.v-enter-to,
.v-leave {
/* transform: translateX(0); */
transform: scale(1);
}
</style>

View File

@ -36,7 +36,9 @@
:label="opt.label" :label="opt.label"
:value="opt.value"> :value="opt.value">
<span>{{ opt.label }}</span> <span>{{ opt.label }}</span>
<span v-if="col.customLabel" style="display: inline-clock; margin-left: 12px; font-size: 0.9em"> <span
v-if="col.customLabel"
style="display: inline-clock; margin-left: 12px; font-size: 0.9em">
{{ opt[col.customLabel] || "-" }} {{ opt[col.customLabel] || "-" }}
</span> </span>
</el-option> </el-option>
@ -96,6 +98,10 @@ export default {
type: String, type: String,
default: "", default: "",
}, },
code: {
type: String,
default: null,
},
}, },
inject: ["urls"], inject: ["urls"],
data() { data() {
@ -103,7 +109,7 @@ export default {
this.configs.rows.forEach((row) => { this.configs.rows.forEach((row) => {
row.forEach((col) => { row.forEach((col) => {
dataForm[col.prop] = col.default ?? ""; dataForm[col.prop] = col.default ?? "";
console.log("[small dialog]==========>", col.prop, dataForm[col.prop]); //console.log("[small dialog]==========>", col.prop, dataForm[col.prop]);
if (typeof col.fetchData === "function") if (typeof col.fetchData === "function")
col.fetchData().then(({ data: res }) => { col.fetchData().then(({ data: res }) => {
@ -112,20 +118,23 @@ export default {
col, col,
"options", "options",
!col.customLabel !col.customLabel
? res.data.list.map((item) => ({ label: item[col.optionLabel ?? "name"], value: item.id })) ? res.data.list.map((item) => ({
label: item[col.optionLabel ?? "name"],
value: item.id,
}))
: res.data.list.map((item) => ({ : res.data.list.map((item) => ({
label: item[col.optionLabel ?? "name"], label: item[col.optionLabel ?? "name"],
value: item.id, value: item.id,
[col.customLabel]: item[col.customLabel], [col.customLabel]: item[col.customLabel],
})) }))
); );
console.log( //console.log(
res.data.list.map((item) => ({ // res.data.list.map((item) => ({
label: item.name, // label: item.name,
value: item.id, // value: item.id,
[col.customLabel]: item[col.customLabel], // [col.customLabel]: item[col.customLabel],
})) // }))
); // );
} else { } else {
this.$set(col, "options", []); this.$set(col, "options", []);
} }
@ -156,7 +165,7 @@ export default {
resetForm(excludeId = false) { resetForm(excludeId = false) {
setTimeout(() => { setTimeout(() => {
Object.keys(this.dataForm).forEach((key) => { Object.keys(this.dataForm).forEach((key) => {
// console.log(">>> clearing key: ", key); // //console.log(">>> clearing key: ", key);
if (excludeId && key === "id") return; if (excludeId && key === "id") return;
this.dataForm[key] = null; this.dataForm[key] = null;
}); });
@ -165,7 +174,7 @@ export default {
}, },
init(id, isdetail = false) { init(id, isdetail = false) {
// console.log("[small dialog] init", id, isdetail); // //console.log("[small dialog] init", id, isdetail);
this.visible = true; this.visible = true;
this.detailMode = isdetail; this.detailMode = isdetail;
@ -201,8 +210,8 @@ export default {
handleSwitchChange() {}, handleSwitchChange() {},
handleBtnClick(payload) { handleBtnClick(payload) {
console.log("btn click payload: ", payload); //console.log("btn click payload: ", payload);
console.log("configs", this.configs); //console.log("configs", this.configs);
if ("name" in payload) { if ("name" in payload) {
switch (payload.name) { switch (payload.name) {
case "cancel": case "cancel":
@ -213,23 +222,31 @@ export default {
this.$refs.dataForm.validate((passed, result) => { this.$refs.dataForm.validate((passed, result) => {
if (passed) { if (passed) {
this.btnLoading = true; this.btnLoading = true;
console.log("update extraParam: ", this.configs.extraParam); //console.log("update extraParam: ", this.configs.extraParam);
const method = payload.name === "add" ? "POST" : "PUT"; const method = payload.name === "add" ? "POST" : "PUT";
const fields = {}; const fields = {};
fields[this.configs.extraParam] = this.relatedId; fields[this.configs.extraParam] = this.relatedId;
// [this.configs.extraParam]: this.relatedId, // this.configs.extraParam // [this.configs.extraParam]: this.relatedId, // this.configs.extraParam
if (this.configs.forceAttachCode) fields["code"] = ""; if (this.configs.forceAttachCode) fields["code"] = "";
let body = {
...this.dataForm,
...fields,
};
if (payload.name == "update") {
if (this.code != null) {
body.code = this.code;
}
}
console.log("body", body);
this.$http({ this.$http({
url: this.urls.subase, url: this.urls.subase,
method, method,
data: { data: body,
...this.dataForm,
...fields,
},
}).then(({ data: res }) => { }).then(({ data: res }) => {
console.log("[add&update] res is: ", res); //console.log("[add&update] res is: ", res);
this.btnLoading = false; this.btnLoading = false;
if (res.code === 0) { if (res.code === 0) {
this.$message.success(payload.name === "add" ? "添加成功" : "更新成功"); this.$message.success(payload.name === "add" ? "添加成功" : "更新成功");
@ -242,7 +259,7 @@ export default {
} }
} }
} else { } else {
console.log("[x] 不是这么用的! 缺少name属性"); //console.log("[x] ! name");
} }
}, },

View File

@ -17,7 +17,7 @@ export default {
}, },
methods: { methods: {
emitClick() { emitClick() {
// console.log('inject data:' ,this.injectData) // //console.log('inject data:' ,this.injectData)
this.$emit('emit-data', { this.$emit('emit-data', {
type: this.injectData.head?.actionName || 'view-detail-action', type: this.injectData.head?.actionName || 'view-detail-action',
data: this.injectData.head?.emitFullData ? this.injectData : this.injectData.id data: this.injectData.head?.emitFullData ? this.injectData : this.injectData.id
@ -25,7 +25,7 @@ export default {
} }
}, },
render: function (h) { render: function (h) {
// console.log('button content:', this.injectData) // //console.log('button content:', this.injectData)
return h('span', null, [h('el-button', { props: { type: 'text' }, style: { padding: 0, margin: '5px 0' }, on: { click: this.emitClick } }, this.injectData.head?.buttonContent || this.defaultText)]) return h('span', null, [h('el-button', { props: { type: 'text' }, style: { padding: 0, margin: '5px 0' }, on: { click: this.emitClick } }, this.injectData.head?.buttonContent || this.defaultText)])
} }
} }

View File

@ -53,7 +53,7 @@ export default {
}; };
}, },
// mounted() { // mounted() {
// console.log('inject data', this.injectData) // //console.log('inject data', this.injectData)
// }, // },
methods: { methods: {
// 发射事件 // 发射事件
@ -94,7 +94,7 @@ export default {
if ("enable" in opt && typeof opt.enable === "function") { if ("enable" in opt && typeof opt.enable === "function") {
shouldDisabled = !opt.enable(this.injectData); shouldDisabled = !opt.enable(this.injectData);
} }
// console.log('should disabled', shouldDisabled) // //console.log('should disabled', shouldDisabled)
btns.push( btns.push(
h( h(
"el-button", "el-button",

View File

@ -26,7 +26,7 @@ export default {
}, },
// modelValue(val) { // modelValue(val) {
// // 这样不行,会导致编辑时富文本内容是反过来的... // // 这样不行,会导致编辑时富文本内容是反过来的...
// console.log('[modelValue] val is: ', val) // //console.log('[modelValue] val is: ', val)
// this.editor && this.editor.setContents(JSON.parse(val), "user") // this.editor && this.editor.setContents(JSON.parse(val), "user")
// } // }
modelValue(val) { modelValue(val) {

View File

@ -16,7 +16,7 @@ export default {
}, },
methods: { methods: {
emitClick() { emitClick() {
// console.log('inject data:' ,this.injectData) // //console.log('inject data:' ,this.injectData)
this.$emit('emit-data', { this.$emit('emit-data', {
type: this.injectData.head?.actionName || 'select-change-action', type: this.injectData.head?.actionName || 'select-change-action',
data: this.injectData.head?.emitFullData ? this.injectData : this.injectData.id data: this.injectData.head?.emitFullData ? this.injectData : this.injectData.id
@ -24,7 +24,7 @@ export default {
} }
}, },
render: function (h) { render: function (h) {
// console.log('button content:', this.injectData) // //console.log('button content:', this.injectData)
return h('span', null, [h('el-button', { props: { type: 'text' }, style: { paddingLeft: 0 }, on: { click: this.emitClick } }, this.injectData.head?.buttonContent || this.defaultText)]) return h('span', null, [h('el-button', { props: { type: 'text' }, style: { paddingLeft: 0 }, on: { click: this.emitClick } }, this.injectData.head?.buttonContent || this.defaultText)])
} }
} }

View File

@ -49,7 +49,7 @@ export default {
} }
}, },
mounted() { mounted() {
// console.log("[component] StatusComponent: ", this.injectData); // //console.log("[component] StatusComponent: ", this.injectData);
}, },
methods: { methods: {
// 发射事件 // 发射事件

View File

@ -19,7 +19,7 @@ export default {
}; };
}, },
mounted() { mounted() {
// console.log("[SwitchBtn] injectData: ", this.injectData); // //console.log("[SwitchBtn] injectData: ", this.injectData);
}, },
computed: { computed: {
status: { status: {

View File

@ -0,0 +1,193 @@
<!--
filename: palletDialog.vue
author: liubin
date: 2023-08-22 09:15:49
description: 生成托盘弹窗
-->
<template>
<el-dialog
:visible.sync="visible"
width="500px"
v-bind="$attrs"
@close="close"
@closed="$emit('destroy')"
custom-class="pms-dialog">
<!-- :class="{ 'pms-dialog--rotate-down': startLeave }"> -->
<span slot="title" class="dialog-title">生成托盘</span>
<el-form ref="dataForm" :model="dataForm" size="small" style="padding: 16px" v-loading="formLoading">
<el-row :gutter="20">
<el-col>
<el-form-item label="订单号" prop="orderId" :rules="null">
<el-select v-model="dataForm.orderId" filterable clearable placeholder="请选择订单号">
<el-option v-for="o in orderList" :key="o.id" :label="o.code" :value="o.id">
<div class="option-label">
<span>{{ o.code }}</span>
<span>{{ o.cate }}</span>
</div>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row v-if="ids.length > 0" :gutter="20">
<el-col>
<el-form-item label="尾托" prop="ids" :rules="null">
<el-input disabled v-model="ids[0].orderCode" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="close">取消</el-button>
<el-button size="small" type="primary" @click="handleConfirm">生成</el-button>
</div>
</el-dialog>
</template>
<script>
export default {
name: "PalletDialog",
components: {},
props: ["ids"],
data() {
return {
visible: false,
loading: false,
orderList: [],
dataForm: {
orderId: null,
ids: [],
},
formLoading: false,
};
},
methods: {
async init() {
this.visible = true;
this.loading = true;
//
const { data: res } = await this.$http.post("/pms/order/listWithStock");
if (res.code === 0) {
this.orderList = res.data.map((item, index) => ({
code: item.code, //
cate: item.cate, //
id: item.id, // id
}));
} else this.$message.error(res.msg);
this.loading = false;
},
close() {
this.visible = false;
},
async handleConfirm() {
this.loading = true;
try {
const { data: res } = await this.$http.post("/pms/pallet/newPallet", {
...this.dataForm,
ids: this.ids.map((item) => item.id),
});
if (res.code === 0) {
this.$message.success("提交成功");
this.$emit("refresh-list");
this.close();
this.loading = false;
} else throw new Error(res.msg);
} catch (err) {
this.$message.error('message' in err ? err.message : err);
this.loading = false;
}
},
//
clearDataForm() {
this.dataForm = {
orderId: null,
ids: [],
};
},
},
};
</script>
<style scoped>
.dialog-just-form >>> .dialog-title {
color: #000;
}
.dialog-just-form >>> .el-dialog__body {
/* padding-top: 16px !important;
padding-bottom: 16px !important; */
padding-top: 0 !important;
padding-bottom: 0 !important;
}
.el-select,
.el-cascader,
.el-date-editor {
width: 100% !important;
}
.dialog-just-form >>> .el-dialog__header {
padding: 10px 20px 10px;
/* background: linear-gradient(to bottom, rgba(0, 0, 0, 0.25), white); */
}
</style>
<style>
.pms-dialog {
box-shadow: 0 0 24px 8px rgba(0, 0, 0, 0.125);
border-radius: 4px;
transition: transform 1.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}
.pms-dialog .el-dialog__header {
padding: 16px;
border-bottom: 1px solid #eaeaea;
}
.pms-dialog .el-dialog__header .dialog-title {
font-size: 1.2rem;
}
.pms-dialog .el-dialog__body {
padding: 0;
overflow-x: hidden;
}
.pms-dialog .el-dialog__footer {
background: #fafafa;
min-height: 3.2rem;
padding: 0;
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
text-align: unset;
display: flex;
justify-content: flex-end;
padding: 8px 16px;
align-items: center;
}
.option-label {
display: flex;
align-items: center;
}
.option-label > span {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.option-label > span:first-child {
width: 128px;
margin-right: 8px;
}
/* .option-label > span:last-child {
} */
</style>

View File

@ -59,7 +59,7 @@ export default {
watch: { watch: {
fileList(val) { fileList(val) {
if (val) { if (val) {
console.log("[FileList] fileList prop:", val); //console.log("[FileList] fileList prop:", val);
} }
}, },
}, },
@ -82,7 +82,7 @@ export default {
responseType: "blob", responseType: "blob",
}) })
.then(({ data: res }) => { .then(({ data: res }) => {
console.log("preivew", res); //console.log("preivew", res);
if (/image/i.test(res.type) || /pdf/i.test(res.type)) { if (/image/i.test(res.type) || /pdf/i.test(res.type)) {
let a = document.createElement('a') let a = document.createElement('a')
a.setAttribute('target', '_blank') a.setAttribute('target', '_blank')
@ -100,7 +100,7 @@ export default {
}, },
handleDownload(file) { handleDownload(file) {
console.log("[FileList] handleDownload", file); //console.log("[FileList] handleDownload", file);
this.$http this.$http
.get("/pms/attachment/downloadFile", { .get("/pms/attachment/downloadFile", {
params: { params: {
@ -136,12 +136,12 @@ export default {
}); });
}, },
handleDelete(file) { handleDelete(file) {
console.log("[FileList] handleDelete", file); //console.log("[FileList] handleDelete", file);
// TODO: // TODO:
this.$emit("delete-a-file", file.id); this.$emit("delete-a-file", file.id);
}, },
handleSearchClick() { handleSearchClick() {
console.log("[FileList] handleSearchClick()"); //console.log("[FileList] handleSearchClick()");
this.showSearchInput = true; this.showSearchInput = true;
}, },
}, },

View File

@ -77,12 +77,12 @@ export default {
}, },
}, },
mounted() { mounted() {
console.log("[UploadBtn] mounted()", this.fileList, this.uploadedFileList); //console.log("[UploadBtn] mounted()", this.fileList, this.uploadedFileList);
this.uploadedFileList = this.fileList ?? []; this.uploadedFileList = this.fileList ?? [];
}, },
methods: { methods: {
handleRemoveFile(fileId) { handleRemoveFile(fileId) {
console.log("[UploadBtn] handleRemoveFile", fileId); //console.log("[UploadBtn] handleRemoveFile", fileId);
this.$confirm("确定删除此文件?", "提示", { this.$confirm("确定删除此文件?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
@ -112,7 +112,7 @@ export default {
}, },
handleUploadSuccess(response, file, fileList) { handleUploadSuccess(response, file, fileList) {
console.log("[UploadBtn] uploadedFileList", response, file, fileList, this.uploadedFileList); //console.log("[UploadBtn] uploadedFileList", response, file, fileList, this.uploadedFileList);
if (response.code === 0) { if (response.code === 0) {
const uploadedFile = response.data[0]; const uploadedFile = response.data[0];

View File

@ -23,7 +23,8 @@ import { hasPermission, getDictLabel } from '@/utils'
import cloneDeep from 'lodash/cloneDeep' import cloneDeep from 'lodash/cloneDeep'
// main.js // main.js
import myComponents from 'code-brick-zj' import myComponents from 'code-brick-zj'
// 表单验证
import { formValidateRules } from '@/utils/validate'
// import mocks from './mocks' // import mocks from './mocks'
@ -44,6 +45,7 @@ Vue.use(myComponents)
Vue.prototype.$http = http Vue.prototype.$http = http
Vue.prototype.$hasPermission = hasPermission Vue.prototype.$hasPermission = hasPermission
Vue.prototype.$getDictLabel = getDictLabel Vue.prototype.$getDictLabel = getDictLabel
Vue.prototype.$fv = formValidateRules
// 保存整站vuex本地储存初始状态 // 保存整站vuex本地储存初始状态
window.SITE_CONFIG['storeState'] = cloneDeep(store.state) window.SITE_CONFIG['storeState'] = cloneDeep(store.state)

View File

@ -70,14 +70,14 @@ export default {
}, },
// 表单提交 // 表单提交
dataFormSubmit() { dataFormSubmit() {
console.log('in minxin basic-page dataformsubmit') //console.log('in minxin basic-page dataformsubmit')
this.$refs["dataForm"].validate((valid) => { this.$refs["dataForm"].validate((valid) => {
if (!valid) { if (!valid) {
return false; return false;
} }
this.$http[!this.dataForm.id ? "post" : "put"](this.urlOptions.submitURL, this.dataForm) this.$http[!this.dataForm.id ? "post" : "put"](this.urlOptions.submitURL, this.dataForm)
.then(({ data: res }) => { .then(({ data: res }) => {
// console.log('[confirm] here...') // //console.log('[confirm] here...')
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg); return this.$message.error(res.msg);
} }

View File

@ -103,7 +103,7 @@ export default {
this.$refs.addOrUpdate.init(val.data.id); this.$refs.addOrUpdate.init(val.data.id);
}); });
} else if (val.type === "delete") { } else if (val.type === "delete") {
console.log('va', val) //console.log('va', val)
this.deleteHandle(val.data.id, val.data.name) this.deleteHandle(val.data.id, val.data.name)
} }
}, },
@ -151,7 +151,7 @@ export default {
this.addOrUpdateHandle() this.addOrUpdateHandle()
break; break;
default: default:
console.log(val) //console.log(val)
} }
}, },
handleCancel() { handleCancel() {
@ -165,7 +165,7 @@ export default {
refreshLocalstorage() { refreshLocalstorage() {
// 刷新数据字典数据 // 刷新数据字典数据
this.$http("/sys/dict/type/all", { limit: 999, page: 1 }).then(({ data: res }) => { this.$http("/sys/dict/type/all", { limit: 999, page: 1 }).then(({ data: res }) => {
// console.log("[dictData] loading...", res); // //console.log("[dictData] loading...", res);
if (res.code === 0 && res.data) { if (res.code === 0 && res.data) {
let dictList = {} let dictList = {}
res.data.map(item => { res.data.map(item => {

View File

@ -9,7 +9,7 @@ function m(url, type, fn) {
m(carManagement.url, carManagement.type, opt => { m(carManagement.url, carManagement.type, opt => {
let { limit, page } = JSON.parse(opt.body) let { limit, page } = JSON.parse(opt.body)
// console.log('limit, page', limit, page, opt.body) // //console.log('limit, page', limit, page, opt.body)
// limit = 5 // limit = 5
return { return {
code: 0, code: 0,

77
src/utils/Lodop.js Normal file
View File

@ -0,0 +1,77 @@
//用双端口加载主JS文件Lodop.js(或CLodopfuncs.js兼容老版本)以防其中某端口被占:
var MainJS = "CLodopfuncs.js",
URL_WS1 = "ws://localhost:8000/" + MainJS, //ws用8000/18000
URL_WS2 = "ws://localhost:18000/" + MainJS,
URL_HTTP1 = "http://localhost:8000/" + MainJS, //http用8000/18000
URL_HTTP2 = "http://localhost:18000/" + MainJS,
URL_HTTP3 = "https://localhost.lodop.net:8443/" + MainJS; //https用8000/8443
//==检查加载成功与否如没成功则用http(s)再试==
//==低版本CLODOP6.561/Lodop7.043及前)用本方法==
function checkOrTryHttp() {
if (window.getCLodop) return true;
var head = document.head || document.getElementsByTagName("head")[0] || document.documentElement;
var JS1 = document.createElement("script"),
JS2 = document.createElement("script"),
JS3 = document.createElement("script");
JS1.src = URL_HTTP1;
JS2.src = URL_HTTP2;
JS3.src = URL_HTTP3;
JS1.onerror = function (e) {
if (window.location.protocol !== "https:") head.insertBefore(JS2, head.firstChild);
else head.insertBefore(JS3, head.firstChild);
};
JS2.onerror = JS3.onerror = function () {
var JSelf = document.createElement("script");
JSelf.src = "/" + MainJS; //JSelf让其它电脑通过本机打印仅适用CLodop自带例子
document.head.insertBefore(JSelf, document.head.firstChild);
};
head.insertBefore(JS1, head.firstChild);
}
//==加载Lodop对象的主过程:==
(function loadCLodop() {
if (!window.WebSocket && window.MozWebSocket) window.WebSocket = window.MozWebSocket;
//ws方式速度快(小于200ms)且可避免CORS错误,但要求Lodop版本足够新:
try {
var WSK1 = new WebSocket(URL_WS1);
WSK1.onopen = function (e) {
setTimeout(checkOrTryHttp, 200);
};
WSK1.onmessage = function (e) {
if (!window.getCLodop) eval(e.data);
};
WSK1.onerror = function (e) {
var WSK2 = new WebSocket(URL_WS2);
WSK2.onopen = function (e) {
setTimeout(checkOrTryHttp, 200);
};
WSK2.onmessage = function (e) {
if (!window.getCLodop) eval(e.data);
};
WSK2.onerror = function (e) {
checkOrTryHttp();
};
};
} catch (e) {
checkOrTryHttp();
}
})();
//==获取LODOP对象的主过程:==
export function getLodop(oOBJECT, oEMBED) {
var LODOP;
try {
LODOP = window.getCLodop();
if (!LODOP && document.readyState !== "complete") {
alert("C-Lodop没准备好请稍后再试");
return;
}
//清理原例子内的object或embed元素避免乱提示
if (oEMBED && oEMBED.parentNode) oEMBED.parentNode.removeChild(oEMBED);
if (oOBJECT && oOBJECT.parentNode) oOBJECT.parentNode.removeChild(oOBJECT);
return LODOP;
} catch (err) {
alert("getLodop出错:" + err);
}
}

View File

@ -17,7 +17,7 @@ const http = axios.create({
http.interceptors.request.use(config => { http.interceptors.request.use(config => {
config.headers['Accept-Language'] = Cookies.get('language') || 'zh-CN' config.headers['Accept-Language'] = Cookies.get('language') || 'zh-CN'
config.headers['token'] = 'token' in config.headers ? config.headers.token : (Cookies.get('token') || '') config.headers['token'] = 'token' in config.headers ? config.headers.token : (Cookies.get('token') || '')
// console.log('[request interceptor] token is:', config.headers['token']) // //console.log('[request interceptor] token is:', config.headers['token'])
// 默认参数 // 默认参数
var defaults = {} var defaults = {}
// 防止缓存GET请求默认带_t参数 // 防止缓存GET请求默认带_t参数

View File

@ -3,7 +3,7 @@
* @param {*} s * @param {*} s
*/ */
export function isEmail(s) { export function isEmail(s) {
return /^([a-zA-Z0-9._-])+@([a-zA-Z0-9_-])+((.[a-zA-Z0-9_-]{2,3}){1,2})$/.test(s) return /^([a-zA-Z0-9._-])+@([a-zA-Z0-9_-])+((.[a-zA-Z0-9_-]{2,3}){1,2})$/.test(s);
} }
/** /**
@ -11,7 +11,7 @@ export function isEmail (s) {
* @param {*} s * @param {*} s
*/ */
export function isMobile(s) { export function isMobile(s) {
return /^1[0-9]{10}$/.test(s) return /^1[0-9]{10}$/.test(s);
} }
/** /**
@ -19,7 +19,7 @@ export function isMobile (s) {
* @param {*} s * @param {*} s
*/ */
export function isPhone(s) { export function isPhone(s) {
return /^([0-9]{3,4}-)?[0-9]{7,8}$/.test(s) return /^([0-9]{3,4}-)?[0-9]{7,8}$/.test(s);
} }
/** /**
@ -27,5 +27,22 @@ export function isPhone (s) {
* @param {*} s * @param {*} s
*/ */
export function isURL(s) { export function isURL(s) {
return /^http[s]?:\/\/.*/.test(s) return /^http[s]?:\/\/.*/.test(s);
} }
/**
* 表单验证
*/
export const formValidateRules = {
isRequired: {
required: true,
message: "必填项",
trigger: "blur",
},
isNumber: {
type: "number",
message: "请输入正确的数字类型",
trigger: "blur",
transform: (val) => Number(val),
},
};

View File

@ -115,7 +115,7 @@ export default {
}, },
}, },
activated() { activated() {
console.log("list view with ehad activated.........."); //console.log("list view with ehad activated..........");
this.refreshLayoutKey = this.layoutTable(); this.refreshLayoutKey = this.layoutTable();
}, },
watch: { watch: {
@ -182,7 +182,7 @@ export default {
} }
) )
.then(({ data: res }) => { .then(({ data: res }) => {
console.log("[http response] res is: ", res); //console.log("[http response] res is: ", res);
if (res.code === 0) { if (res.code === 0) {
// page : // page :
@ -232,7 +232,7 @@ export default {
/** 处理 表格操作 */ /** 处理 表格操作 */
handleOperate({ type, data }) { handleOperate({ type, data }) {
console.log("payload", type, data); //console.log("payload", type, data);
// component url // component url
// payload: { type: string, data: string | number | object } // payload: { type: string, data: string | number | object }
switch (type) { switch (type) {
@ -289,7 +289,7 @@ export default {
break; break;
} }
case "status": { case "status": {
console.log("status", data); //console.log("status", data);
// TODO: // TODO:
const { id, code } = data; const { id, code } = data;
const queryCondition = { id, code }; const queryCondition = { id, code };
@ -318,7 +318,7 @@ export default {
break; break;
} }
case "to-bom-detail": { case "to-bom-detail": {
// console.log('to-bom-detail', data.name) // //console.log('to-bom-detail', data.name)
// //
return this.$router.push({ return this.$router.push({
name: "pms-bomDetails", name: "pms-bomDetails",
@ -386,7 +386,7 @@ export default {
}); });
} }
case "preview": { case "preview": {
console.log("[PREVIEW] data", data); //console.log("[PREVIEW] data", data);
// report preview // report preview
return this.$router.push({ return this.$router.push({
name: "pms-reportPreview", name: "pms-reportPreview",
@ -396,7 +396,7 @@ export default {
}); });
} }
case "design": { case "design": {
console.log("[DESIGN] data", data); //console.log("[DESIGN] data", data);
// report design // report design
return this.$router.push({ return this.$router.push({
name: "pms-reportDesign", name: "pms-reportDesign",
@ -431,7 +431,7 @@ export default {
case "sync": { case "sync": {
let shouldShowOverlay = false; let shouldShowOverlay = false;
let payload = ""; let payload = "";
console.log("sync...", type, data); //console.log("sync...", type, data);
if (typeof data === "object") { if (typeof data === "object") {
const head = data.head; const head = data.head;
const syncOpt = const syncOpt =
@ -469,7 +469,7 @@ export default {
}, },
handleBtnClick({ btnName, payload }) { handleBtnClick({ btnName, payload }) {
console.log("[search] form handleBtnClick", btnName, payload); //console.log("[search] form handleBtnClick", btnName, payload);
switch (btnName) { switch (btnName) {
case "新增": case "新增":
this.openDialog(); this.openDialog();
@ -503,7 +503,7 @@ export default {
}); });
} }
}); });
console.log("查询", params); //console.log("", params);
this.getList(params); this.getList(params);
break; break;
} }
@ -541,7 +541,7 @@ export default {
}); });
} }
this.$nextTick(() => { this.$nextTick(() => {
console.log(`[edit-dialog] extraParams: ${extraParams}`); //console.log(`[edit-dialog] extraParams: ${extraParams}`);
this.$refs["edit-dialog"].init(/** some args... */ row_id, detail_mode, tag_info, extraParams); this.$refs["edit-dialog"].init(/** some args... */ row_id, detail_mode, tag_info, extraParams);
}); });
}, },

View File

@ -13,6 +13,7 @@
:current-page="page" :current-page="page"
:current-size="size" :current-size="size"
@select="handleTableSelect" @select="handleTableSelect"
:select-props="tableConfig.selectProps ?? []"
:refresh-layout-key="refreshLayoutKey" /> :refresh-layout-key="refreshLayoutKey" />
<el-pagination <el-pagination
@ -61,6 +62,22 @@
} }
" /> " />
<Overlay v-if="overlayVisible" /> <Overlay v-if="overlayVisible" />
<PrintDom ref="print" v-if="printDOMmount" @destroy="printDOMmount = false" @refresh-list="getList" />
<ReportDialog
ref="car-report-dialog"
v-if="carReportDialogVisible"
@destroy="carReportDialogVisible = false"
@refresh-list="getList"
:ids="tableSelectedIds" />
<PalletDialog
ref="pallet-dialog"
v-if="palletDialogVisible"
@destroy="palletDialogVisible = false"
@refresh-list="getList"
:ids="tableSelectedIds" />
</div> </div>
</template> </template>
@ -74,6 +91,9 @@ import DialogUpload from "@/components/DialogUpload.vue";
import Overlay from "@/components/Overlay.vue"; import Overlay from "@/components/Overlay.vue";
import moment from "moment"; import moment from "moment";
import AttachmentDialog from "@/components/attachmentDialog.vue"; import AttachmentDialog from "@/components/attachmentDialog.vue";
import PrintDom from "../../components/PrintDom.vue";
import ReportDialog from "../../components/ReportDialog.vue";
import PalletDialog from "../../components/palletDialog.vue";
const DIALOG_WITH_MENU = "DialogWithMenu"; const DIALOG_WITH_MENU = "DialogWithMenu";
const DIALOG_JUST_FORM = "DialogJustForm"; const DIALOG_JUST_FORM = "DialogJustForm";
@ -90,6 +110,9 @@ export default {
DialogUpload, DialogUpload,
Overlay, Overlay,
AttachmentDialog, AttachmentDialog,
PrintDom,
ReportDialog,
PalletDialog,
}, },
props: { props: {
navigator: { navigator: {
@ -142,16 +165,17 @@ export default {
}, },
watch: { watch: {
page: (val) => { page: (val) => {
console.log("page changed:", val); //console.log("page changed:", val);
}, },
size: (val) => { size: (val) => {
console.log("size changed:", val); //console.log("size changed:", val);
}, },
triggerUpdate(val, oldVal) { triggerUpdate(val, oldVal) {
if (val && val !== oldVal) { if (val && val !== oldVal) {
// get list // get list
this.page = 1; this.page = 1;
this.size = "defaultPageSize" in this.tableConfig.column ? this.tableConfig.column.defaultPageSize : 20; this.size =
"defaultPageSize" in this.tableConfig.column ? this.tableConfig.column.defaultPageSize : 20;
this.getList(); this.getList();
} }
}, },
@ -175,14 +199,33 @@ export default {
cachedSearchCondition: {}, cachedSearchCondition: {},
needAttachmentDialog: false, needAttachmentDialog: false,
tableSelectedIds: [], tableSelectedIds: [],
printDOMmount: false,
queryParams: {},
carReportDialogVisible: false,
palletDialogVisible: false,
}; };
}, },
inject: ["urls"], inject: ["urls"],
mounted() { mounted() {
// size // size
const size = "defaultPageSize" in this.tableConfig.column ? this.tableConfig.column.defaultPageSize : 20; const size =
"defaultPageSize" in this.tableConfig.column ? this.tableConfig.column.defaultPageSize : 20;
this.size = size; this.size = size;
// listQueryExtra queryParams
if (this.listQueryExtra && Array.isArray(this.listQueryExtra)) {
this.listQueryExtra.map((item) => {
if (typeof item === "string") this.$set(this.queryParams, item, "");
else if (typeof item === "object") {
Object.keys(item).forEach((key) => {
this.$set(this.queryParams, key, item[key]);
});
}
});
}
//console.log("this.queryParams is: ", JSON.stringify(this.queryParams));
this.initDataWhenLoad && this.getList(); this.initDataWhenLoad && this.getList();
}, },
methods: { methods: {
@ -196,43 +239,29 @@ export default {
page: this.page, page: this.page,
limit: this.size, limit: this.size,
}; };
// this.dataList = [{}];
if (!queryParams && this.listQueryExtra && this.listQueryExtra.length) { // this.tableLoading = false;
this.listQueryExtra.map((nameOrObj) => { // return;
if (typeof nameOrObj === "string") params[nameOrObj] = "";
else if (typeof nameOrObj === "object") {
Object.keys(nameOrObj).forEach((key) => {
params[key] = nameOrObj[key];
});
}
});
this.cachedSearchCondition = Object.assign({}, params);
}
this.$http[this.urls.pageIsPostApi ? "post" : "get"]( this.$http[this.urls.pageIsPostApi ? "post" : "get"](
this.urls.page, this.urls.page,
this.urls.pageIsPostApi this.urls.pageIsPostApi
? { ? {
...this.queryParams,
...params, ...params,
} }
: { : {
params, params: {
...this.queryParams,
...params,
},
} }
) )
.then(({ data: res }) => { .then(({ data: res }) => {
console.log("[http response] res is: ", res); //console.log("[http response] res is: ", res);
if (res.code === 0) { if (res.code === 0) {
// page : // page :
if ("list" in res.data) { if ("list" in res.data) {
// if (res.data.list.length == 0 && res.data.total != 0) {
// // refresh list
// if (this.page > 1) {
// this.page -= 1
// this.getList()
// return
// } else return
// }
/** 破碎记录的特殊需求:数据要结合单位 material + materialUnitDictValue */ /** 破碎记录的特殊需求:数据要结合单位 material + materialUnitDictValue */
if ("attachDictValue" in this.tableConfig.column) { if ("attachDictValue" in this.tableConfig.column) {
this.dataList = res.data.list.map((row) => { this.dataList = res.data.list.map((row) => {
@ -241,12 +270,6 @@ export default {
}); });
} else this.dataList = res.data.list; } else this.dataList = res.data.list;
this.totalPage = res.data.total;
} else if ("records" in res.data) {
this.dataList = res.data.records.map((item) => ({
...item,
id: item._id ?? item.id,
}));
this.totalPage = res.data.total; this.totalPage = res.data.total;
} else if (Array.isArray(res.data)) { } else if (Array.isArray(res.data)) {
this.dataList = res.data; this.dataList = res.data;
@ -284,7 +307,7 @@ export default {
/** 处理 表格操作 */ /** 处理 表格操作 */
handleOperate({ type, data }) { handleOperate({ type, data }) {
console.log("payload", type, data); //console.log("payload", type, data);
// component url // component url
// payload: { type: string, data: string | number | object } // payload: { type: string, data: string | number | object }
switch (type) { switch (type) {
@ -340,7 +363,7 @@ export default {
.catch((err) => {}); .catch((err) => {});
} }
case "edit": { case "edit": {
console.log("[edit] ", data); //console.log("[edit] ", data);
this.openDialog(data); /** data is ==> id */ this.openDialog(data); /** data is ==> id */
break; break;
} }
@ -372,7 +395,7 @@ export default {
break; break;
} }
case "status": { case "status": {
console.log("status", data); //console.log("status", data);
// TODO: // TODO:
const { id, code } = data; const { id, code } = data;
const queryCondition = { id, code }; const queryCondition = { id, code };
@ -397,7 +420,7 @@ export default {
break; break;
} }
case "view-attachment-justform-version": { case "view-attachment-justform-version": {
console.log(data); //console.log(data);
break; break;
} }
case "view-recipe": { case "view-recipe": {
@ -405,7 +428,7 @@ export default {
break; break;
} }
case "to-bom-detail": { case "to-bom-detail": {
console.log("to-bom-detail", data); //console.log("to-bom-detail", data);
// //
return this.$router.push({ return this.$router.push({
name: "pms-bomDetails", name: "pms-bomDetails",
@ -424,7 +447,7 @@ export default {
.then(() => { .then(() => {
// //
let payload = ""; let payload = "";
console.log("copying...", type, data); //console.log("copying...", type, data);
if (typeof data === "object") { if (typeof data === "object") {
const head = data.head; const head = data.head;
const copyOpt = const copyOpt =
@ -494,7 +517,7 @@ export default {
}); });
} }
case "preview": { case "preview": {
console.log("[PREVIEW] data", data); //console.log("[PREVIEW] data", data);
// report preview // report preview
return this.$router.push({ return this.$router.push({
name: "pms-reportPreview", name: "pms-reportPreview",
@ -504,7 +527,7 @@ export default {
}); });
} }
case "design": { case "design": {
console.log("[DESIGN] data", data); //console.log("[DESIGN] data", data);
// report design // report design
return this.$router.push({ return this.$router.push({
name: "pms-reportDesign", name: "pms-reportDesign",
@ -521,7 +544,9 @@ export default {
}) })
.then(() => { .then(() => {
this.$http this.$http
.post(this.urls.detach, data /* { id: data } */, { headers: { "Content-Type": "application/json" } }) .post(this.urls.detach, data /* { id: data } */, {
headers: { "Content-Type": "application/json" },
})
.then(({ data: res }) => { .then(({ data: res }) => {
if (res.code === 0) { if (res.code === 0) {
this.$message({ this.$message({
@ -562,13 +587,20 @@ export default {
break; break;
} }
case "sync": { case "sync": {
return this.$confirm(`是否开始同步`, "提示", {
confirmButtonText: "同步",
cancelButtonText: "我再想想",
type: "warning",
}).then(() => {
let shouldShowOverlay = false; let shouldShowOverlay = false;
let payload = ""; let payload = "";
console.log("sync...", type, data); // //console.log("sync...", type, data);
if (typeof data === "object") { if (typeof data === "object") {
const head = data.head; const head = data.head;
const syncOpt = const syncOpt =
("options" in head && Array.isArray(head.options) && head.options.find((item) => item.name === "sync")) || ("options" in head &&
Array.isArray(head.options) &&
head.options.find((item) => item.name === "sync")) ||
null; null;
if (syncOpt && "showOverlay" in syncOpt && syncOpt.showOverlay) { if (syncOpt && "showOverlay" in syncOpt && syncOpt.showOverlay) {
this.overlayVisible = true; this.overlayVisible = true;
@ -597,11 +629,44 @@ export default {
this.getList(); this.getList();
if (shouldShowOverlay) this.overlayVisible = false; if (shouldShowOverlay) this.overlayVisible = false;
}); });
});
}
case "print": {
return this.$confirm("开始打印么", "提示", {
confirmButtonText: "确认",
cancelButtonText: "我再想想",
type: "warning",
})
.then(this.printOnce.bind(null, data))
.then(() => {
// send successful request
return this.$http({
url: "/pms/pallet/print",
method: "post",
data: data,
headers: {
"Content-Type": "application/json",
},
});
})
.then(() => {
this.$message.success("打印成功!");
this.getList();
})
.catch(console.error);
} }
} }
}, },
openCarPayloadDialog(id) { openCarPayloadDialog(id) {
if (!id) {
//console.log("[*] car payloadid", id);
return this.$message({
message: `没有传 id!`,
type: "error",
duration: 1500,
});
}
this.carPayloadDialogVisible = true; this.carPayloadDialogVisible = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs["car-payload-dialog"].init(id); this.$refs["car-payload-dialog"].init(id);
@ -609,7 +674,7 @@ export default {
}, },
handleBtnClick({ btnName, payload }) { handleBtnClick({ btnName, payload }) {
console.log("[search] form handleBtnClick", btnName, payload); //console.log("[search] form handleBtnClick", btnName, payload);
switch (btnName) { switch (btnName) {
case "批量同步": case "批量同步":
this.overlayVisible = true; this.overlayVisible = true;
@ -625,43 +690,71 @@ export default {
case "导入": case "导入":
this.openUploadDialog(); this.openUploadDialog();
break; break;
case "导出":
this.$http({
method: "post",
url: this.urls.export,
data: { page: this.page },
responseType: "blob",
}).then((res) => {
// //console.log("", res);
const filename = res.headers["content-disposition"].split("filename=")[1];
const blob = new Blob([res.data]);
/** 通知 */
this.$notify({
title: "成功",
message: "开始下载",
type: "success",
duration: 1200,
});
if ("download" in document.createElement("a")) {
const alink = document.createElement("a");
alink.download = filename;
alink.style.display = "none";
alink.target = "_blank";
alink.href = URL.createObjectURL(blob);
document.body.appendChild(alink);
alink.click();
URL.revokeObjectURL(alink.href);
document.body.removeChild(alink);
} else {
navigator.msSaveBlob(blob, filename);
}
});
break;
case "手动添加": { case "手动添加": {
this.openDialog(); this.openDialog();
return; return;
} }
case "查询": { case "查询": {
if (typeof payload === "object") { const params = Object.assign({}, payload);
// BaseSearchForm
Object.assign(this.cachedSearchCondition, payload); if ("timerange" in params) {
if ("timerange" in payload) { if (!!params.timerange) {
if (!!payload.timerange) { const [startTime, endTime] = params["timerange"];
const [startTime, endTime] = payload["timerange"]; params.startTime = moment(startTime).format("YYYY-MM-DDTHH:mm:ss");
this.cachedSearchCondition.startTime = moment(startTime).format("YYYY-MM-DDTHH:mm:ss"); params.endTime = moment(endTime).format("YYYY-MM-DDTHH:mm:ss");
this.cachedSearchCondition.endTime = moment(endTime).format("YYYY-MM-DDTHH:mm:ss");
} else { } else {
delete this.cachedSearchCondition.startTime; params.startTime = null;
delete this.cachedSearchCondition.endTime; params.endTime = null;
}
delete this.cachedSearchCondition.timerange;
} }
delete params.timerange;
} }
/** 处理 listQueryExtra 里的数据 */ // //console.log(
this.listQueryExtra?.map((cond) => { // " params",
if (typeof cond === "string") { // JSON.stringify({
if (!!payload[cond]) { // // ...this.queryParams,
this.cachedSearchCondition[cond] = payload[cond]; // ...params,
} else { // })
this.cachedSearchCondition[cond] = ""; // );
}
} else if (typeof cond === "object") { this.queryParams = {
Object.keys(cond).forEach((key) => { ...this.queryParams,
this.cachedSearchCondition[key] = cond[key]; ...params,
}); };
}
}); this.getList();
console.log("查询", this.cachedSearchCondition);
this.getList(this.cachedSearchCondition);
break; break;
} }
case "同步": case "同步":
@ -675,7 +768,7 @@ export default {
this.$http this.$http
.post(this.urls.syncUrl) .post(this.urls.syncUrl)
.then(({ data: res }) => { .then(({ data: res }) => {
console.log("同步", res); //console.log("", res);
this.$message({ message: res.msg, type: res.code === 0 ? "success" : "error" }); this.$message({ message: res.msg, type: res.code === 0 ? "success" : "error" });
this.getList(); this.getList();
this.overlayVisible = false; this.overlayVisible = false;
@ -685,7 +778,89 @@ export default {
}); });
}); });
break; break;
case "打印":
if (this.tableSelectedIds.length === 0) {
return this.$message({
message: "请先选择要打印的项",
type: "warning",
duration: 1500,
});
} }
return this.$confirm("开始打印么", "提示", {
confirmButtonText: "确认",
cancelButtonText: "我再想想",
type: "warning",
})
.then(async () => {
const batchPrint = async function* () {
for (const item of this.tableSelectedIds) {
if (typeof item == "object" && "id" in item) {
yield { id: item.id, result: await this.printOnce(item.id) };
} else {
yield { id: item, result: await this.printOnce(item) }; // item id
}
}
};
for await (const { id } of batchPrint.call(this)) {
await this.$http({
url: "/pms/pallet/print",
method: "post",
data: id,
headers: {
"Content-Type": "application/json",
},
});
}
})
.then(() => {
this.$message.success("打印成功!");
this.getList();
})
.catch((err) => {
// this.$message.error(`: ${err}`);
});
case "报工":
//console.log("ids:", this.tableSelectedIds);
this.carReportDialogVisible = true;
this.$nextTick(() => {
this.$refs["car-report-dialog"].init();
});
break;
case "生成托盘":
if (this.tableSelectedIds.length > 1) {
return this.$message({
message: "只能选择一项",
type: "warning",
duration: 1500,
});
}
// // -
// if (this.tableSelectedIds.length == 1 && this.tableSelectedIds[0].typeDictValue != "2") {
// return this.$message({
// message: "",
// type: "warning",
// duration: 1500,
// });
// }
this.palletDialogVisible = true;
this.$nextTick(() => {
this.$refs["pallet-dialog"].init();
});
break;
}
},
/** 打印一次 */
printOnce(id) {
return new Promise((resolve) => {
this.printDOMmount = true;
this.$nextTick(async () => {
//console.log("[Print] :", id);
await this.$refs["print"].print(id);
resolve();
});
});
}, },
/** 导航器的操作 */ /** 导航器的操作 */
@ -693,12 +868,12 @@ export default {
// val // val
this.page = 1; this.page = 1;
this.size = val; this.size = val;
this.getList(this.cachedSearchCondition); this.getList();
}, },
handlePageChange(val) { handlePageChange(val) {
// val // val
this.getList(this.cachedSearchCondition); this.getList();
}, },
/** 打开对话框 */ /** 打开对话框 */
@ -712,7 +887,7 @@ export default {
}); });
} }
this.$nextTick(() => { this.$nextTick(() => {
console.log(`[edit-dialog] extraParams: ${extraParams}`); //console.log(`[edit-dialog] extraParams: ${extraParams}`);
this.$refs["edit-dialog"].init(/** some args... */ row_id, detail_mode, tag_info, extraParams); this.$refs["edit-dialog"].init(/** some args... */ row_id, detail_mode, tag_info, extraParams);
}); });
}, },

View File

@ -56,7 +56,7 @@ export default {
} }
list.push(newRouteItem); list.push(newRouteItem);
} else { } else {
// console.log(menu.name, '') // //console.log(menu.name, '')
} }
}); });
} }

View File

@ -0,0 +1,143 @@
import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent";
// import switchBtn from "@/components/noTemplateComponents/switchBtn";
import TableTextComponent from '@/components/noTemplateComponents/detailComponent'
import request from "@/utils/request";
import { timeFilter, dictFilter } from "@/utils/filters";
export default function () {
const tableProps = [
{ type: "index", label: "序号" },
{ prop: "name", label: "库位" },
{ prop: "order", label: "订单" },
{ prop: "orderSub", label: "子号" },
{ prop: "batchNo", label: "批次号" },
{ prop: "gradeId", label: "配方" },
{ prop: "status", label: "状态", filter: val => (val != null) ? ['空库位', '满料盅', '空料盅'][val] : '-' },
];
const now = new Date();
const [y, m, d] = [now.getFullYear(), now.getMonth(), now.getDate()];
const today = new Date(y, m, d, 0, 0, 0, 0).getTime();
const headFormFields = [
{
// prop: "key",
label: "AGV库位",
},
{
button: {
type: "primary",
permission: 'pms:agvList:info',
name: "刷新",
},
},
// {
// button: {
// type: "primary",
// name: "新增",
// permission: "",
// },
// bind: {
// plain: true,
// },
// },
];
/**
* dialog config 有两个版本一个适用于 DialogWithMenu 组件另一个适用于 DialogJustForm 组件
* 适用于 DialogWithMenu 组件的配置示例详见 blenderStep/config.js
* 此为后者的配置:
*/
const dialogJustFormConfigs = {
form: {
rows: [
[
{
input: true,
label: "批次号",
prop: "batchNo",
// rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "-" },
},
],
[
{
input: true,
label: "配方",
prop: "bom",
// rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "-" },
},
],
[
{
input: true,
label: "重量",
prop: "batchSize",
// rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "-" },
},
],
// [
// {
// select: true,
// label: "所属工厂",
// prop: "factoryId",
// fetchData: () => this.$http.get("/pms/factory/page", { params: { limit: 999, page: 1 } }),
// options: [],
// rules: { required: true, message: "必填项不能为空", trigger: "change" },
// },
// {
// input: true,
// label: "产线TT值",
// prop: "tvalue",
// rules: [
// { required: true, message: "必填项不能为空", trigger: "blur" },
// { type: "number", message: "数字", trigger: "blur", transform: (val) => Number(val) },
// ],
// elparams: { placeholder: "设定TT值每小时下片数量" },
// },
// ],
// [
// { input: true, label: "规格", prop: "specifications", elparams: { placeholder: "规格" } },
// {
// input: true,
// label: "重量",
// prop: "externalCode",
// rules: [{ type: 'number', trigger: "blur", message: "请输入数字类型", transform: val => Number(val) }],
// elparams: { placeholder: "外部编码" },
// },
// { input: true, label: "短描述", prop: "shortDesc", elparams: { placeholder: "短描述" } },
// ],
// [{ textarea: true, label: "描述", prop: "description", elparams: { placeholder: "描述" } }],
// [{ input: true, label: "备注", prop: "remark", elparams: { placeholder: "备注" } }],
],
operations: [
// { name: "add", label: "保存", type: "primary", permission: "pms:shape:save", showOnEdit: false },
// { name: "update", label: "更新", type: "primary", permission: "pms:shape:update", showOnEdit: true },
// { name: "reset", label: "重置", type: "warning", showAlways: true },
// { name: 'cancel', label: '取消', showAlways: true },
],
},
};
// 备注:弹窗弹出的时间和网速有关......
return {
dialogConfigs: dialogJustFormConfigs,
tableConfig: {
table: null, // 此处可省略el-table 上的配置项
column: tableProps, // el-column-item 上的配置项
},
headFormConfigs: {
rules: null, // 名称是由 BaseSearchForm.vue 组件固定的
fields: headFormFields, // 名称是由 BaseSearchForm.vue 组件固定的
},
urls: {
base: "/pms/trans/agvVisual",
page: "/pms/trans/agvVisual",
// detach: "/pms/agvTrans/delivery"
// subase: '/pms/blenderStepParam',
// subpage: '/pms/blenderStepParam/page',
// more...
},
};
}

View File

@ -0,0 +1,80 @@
<template>
<!-- <ListViewWithHead
:table-config="tableConfig"
:head-config="headFormConfigs"
:dialog-configs="dialogConfigs" /> -->
<div class="list-view-with-head">
<BaseSearchForm :head-config="headFormConfigs" @btn-click="handleBtnClick" />
<BaseListTable
v-loading="tableLoading"
:table-config="tableConfig.table"
:column-config="tableConfig.column"
:table-data="dataList"
:refresh-layout-key="refreshLayoutKey" />
</div>
</template>
<script>
import BaseListTable from "@/components/BaseListTable.vue";
import initConfig from "./config";
import BaseSearchForm from "@/components/BaseSearchForm.vue";
export default {
name: "AGVList",
components: { BaseListTable, BaseSearchForm },
provide() {
return {
urls: this.allUrls,
};
},
data() {
const { tableConfig, headFormConfigs, urls, dialogConfigs } = initConfig.call(this);
return {
tableLoading: false,
dataList: [],
refreshLayoutKey: Math.random(),
tableConfig,
headFormConfigs,
allUrls: urls,
dialogConfigs,
};
},
created() {},
mounted() {
this.getlist();
},
methods: {
async getlist() {
const { data: res } = await this.$http({
url: this.allUrls.page,
method: "get",
});
if (res.code == 0) {
this.dataList = res.data;
}
},
handleBtnClick({ btnName, payload }) {
switch (btnName) {
case "查询": {
this.getlist();
break;
}
}
},
},
};
</script>
<style scoped>
.list-view-with-head {
background: white;
/* height: 100%; */
min-height: inherit;
border-radius: 6px;
padding: 16px;
box-shadow: 0 0 1.125px 0.125px rgba(0, 0, 0, 0.125);
}
</style>

View File

@ -33,6 +33,9 @@ export default function () {
}, },
]; ];
const now = new Date();
const [y, m, d] = [now.getFullYear(), now.getMonth(), now.getDate()];
const today = new Date(y, m, d, 0, 0, 0, 0).getTime();
const headFormFields = [ const headFormFields = [
{ {
prop: "key", prop: "key",
@ -85,6 +88,7 @@ export default function () {
"start-placeholder": "开始时间", "start-placeholder": "开始时间",
"end-placeholder": "结束时间", "end-placeholder": "结束时间",
}, },
default: { value: [today - 24 * 7 * 1000 * 3600, today + 3600 * 24 * 1000] },
}, },
{ {
button: { button: {

View File

@ -7,7 +7,7 @@ import initConfig from './config';
import ListViewWithHead from '@/views/atomViews/ListViewWithHead.vue'; import ListViewWithHead from '@/views/atomViews/ListViewWithHead.vue';
export default { export default {
name: 'ProductionLineView', name: 'AGVMission',
components: { ListViewWithHead }, components: { ListViewWithHead },
provide() { provide() {
return { return {

View File

@ -190,19 +190,19 @@ export default {
const promiseHistory = {}; const promiseHistory = {};
const getData = (col, param) => { const getData = (col, param) => {
console.log("getData: ", col.prop, "/", param ?? "no param!"); //console.log("getData: ", col.prop, "/", param ?? "no param!");
// - // -
promiseHistory[col.prop] = col.fetchData(param).then(({ data: res }) => { promiseHistory[col.prop] = col.fetchData(param).then(({ data: res }) => {
if (res.code === 0) { if (res.code === 0) {
if ("list" in res.data) { if ("list" in res.data) {
console.log( //console.log(
"SdASD ", // "SdASD ",
res.data.list.map((i) => ({ // res.data.list.map((i) => ({
label: col.optionLabel ? i[col.optionLabel] : i.name, // label: col.optionLabel ? i[col.optionLabel] : i.name,
value: col.optionValue ? i[col.optionValue] : i.id, // value: col.optionValue ? i[col.optionValue] : i.id,
[col.customLabel]: i[col.customLabel], // [col.customLabel]: i[col.customLabel],
})) // }))
); // );
// options // options
this.$set( this.$set(
col, col,
@ -226,13 +226,13 @@ export default {
// //
if ("injectTo" in col) { if ("injectTo" in col) {
console.log("set watcher: ", col.prop); //console.log("set watcher: ", col.prop);
const valueProp = "optionValue" in col ? col.optionValue : "id"; const valueProp = "optionValue" in col ? col.optionValue : "id";
const unwatch = this.$watch( const unwatch = this.$watch(
() => this.dataForm[col.prop], () => this.dataForm[col.prop],
(val) => { (val) => {
console.log("do watcher: ", col.prop); //console.log("do watcher: ", col.prop);
if (col.disableWatcherOnEdit && this.editMode) return; if (col.disableWatcherOnEdit && this.editMode) return;
if (!val) { if (!val) {
col.injectTo.map((item) => { col.injectTo.map((item) => {
@ -248,7 +248,7 @@ export default {
this.$forceUpdate(); this.$forceUpdate();
}); });
} else { } else {
console.log('[x] if ("injectTo" in col) {'); //console.log('[x] if ("injectTo" in col) {');
} }
}, },
{ {
@ -287,14 +287,14 @@ export default {
// //
if ("injectTo" in col && !col.watcher) { if ("injectTo" in col && !col.watcher) {
console.log("set watcher: ", col.prop); //console.log("set watcher: ", col.prop);
const valueProp = "optionValue" in col ? col.optionValue : "id"; const valueProp = "optionValue" in col ? col.optionValue : "id";
const unwatch = this.$watch( const unwatch = this.$watch(
() => this.dataForm[col.prop], () => this.dataForm[col.prop],
(val) => { (val) => {
if (col.disableWatcherOnEdit && this.editMode) return; if (col.disableWatcherOnEdit && this.editMode) return;
console.log("do watcher: ", col.prop); //console.log("do watcher: ", col.prop);
if (!val) { if (!val) {
col.injectTo.map((item) => { col.injectTo.map((item) => {
this.$set(this.dataForm, item[0], null); this.$set(this.dataForm, item[0], null);
@ -309,7 +309,7 @@ export default {
this.$forceUpdate(); this.$forceUpdate();
}); });
} else { } else {
console.log('[x] if ("injectTo" in col) {'); //console.log('[x] if ("injectTo" in col) {');
} }
}, },
{ {
@ -330,16 +330,16 @@ export default {
} }
}); });
console.log("after getData: ", promiseHistory); //console.log("after getData: ", promiseHistory);
}; };
/** 处理函数 */ /** 处理函数 */
const handleFn = (prevProp, anchorField, anchorValue, targetField, col) => { const handleFn = (prevProp, anchorField, anchorValue, targetField, col) => {
console.log("[handleFn]: ", prevProp, anchorField, anchorValue, targetField); //console.log("[handleFn]: ", prevProp, anchorField, anchorValue, targetField);
/** 此时 cachedList 已经确保可用了 */ /** 此时 cachedList 已经确保可用了 */
const target = this.cachedList[prevProp].find((i) => i[anchorField] === anchorValue); const target = this.cachedList[prevProp].find((i) => i[anchorField] === anchorValue);
const param = target ? target[targetField] : ""; const param = target ? target[targetField] : "";
console.log("((( chosenObject )))", target); //console.log("((( chosenObject )))", target);
getData(col, param); getData(col, param);
}; };
@ -358,13 +358,13 @@ export default {
row.forEach((col) => { row.forEach((col) => {
if (col == null) return; if (col == null) return;
if (col.fetchData && typeof col.fetchData === "function" && col.hasPrev) { if (col.fetchData && typeof col.fetchData === "function" && col.hasPrev) {
console.log("[hasPrev] set watcher: ", col.hasPrev); //console.log("[hasPrev] set watcher: ", col.hasPrev);
// - // -
const unwatch = this.$watch( const unwatch = this.$watch(
() => this.dataForm[col.hasPrev], () => this.dataForm[col.hasPrev],
(val) => { (val) => {
console.log("[hasPrev] do watcher: ", col.hasPrev); //console.log("[hasPrev] do watcher: ", col.hasPrev);
if (!val) { if (!val) {
col.injectTo.map((item) => { col.injectTo.map((item) => {
this.$set(this.dataForm, item[0], null); this.$set(this.dataForm, item[0], null);
@ -398,11 +398,11 @@ export default {
if (this.configs.extraFields) if (this.configs.extraFields)
this.configs.extraFields.forEach((cnf) => { this.configs.extraFields.forEach((cnf) => {
if (cnf.listenTo) { if (cnf.listenTo) {
console.log("set watcher for: ", cnf.prop); //console.log("set watcher for: ", cnf.prop);
const unwatch = this.$watch( const unwatch = this.$watch(
() => this.dataForm[cnf.listenTo.prop], () => this.dataForm[cnf.listenTo.prop],
(carId) => { (carId) => {
console.log("do watcher for: ", cnf.prop); //console.log("do watcher for: ", cnf.prop);
if (!carId) return; if (!carId) return;
if (cnf.disableWatcherOnEdit && this.editMode) return; if (cnf.disableWatcherOnEdit && this.editMode) return;
cnf.listenTo.handler.call(this, this.cachedList[cnf.listenTo.prop], carId); cnf.listenTo.handler.call(this, this.cachedList[cnf.listenTo.prop], carId);
@ -439,14 +439,14 @@ export default {
resetSpecificFields(fields) { resetSpecificFields(fields) {
Object.keys(this.dataForm).forEach((key) => { Object.keys(this.dataForm).forEach((key) => {
// console.log(`${key} ${fields}`, key in fields, fields.indexOf(key)) // //console.log(`${key} ${fields}`, key in fields, fields.indexOf(key))
if (fields.indexOf(key) !== -1) { if (fields.indexOf(key) !== -1) {
// console.log(`key ${key} in fields`) // //console.log(`key ${key} in fields`)
// this.dataForm[key] = null; // this.dataForm[key] = null;
this.$set(this.dataForm, key, null); this.$set(this.dataForm, key, null);
} }
}); });
console.log("this.dataform", this.dataForm); //console.log("this.dataform", this.dataForm);
}, },
resetForm(excludeId = false, immediate = false) { resetForm(excludeId = false, immediate = false) {
@ -468,9 +468,9 @@ export default {
/** init **/ /** init **/
init(id, detailMode, tagInfo, extraParams) { init(id, detailMode, tagInfo, extraParams) {
// console.log("[DialogJustForm] init", this.dataForm, id, detailMode); // //console.log("[DialogJustForm] init", this.dataForm, id, detailMode);
if (this.$refs.dataForm) { if (this.$refs.dataForm) {
// console.log("[DialogJustForm] clearing form validation..."); // //console.log("[DialogJustForm] clearing form validation...");
// dialog dataForm [0] // dialog dataForm [0]
this.$refs.dataForm.clearValidate(); this.$refs.dataForm.clearValidate();
} }
@ -481,7 +481,7 @@ export default {
/** 判断 extraParams */ /** 判断 extraParams */
if (extraParams && typeof extraParams === "object") { if (extraParams && typeof extraParams === "object") {
for (const [key, value] of Object.entries(extraParams)) { for (const [key, value] of Object.entries(extraParams)) {
// console.log("[dialog] dataForm | key | value", this.dataForm, key, value); // //console.log("[dialog] dataForm | key | value", this.dataForm, key, value);
this.$set(this.dataForm, key, value); this.$set(this.dataForm, key, value);
} }
} }
@ -514,7 +514,7 @@ export default {
url: file.fileUrl, url: file.fileUrl,
})); }));
} }
// console.log("[DialogJustForm] init():", this.dataForm); // //console.log("[DialogJustForm] init():", this.dataForm);
} else { } else {
this.$message({ this.$message({
message: `${res.code}: ${res.msg}`, message: `${res.code}: ${res.msg}`,
@ -540,7 +540,7 @@ export default {
handleButtonClick(col) { handleButtonClick(col) {
if (!("onClick" in col)) { if (!("onClick" in col)) {
console.log("[handleButtonClick] 配置文件config.js 里没有绑定 onClick"); //console.log("[handleButtonClick] config.js onClick");
return; return;
} }
@ -551,7 +551,7 @@ export default {
handleSelectChange(col, eventValue) { handleSelectChange(col, eventValue) {
if ("autoUpdateProp" in col) { if ("autoUpdateProp" in col) {
// //
// console.log(col.options, eventValue, this.savedDatalist); // //console.log(col.options, eventValue, this.savedDatalist);
const item = this.savedDatalist[col.prop].find((item) => item.id === eventValue); const item = this.savedDatalist[col.prop].find((item) => item.id === eventValue);
this.shadowDataForm[col.autoUpdateProp] = item.cate ?? null; this.shadowDataForm[col.autoUpdateProp] = item.cate ?? null;
} }
@ -559,17 +559,17 @@ export default {
}, },
handleSwitchChange(val) { handleSwitchChange(val) {
console.log("[dialog] switch change: ", val, this.dataForm); //console.log("[dialog] switch change: ", val, this.dataForm);
}, },
handleComponentModelUpdate(propName, { subject, payload: { data } }) { handleComponentModelUpdate(propName, { subject, payload: { data } }) {
this.dataForm[propName] = JSON.stringify(data); this.dataForm[propName] = JSON.stringify(data);
console.log("[DialogJustForm] handleComponentModelUpdate", this.dataForm[propName]); //console.log("[DialogJustForm] handleComponentModelUpdate", this.dataForm[propName]);
}, },
addOrUpdate(method = "POST", url) { addOrUpdate(method = "POST", url) {
if ("parentId" in this.dataForm) { if ("parentId" in this.dataForm) {
console.log("[DialogJustForm parentId]", this.dataForm.parentId); //console.log("[DialogJustForm parentId]", this.dataForm.parentId);
// parentId cascader ["xxx"]xxx // parentId cascader ["xxx"]xxx
const lastItem = this.dataForm.parentId.length - 1; const lastItem = this.dataForm.parentId.length - 1;
this.dataForm.parentId = this.dataForm.parentId[lastItem]; this.dataForm.parentId = this.dataForm.parentId[lastItem];
@ -621,7 +621,7 @@ export default {
data: httpPayload, data: httpPayload,
}) })
.then(({ data: res }) => { .then(({ data: res }) => {
console.log("[add&update] res is: ", res); //console.log("[add&update] res is: ", res);
this.loadingStatus = false; this.loadingStatus = false;
if (res.code === 0) { if (res.code === 0) {
this.$message.success(method === "POST" ? "添加成功" : "更新成功"); this.$message.success(method === "POST" ? "添加成功" : "更新成功");
@ -647,7 +647,7 @@ export default {
}, },
handleBtnClick(payload) { handleBtnClick(payload) {
console.log("btn click payload: ", payload); //console.log("btn click payload: ", payload);
if ("name" in payload) { if ("name" in payload) {
switch (payload.name) { switch (payload.name) {
@ -659,7 +659,7 @@ export default {
break; break;
case "resetSpecific": case "resetSpecific":
// qualityInspectionRecord config // qualityInspectionRecord config
console.log("resetFields", this.resetFields); //console.log("resetFields", this.resetFields);
this.resetSpecificFields(this.resetFields); this.resetSpecificFields(this.resetFields);
break; break;
case "add": case "add":
@ -674,18 +674,18 @@ export default {
break; break;
} }
case "add-car-payload": { case "add-car-payload": {
console.log("edit-car-payload", payload); //console.log("edit-car-payload", payload);
this.addOrUpdate("POST", this.urls.payloadFormUrl); this.addOrUpdate("POST", this.urls.payloadFormUrl);
break; break;
} }
} }
} else { } else {
console.log("[x] 不是这么用的! 缺少name属性"); //console.log("[x] ! name");
} }
}, },
handleUploadChange(file, fileList) { handleUploadChange(file, fileList) {
console.log("[Upload] handleUploadChange...", file, fileList); //console.log("[Upload] handleUploadChange...", file, fileList);
}, },
handleClose() { handleClose() {

View File

@ -95,7 +95,7 @@ export default {
}, },
blenderOrderId() { blenderOrderId() {
const item = this.listQueryExtra.find((item) => item.blenderOrderId); const item = this.listQueryExtra.find((item) => item.blenderOrderId);
console.log("Find blenderOrderId", item); //console.log("Find blenderOrderId", item);
return item ? item.blenderOrderId : null; return item ? item.blenderOrderId : null;
}, },
}, },
@ -104,10 +104,10 @@ export default {
}, },
watch: { watch: {
page: (val) => { page: (val) => {
console.log("page changed:", val); //console.log("page changed:", val);
}, },
size: (val) => { size: (val) => {
console.log("size changed:", val); //console.log("size changed:", val);
}, },
triggerUpdate(val, oldVal) { triggerUpdate(val, oldVal) {
if (val && val !== oldVal) { if (val && val !== oldVal) {
@ -191,7 +191,7 @@ export default {
} }
) )
.then(({ data: res }) => { .then(({ data: res }) => {
console.log("[http response] res is: ", res); //console.log("[http response] res is: ", res);
if (res.code === 0) { if (res.code === 0) {
// page : // page :
@ -240,7 +240,7 @@ export default {
/** 处理 表格操作 */ /** 处理 表格操作 */
handleOperate({ type, data }) { handleOperate({ type, data }) {
console.log("payload", type, data); //console.log("payload", type, data);
// component url // component url
// payload: { type: string, data: string | number | object } // payload: { type: string, data: string | number | object }
switch (type) { switch (type) {
@ -381,7 +381,7 @@ export default {
this.$http this.$http
.post(this.urls.syncUrl) .post(this.urls.syncUrl)
.then(({ data: res }) => { .then(({ data: res }) => {
console.log("同步", res); //console.log("", res);
this.$message({ message: res.msg, type: res.code === 0 ? "success" : "error" }); this.$message({ message: res.msg, type: res.code === 0 ? "success" : "error" });
this.getList(); this.getList();
this.overlayVisible = false; this.overlayVisible = false;

View File

@ -100,7 +100,7 @@ export default {
watch: { watch: {
blenderOrderId: { blenderOrderId: {
handler(val) { handler(val) {
// console.log("blenderOrderId changed", val); // //console.log("blenderOrderId changed", val);
}, },
immediate: true, immediate: true,
}, },

View File

@ -23,11 +23,11 @@ export default {
computed: { computed: {
// id // id
id() { id() {
console.log("computed id", this.$route.query.id || ""); //console.log("computed id", this.$route.query.id || "");
return this.$route.query.id || ""; return this.$route.query.id || "";
}, },
refreshPage() { refreshPage() {
console.log("computed refreshPage"); //console.log("computed refreshPage");
const val = this.$route.query.refreshPage ? Math.random().toString() : null; const val = this.$route.query.refreshPage ? Math.random().toString() : null;
// location.href refreshPage // location.href refreshPage
location.href = location.href.replace(/&refreshPage=[^&]*/, ""); location.href = location.href.replace(/&refreshPage=[^&]*/, "");
@ -50,7 +50,7 @@ export default {
// handler: function (route) { // handler: function (route) {
// if (route.query.id) { // if (route.query.id) {
// this.triggerUpdateKey = Math.random().toString() // this.triggerUpdateKey = Math.random().toString()
// console.log('[$oute changed] val.params.id', route.query.id, this.triggerUpdateKey) // //console.log('[$oute changed] val.params.id', route.query.id, this.triggerUpdateKey)
// } // }
// }, // },
// immediate: true, // immediate: true,
@ -60,7 +60,7 @@ export default {
watch: { watch: {
refreshPage: { refreshPage: {
handler: function (val) { handler: function (val) {
console.log("refreshPage", val); //console.log("refreshPage", val);
if (val) { if (val) {
// this.triggerUpdateKey = Math.random().toString(); // this.triggerUpdateKey = Math.random().toString();
this.triggerUpdateKey = val; this.triggerUpdateKey = val;

View File

@ -86,10 +86,23 @@ export default {
dialogBomCode: "", dialogBomCode: "",
overlayVisible: false, overlayVisible: false,
cachedSearchCondition: {}, cachedSearchCondition: {},
queryParams: {},
}; };
}, },
inject: ["urls"], inject: ["urls"],
mounted() { mounted() {
// listQueryExtra queryParams
if (this.listQueryExtra && Array.isArray(this.listQueryExtra)) {
this.listQueryExtra.map((item) => {
if (typeof item === "string") this.$set(this.queryParams, item, "");
else if (typeof item === "object") {
Object.keys(item).forEach((key) => {
this.$set(this.queryParams, key, item[key]);
});
}
});
}
this.initDataWhenLoad && this.getList(); this.initDataWhenLoad && this.getList();
}, },
methods: { methods: {
@ -104,17 +117,6 @@ export default {
limit: this.size, limit: this.size,
}; };
if (!queryParams && this.listQueryExtra && this.listQueryExtra.length) {
this.listQueryExtra.map((nameOrObj) => {
if (typeof nameOrObj === "string") params[nameOrObj] = "";
else if (typeof nameOrObj === "object") {
Object.keys(nameOrObj).forEach((key) => {
params[key] = nameOrObj[key];
});
}
});
}
// if (this.urls.pageIsPostApi) { // if (this.urls.pageIsPostApi) {
// } else { // } else {
// get page // get page
@ -122,14 +124,18 @@ export default {
this.urls.page, this.urls.page,
this.urls.pageIsPostApi this.urls.pageIsPostApi
? { ? {
...this.queryParams,
...params, ...params,
} }
: { : {
params, params: {
...this.queryParams,
...params
},
} }
) )
.then(({ data: res }) => { .then(({ data: res }) => {
console.log("[http response] res is: ", res); //console.log("[http response] res is: ", res);
if (res.code === 0) { if (res.code === 0) {
// page : // page :
@ -170,7 +176,7 @@ export default {
/** 处理 表格操作 */ /** 处理 表格操作 */
handleOperate({ type, data, toRouter }) { handleOperate({ type, data, toRouter }) {
console.log("payload", type, data); //console.log("payload", type, data);
// component url // component url
// payload: { type: string, data: string | number | object } // payload: { type: string, data: string | number | object }
switch (type) { switch (type) {
@ -253,7 +259,9 @@ export default {
.then(({ data: res }) => { .then(({ data: res }) => {
if (res.code === 0) { if (res.code === 0) {
this.$message({ this.$message({
message: `${type === "detach" ? "下发" : type === "pause-blender" ? "暂停" : "开始"}成功`, message: `${
type === "detach" ? "下发" : type === "pause-blender" ? "暂停" : "开始"
}成功`,
type: "success", type: "success",
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
@ -275,7 +283,7 @@ export default {
}, },
handleBtnClick({ btnName, payload }) { handleBtnClick({ btnName, payload }) {
console.log("[search] form handleBtnClick", btnName, payload); //console.log("[search] form handleBtnClick", btnName, payload);
switch (btnName) { switch (btnName) {
case "新增": case "新增":
this.openDialog(); this.openDialog();
@ -312,7 +320,7 @@ export default {
}); });
} }
}); });
console.log("查询", this.cachedSearchCondition); //console.log("", this.cachedSearchCondition);
this.getList(this.cachedSearchCondition); this.getList(this.cachedSearchCondition);
break; break;
} }

View File

@ -120,7 +120,7 @@ export default {
if (col.delayRequest) delayList.push(col); if (col.delayRequest) delayList.push(col);
// let doRequest = null; // let doRequest = null;
// if (col.fetchData.length) { // if (col.fetchData.length) {
// console.log(`this.bomCode '${this.bomCode}'`); // //console.log(`this.bomCode '${this.bomCode}'`);
// // // //
// doRequest = col.fetchData.bind(this.bomCode); // doRequest = col.fetchData.bind(this.bomCode);
// } else doRequest = col.fetchData; // } else doRequest = col.fetchData;
@ -146,7 +146,7 @@ export default {
})) }))
); );
} else { } else {
console.log("请检查返回的数据类型"); //console.log("");
} }
} else { } else {
col.options.splice(0); col.options.splice(0);
@ -207,7 +207,7 @@ export default {
if (excludeId && key === "id") return; if (excludeId && key === "id") return;
this.dataForm[key] = null; this.dataForm[key] = null;
}); });
console.log("[DialogJustForm resetForm()] clearing form..."); //console.log("[DialogJustForm resetForm()] clearing form...");
this.$refs.dataForm.clearValidate(); this.$refs.dataForm.clearValidate();
this.$emit("dialog-closed"); // this.$emit("dialog-closed"); //
}, },
@ -220,17 +220,17 @@ export default {
// id ID id // id ID id
const { id, code, blender, bomId } = row; const { id, code, blender, bomId } = row;
// console.log(" { id, code, blender } = row;", row); // //console.log(" { id, code, blender } = row;", row);
if (this.$refs.dataForm) { if (this.$refs.dataForm) {
this.$refs.dataForm.clearValidate(); this.$refs.dataForm.clearValidate();
} }
this.delayList.forEach((col) => { this.delayList.forEach((col) => {
// console.log("delay fetch", col); // //console.log("delay fetch", col);
// col // col
if (col.fetchDataParam in row) { if (col.fetchDataParam in row) {
// console.log("delay row ", row, row[col.fetchDataParam]); // //console.log("delay row ", row, row[col.fetchDataParam]);
col.fetchData(row[col.fetchDataParam]).then(({ data: res }) => { col.fetchData(row[col.fetchDataParam]).then(({ data: res }) => {
if (res.code === 0) { if (res.code === 0) {
if ("list" in res.data) { if ("list" in res.data) {
@ -252,7 +252,7 @@ export default {
})) }))
); );
} else { } else {
console.log("请检查返回的数据类型"); //console.log("");
} }
} else { } else {
col.options.splice(0); col.options.splice(0);
@ -274,17 +274,17 @@ export default {
/** handlers */ /** handlers */
handleSelectChange(col, eventValue) { handleSelectChange(col, eventValue) {
// console.log("[dialog] select change: ", col, eventValue); // //console.log("[dialog] select change: ", col, eventValue);
this.$forceUpdate(); this.$forceUpdate();
}, },
handleSwitchChange(val) { handleSwitchChange(val) {
console.log("[dialog] switch change: ", val, this.dataForm); // //console.log("[dialog] switch change: ", val, this.dataForm);
}, },
handleComponentModelUpdate(propName, { subject, payload: { data } }) { handleComponentModelUpdate(propName, { subject, payload: { data } }) {
this.dataForm[propName] = JSON.stringify(data); this.dataForm[propName] = JSON.stringify(data);
console.log("[DialogJustForm] handleComponentModelUpdate", this.dataForm[propName]); // //console.log("[DialogJustForm] handleComponentModelUpdate", this.dataForm[propName]);
}, },
addOrUpdate(method = "POST") { addOrUpdate(method = "POST") {
@ -321,7 +321,7 @@ export default {
}, },
handleBtnClick(payload) { handleBtnClick(payload) {
console.log("btn click payload: ", payload); //console.log("btn click payload: ", payload);
if ("name" in payload) { if ("name" in payload) {
switch (payload.name) { switch (payload.name) {
@ -333,12 +333,12 @@ export default {
break; break;
} }
} else { } else {
console.log("[x] 不是这么用的! 缺少name属性"); //console.log("[x] ! name");
} }
}, },
handleUploadChange(file, fileList) { handleUploadChange(file, fileList) {
console.log("[Upload] handleUploadChange...", file, fileList); //console.log("[Upload] handleUploadChange...", file, fileList);
}, },
handleClose() { handleClose() {

View File

@ -9,7 +9,7 @@ export default function () {
// { prop: "kilnCode", label: "窑炉" }, // { prop: "kilnCode", label: "窑炉" },
{ width: 128, prop: "orderCode", label: "主订单号" }, { width: 128, prop: "orderCode", label: "主订单号" },
{ width: 60, prop: "orderCate", label: "子号" }, { width: 60, prop: "orderCate", label: "子号" },
{ width: 128, prop: "code", label: "混料订单号" }, // { width: 128, prop: "code", label: "混料订单号" },
{ {
width: 80, width: 80,
prop: "percent", prop: "percent",
@ -25,7 +25,7 @@ export default function () {
// { prop: "startTime", label: "开始时间" }, // { prop: "startTime", label: "开始时间" },
// { prop: "shapeCode", label: "砖型" }, // { prop: "shapeCode", label: "砖型" },
{ prop: "bomCode", label: "配方" }, { prop: "bomCode", label: "配方" },
{ prop: "bomName", label: "牌号" }, { width: 180, prop: "bomName", label: "牌号" },
{ width: 60, prop: "ai", label: "版本" }, { width: 60, prop: "ai", label: "版本" },
{ width: 120, prop: "qty", label: "混料总量 [kg]" }, { width: 120, prop: "qty", label: "混料总量 [kg]" },
{ width: 120, prop: "comqty", label: "已完成量 [kg]" }, { width: 120, prop: "comqty", label: "已完成量 [kg]" },
@ -40,7 +40,7 @@ export default function () {
prop: "operations", prop: "operations",
name: "操作", name: "操作",
fixed: "right", fixed: "right",
width: 190, width: 210,
subcomponent: TableOperaionComponent, subcomponent: TableOperaionComponent,
options: [ options: [
{ {
@ -305,7 +305,13 @@ export default function () {
return { return {
dialogConfigs, dialogConfigs,
tableConfig: { tableConfig: {
table: null, // 此处可省略el-table 上的配置项 table: {
"cell-class-name": ({ row, column, rowIndex, columnIndex }) => {
if ("statusDictValue" in row && row.statusDictValue == "2") {
return "cell-in-production";
}
},
},
column: tableProps, // el-column-item 上的配置项 column: tableProps, // el-column-item 上的配置项
}, },
headFormConfigs: { headFormConfigs: {

View File

@ -1,5 +1,6 @@
<template> <template>
<ListViewWithHead <ListViewWithHead
class="highlight-cell"
key="blender-order" key="blender-order"
:table-config="tableConfig" :table-config="tableConfig"
:head-config="headFormConfigs" :head-config="headFormConfigs"
@ -34,4 +35,11 @@ export default {
}; };
</script> </script>
<style scoped></style> <style scoped>
.highlight-cell >>> .cell-in-production {
background: rgba(33, 207, 134, 0.35);
}
.highlight-cell >>> .hover-row .cell-in-production {
background: rgba(33, 207, 134, 0.7);
}
</style>

View File

@ -170,7 +170,7 @@ export default {
} }
) )
.then(({ data: res }) => { .then(({ data: res }) => {
console.log("[http response] res is: ", res); //console.log("[http response] res is: ", res);
if (res.code === 0) { if (res.code === 0) {
// page : // page :
@ -209,7 +209,7 @@ export default {
}, },
handleOperatePress({ type, data, toRouter }) { handleOperatePress({ type, data, toRouter }) {
console.log("payload", type, data); //console.log("payload", type, data);
switch (type) { switch (type) {
case "detach": { case "detach": {
// //
@ -220,8 +220,11 @@ export default {
}).then(() => { }).then(() => {
this.overlayVisible = true; this.overlayVisible = true;
return this.$http return this.$http
.post(this.urls.pressDetach, data /* { id: data } */, { headers: { "Content-Type": "application/json" } }) .post(this.urls.pressDetach, data /* { id: data } */, {
headers: { "Content-Type": "application/json" },
})
.then(({ data: res }) => { .then(({ data: res }) => {
this.overlayVisible = false;
if (res.code === 0) { if (res.code === 0) {
this.$message({ this.$message({
message: `下发成功`, message: `下发成功`,
@ -238,7 +241,6 @@ export default {
duration: 1500, duration: 1500,
}); });
} }
this.overlayVisible = false;
}); });
}); });
} }
@ -247,7 +249,7 @@ export default {
/** 处理 表格操作 */ /** 处理 表格操作 */
handleOperate({ type, data, toRouter }) { handleOperate({ type, data, toRouter }) {
console.log("payload", type, data); //console.log("payload", type, data);
// component url // component url
// payload: { type: string, data: string | number | object } // payload: { type: string, data: string | number | object }
switch (type) { switch (type) {
@ -329,7 +331,9 @@ export default {
.then(({ data: res }) => { .then(({ data: res }) => {
if (res.code === 0) { if (res.code === 0) {
this.$message({ this.$message({
message: `${type === "detach" ? "下发" : type === "pause-blender" ? "暂停" : "开始"}成功`, message: `${
type === "detach" ? "下发" : type === "pause-blender" ? "暂停" : "开始"
}成功`,
type: "success", type: "success",
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
@ -351,7 +355,7 @@ export default {
}, },
handleBtnClick({ btnName, payload }) { handleBtnClick({ btnName, payload }) {
console.log("[search] form handleBtnClick", btnName, payload); //console.log("[search] form handleBtnClick", btnName, payload);
switch (btnName) { switch (btnName) {
case "新增": case "新增":
this.openDialog(); this.openDialog();
@ -388,7 +392,7 @@ export default {
}); });
} }
}); });
console.log("查询", this.cachedSearchCondition); //console.log("", this.cachedSearchCondition);
this.getList(this.cachedSearchCondition); this.getList(this.cachedSearchCondition);
this.getList(this.cachedSearchCondition, "press"); this.getList(this.cachedSearchCondition, "press");
break; break;

View File

@ -120,7 +120,7 @@ export default {
if (col.delayRequest) delayList.push(col); if (col.delayRequest) delayList.push(col);
// let doRequest = null; // let doRequest = null;
// if (col.fetchData.length) { // if (col.fetchData.length) {
// console.log(`this.bomCode '${this.bomCode}'`); // //console.log(`this.bomCode '${this.bomCode}'`);
// // // //
// doRequest = col.fetchData.bind(this.bomCode); // doRequest = col.fetchData.bind(this.bomCode);
// } else doRequest = col.fetchData; // } else doRequest = col.fetchData;
@ -146,7 +146,7 @@ export default {
})) }))
); );
} else { } else {
console.log("请检查返回的数据类型"); //console.log("");
} }
} else { } else {
col.options.splice(0); col.options.splice(0);
@ -207,7 +207,7 @@ export default {
if (excludeId && key === "id") return; if (excludeId && key === "id") return;
this.dataForm[key] = null; this.dataForm[key] = null;
}); });
console.log("[DialogJustForm resetForm()] clearing form..."); //console.log("[DialogJustForm resetForm()] clearing form...");
this.$refs.dataForm.clearValidate(); this.$refs.dataForm.clearValidate();
this.$emit("dialog-closed"); // this.$emit("dialog-closed"); //
}, },
@ -220,17 +220,17 @@ export default {
// id ID id // id ID id
const { id, code, blender, bomId } = row; const { id, code, blender, bomId } = row;
// console.log(" { id, code, blender } = row;", row); // //console.log(" { id, code, blender } = row;", row);
if (this.$refs.dataForm) { if (this.$refs.dataForm) {
this.$refs.dataForm.clearValidate(); this.$refs.dataForm.clearValidate();
} }
this.delayList.forEach((col) => { this.delayList.forEach((col) => {
// console.log("delay fetch", col); // //console.log("delay fetch", col);
// col // col
if (col.fetchDataParam in row) { if (col.fetchDataParam in row) {
// console.log("delay row ", row, row[col.fetchDataParam]); // //console.log("delay row ", row, row[col.fetchDataParam]);
col.fetchData(row[col.fetchDataParam]).then(({ data: res }) => { col.fetchData(row[col.fetchDataParam]).then(({ data: res }) => {
if (res.code === 0) { if (res.code === 0) {
if ("list" in res.data) { if ("list" in res.data) {
@ -252,7 +252,7 @@ export default {
})) }))
); );
} else { } else {
console.log("请检查返回的数据类型"); //console.log("");
} }
} else { } else {
col.options.splice(0); col.options.splice(0);
@ -274,17 +274,17 @@ export default {
/** handlers */ /** handlers */
handleSelectChange(col, eventValue) { handleSelectChange(col, eventValue) {
// console.log("[dialog] select change: ", col, eventValue); // //console.log("[dialog] select change: ", col, eventValue);
this.$forceUpdate(); this.$forceUpdate();
}, },
handleSwitchChange(val) { handleSwitchChange(val) {
console.log("[dialog] switch change: ", val, this.dataForm); //console.log("[dialog] switch change: ", val, this.dataForm);
}, },
handleComponentModelUpdate(propName, { subject, payload: { data } }) { handleComponentModelUpdate(propName, { subject, payload: { data } }) {
this.dataForm[propName] = JSON.stringify(data); this.dataForm[propName] = JSON.stringify(data);
console.log("[DialogJustForm] handleComponentModelUpdate", this.dataForm[propName]); //console.log("[DialogJustForm] handleComponentModelUpdate", this.dataForm[propName]);
}, },
addOrUpdate(method = "POST") { addOrUpdate(method = "POST") {
@ -321,7 +321,7 @@ export default {
}, },
handleBtnClick(payload) { handleBtnClick(payload) {
console.log("btn click payload: ", payload); //console.log("btn click payload: ", payload);
if ("name" in payload) { if ("name" in payload) {
switch (payload.name) { switch (payload.name) {
@ -333,12 +333,12 @@ export default {
break; break;
} }
} else { } else {
console.log("[x] 不是这么用的! 缺少name属性"); //console.log("[x] ! name");
} }
}, },
handleUploadChange(file, fileList) { handleUploadChange(file, fileList) {
console.log("[Upload] handleUploadChange...", file, fileList); //console.log("[Upload] handleUploadChange...", file, fileList);
}, },
handleClose() { handleClose() {

View File

@ -9,11 +9,19 @@ export default function () {
{ width: 160, prop: "orderCode", label: "主订单号" }, { width: 160, prop: "orderCode", label: "主订单号" },
{ width: 60, prop: "orderCate", label: "子号" }, { width: 60, prop: "orderCate", label: "子号" },
{ width: 160, prop: "code", label: "混料订单号" }, { width: 160, prop: "code", label: "混料订单号" },
{ width: 60, prop: "percent", label: "进度", filter: (val) => (val !== null && val !== undefined ? val + " %" : "-") }, {
width: 60,
prop: "percent",
label: "进度",
filter: (val) => (val !== null && val !== undefined ? val + " %" : "-"),
},
{ {
prop: "statusDictValue", prop: "statusDictValue",
label: "订单状态", label: "订单状态",
filter: (val) => (val !== null && val !== undefined ? ["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝", "已下发"][val] : "-"), filter: (val) =>
val !== null && val !== undefined
? ["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝", "已下发"][val]
: "-",
}, },
{ prop: "bomCode", label: "配方" }, { prop: "bomCode", label: "配方" },
{ width: 120, prop: "qty", label: "混料总量 [kg]" }, { width: 120, prop: "qty", label: "混料总量 [kg]" },
@ -25,20 +33,30 @@ export default function () {
prop: "operations", prop: "operations",
name: "操作", name: "操作",
fixed: "right", fixed: "right",
width: 180, width: 196,
subcomponent: TableOperaionComponent, subcomponent: TableOperaionComponent,
options: [ options: [
{ {
name: "edit", label: "编辑", emitFull: true, icon: 'edit-outline', enable: injectData => { name: "edit",
const v = injectData.statusDictValue label: "编辑",
if (v && +v === 1) return true emitFull: true,
return false icon: "edit-outline",
} enable: (injectData) => {
const v = injectData.statusDictValue;
if (v && +v === 1) return true;
return false;
}, },
{ name: "view-batch", label: "查看批次", color: "#ff8000", toRouter: 'pms-blenderBatch', icon: 'document-copy' }, // 路由跳转至 pms-blenderBatch },
{ name: "pause-blender", label: "暂停", color: "#f10000", icon: 'video-pause' }, {
{ name: "start-blender", label: "开始", color: "#0b58ff", icon: 'video-play' }, name: "view-batch",
{ name: "detach", label: "下发", color: "#099", icon: 'bottom-right' }, label: "查看批次",
color: "#ff8000",
toRouter: "pms-blenderBatch",
icon: "document-copy",
}, // 路由跳转至 pms-blenderBatch
{ name: "pause-blender", label: "暂停", color: "#f10000", icon: "video-pause" },
{ name: "start-blender", label: "开始", color: "#0b58ff", icon: "video-play" },
{ name: "detach", label: "下发", color: "#099", icon: "bottom-right" },
], ],
}, },
]; ];
@ -48,8 +66,20 @@ export default function () {
{ width: 160, prop: "orderCode", label: "主订单号" }, { width: 160, prop: "orderCode", label: "主订单号" },
{ width: 60, prop: "orderCate", label: "子号" }, { width: 60, prop: "orderCate", label: "子号" },
{ width: 160, prop: "code", label: "压制订单号" }, { width: 160, prop: "code", label: "压制订单号" },
{ width: 60, prop: "percent", label: "进度", filter: (val) => (val !== null && val !== undefined ? val + " %" : "-") }, {
{ prop: "statusDictValue", label: "订单状态", filter: (val) => (val !== null && val !== undefined ? ["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝", "已下发"][val] : "-"), }, width: 60,
prop: "percent",
label: "进度",
filter: (val) => (val !== null && val !== undefined ? val + " %" : "-"),
},
{
prop: "statusDictValue",
label: "订单状态",
filter: (val) =>
val !== null && val !== undefined
? ["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝", "已下发"][val]
: "-",
},
{ prop: "startTime", label: "开始时间" }, { prop: "startTime", label: "开始时间" },
{ width: 100, prop: "shapeCode", label: "砖型" }, { width: 100, prop: "shapeCode", label: "砖型" },
{ prop: "pressCode", label: "压机" }, { prop: "pressCode", label: "压机" },
@ -64,11 +94,10 @@ export default function () {
fixed: "right", fixed: "right",
width: 80, width: 80,
subcomponent: TableOperaionComponent, subcomponent: TableOperaionComponent,
options: [{ name: 'detach', label: '下发', icon: 'bottom-right' }] options: [{ name: "detach", label: "下发", icon: "bottom-right" }],
}, },
]; ];
const headFormFields = [ const headFormFields = [
{ {
prop: "code", prop: "code",
@ -109,8 +138,8 @@ export default function () {
[ [
{ {
forceDisabled: true, forceDisabled: true,
prop: 'code', prop: "code",
label: '混料订单号' label: "混料订单号",
}, },
], ],
[ [
@ -119,10 +148,11 @@ export default function () {
label: "配方", label: "配方",
prop: "bomId", prop: "bomId",
options: [], options: [],
optionLabelProp: 'code', optionLabelProp: "code",
/** ====== */ /** ====== */
fetchData: (bomCode) => this.$http.get('/pms/bom/pageVersion', { params: { key: bomCode, limit: 999, page: 1 } }), fetchData: (bomCode) =>
fetchDataParam: 'bomCode', this.$http.get("/pms/bom/pageVersion", { params: { key: bomCode, limit: 999, page: 1 } }),
fetchDataParam: "bomCode",
delayRequest: true, delayRequest: true,
/** ====== */ /** ====== */
rules: { required: true, message: "必填项不能为空", trigger: "blur" }, rules: { required: true, message: "必填项不能为空", trigger: "blur" },
@ -135,8 +165,9 @@ export default function () {
label: "混料机", label: "混料机",
prop: "blender", prop: "blender",
options: [], options: [],
optionLabelProp: 'code', optionLabelProp: "code",
fetchData: () => this.$http.get('/pms/equipment/list', { params: { workSequenceName: '混料工序' } }), fetchData: () =>
this.$http.get("/pms/equipment/list", { params: { workSequenceName: "混料工序" } }),
rules: { required: true, message: "必填项不能为空", trigger: "blur" }, rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { clearable: true, filterable: true, placeholder: "请选择混料机" }, elparams: { clearable: true, filterable: true, placeholder: "请选择混料机" },
}, },
@ -146,18 +177,30 @@ export default function () {
{ name: "add", label: "保存", type: "primary", permission: "", showOnEdit: false }, { name: "add", label: "保存", type: "primary", permission: "", showOnEdit: false },
{ name: "update", label: "更新", type: "primary", permission: "", showOnEdit: true }, { name: "update", label: "更新", type: "primary", permission: "", showOnEdit: true },
// { name: "reset", label: "重置", type: "warning", showAlways: true }, // { name: "reset", label: "重置", type: "warning", showAlways: true },
] ],
}, },
}; };
return { return {
dialogConfigs, dialogConfigs,
tableConfig: { tableConfig: {
table: null, table: {
"cell-class-name": ({ row, column, rowIndex, columnIndex }) => {
if ("statusDictValue" in row && row.statusDictValue == "2") {
return "cell-in-production";
}
},
},
column: tableProps, column: tableProps,
}, },
pressTableConfig: { pressTableConfig: {
table: null, table: {
"cell-class-name": ({ row, column, rowIndex, columnIndex }) => {
if ("statusDictValue" in row && row.statusDictValue == "2") {
return "cell-in-production";
}
},
},
column: pressTableProps, column: pressTableProps,
}, },
headFormConfigs: { headFormConfigs: {
@ -171,7 +214,7 @@ export default function () {
pauseBlender: "/pms/trans/blenderPause", pauseBlender: "/pms/trans/blenderPause",
startBlender: "/pms/trans/blenderStart", startBlender: "/pms/trans/blenderStart",
pageIsPostApi: true, // 使用post接口来获取page数据极少用目前基本上只有工艺管理模块里在用 pageIsPostApi: true, // 使用post接口来获取page数据极少用目前基本上只有工艺管理模块里在用
changeBlender: '/pms/order/changeBlender', changeBlender: "/pms/order/changeBlender",
pressPage: "/pms/pressOrder/pageView", pressPage: "/pms/pressOrder/pageView",
pressDetach: "/pms/trans/pressDeli", pressDetach: "/pms/trans/pressDeli",
}, },

View File

@ -1,12 +1,12 @@
<template> <template>
<ListViewWithHead <ListViewWithHead
class="highlight-cell"
key="blender-order" key="blender-order"
:table-config="tableConfig" :table-config="tableConfig"
:press-table-config="pressTableConfig" :press-table-config="pressTableConfig"
:head-config="headFormConfigs" :head-config="headFormConfigs"
:dialog-configs="dialogConfigs" :dialog-configs="dialogConfigs"
:list-query-extra="[]" :list-query-extra="[]" />
/>
</template> </template>
<script> <script>
@ -37,4 +37,11 @@ export default {
}; };
</script> </script>
<style scoped></style> <style scoped>
.highlight-cell >>> .cell-in-production {
background: rgba(33, 207, 134, 0.35);
}
.highlight-cell >>> .hover-row .cell-in-production {
background: rgba(33, 207, 134, 0.7);
}
</style>

View File

@ -63,10 +63,13 @@ export default function () {
}, },
{ {
button: { button: {
type: "plain", type: "success",
name: "导入", name: "导入",
permission: "", permission: "",
}, },
bind: {
plain: true,
},
}, },
// { // {
// button: { // button: {

View File

@ -15,7 +15,7 @@ const syncTimeComponent = {
return {} return {}
}, },
mounted() { mounted() {
console.log('syncTimeComponent mounted', this.injectData) //console.log('syncTimeComponent mounted', this.injectData)
}, },
render: function (h) { render: function (h) {
return h('div', { return h('div', {

View File

@ -40,7 +40,7 @@ export default {
handler: function (route) { handler: function (route) {
if (route.query.code) { if (route.query.code) {
this.triggerUpdateKey = Math.random().toString(); this.triggerUpdateKey = Math.random().toString();
console.log("[$oute changed] val.query.name", route.query.code, this.triggerUpdateKey); //console.log("[$oute changed] val.query.name", route.query.code, this.triggerUpdateKey);
} }
}, },
immediate: true, immediate: true,

View File

@ -155,12 +155,12 @@ export default {
}, },
async getTechDetailInfo() { async getTechDetailInfo() {
console.log("[getTechDetailInfo] this.techId: ", this.techId); //console.log("[getTechDetailInfo] this.techId: ", this.techId);
// dataForm // dataForm
try { try {
const { data: res } = await this.$http.get(`/pms/equipmentTech/${this.techId}`); const { data: res } = await this.$http.get(`/pms/equipmentTech/${this.techId}`);
if (res.code == 0) { if (res.code == 0) {
// console.log('[getTechDetailInfo] res.data: ', res.data) // //console.log('[getTechDetailInfo] res.data: ', res.data)
// return; // return;
this.$set(this.dataForm, "code", res.data.code); this.$set(this.dataForm, "code", res.data.code);
this.$set(this.dataForm, "remark", res.data.remark); this.$set(this.dataForm, "remark", res.data.remark);
@ -179,7 +179,7 @@ export default {
try { try {
const { data: res } = await this.$http.get("/pms/equipmentTechParam/page", { params }); const { data: res } = await this.$http.get("/pms/equipmentTechParam/page", { params });
if (res.code == 0) { if (res.code == 0) {
console.log("[getTechDetailList] res.data: ", res.data); //console.log("[getTechDetailList] res.data: ", res.data);
this.dataList = res.data.list; this.dataList = res.data.list;
this.total = res.data.total; this.total = res.data.total;
} }
@ -189,7 +189,7 @@ export default {
}, },
handleTabClick(v) { handleTabClick(v) {
// console.log("handleTabClick: ", v); // //console.log("handleTabClick: ", v);
}, },
handleOperate() {}, handleOperate() {},

View File

@ -108,7 +108,7 @@ export default {
page: 1, page: 1,
}); });
if (res.code == 0) { if (res.code == 0) {
console.log("res", res); //console.log("res", res);
this.techList = res.data.list.map((item) => { this.techList = res.data.list.map((item) => {
return { return {
label: item.code, label: item.code,

View File

@ -91,7 +91,7 @@ export default {
params, params,
}) })
.then(({ data: res }) => { .then(({ data: res }) => {
console.log("[http response] res is: ", res); //console.log("[http response] res is: ", res);
if (res.code === 0) { if (res.code === 0) {
if ("list" in res.data) { if ("list" in res.data) {
@ -127,7 +127,7 @@ export default {
}, },
handleBtnClick({ btnName, payload }) { handleBtnClick({ btnName, payload }) {
console.log("[search] form handleBtnClick", btnName, payload); //console.log("[search] form handleBtnClick", btnName, payload);
switch (btnName) { switch (btnName) {
case "查询": case "查询":
this.getList({ ...payload }); this.getList({ ...payload });
@ -136,7 +136,7 @@ export default {
}, },
handleDestroy(type, refresh) { handleDestroy(type, refresh) {
console.log("[handleDestroy] ", type); //console.log("[handleDestroy] ", type);
switch (type) { switch (type) {
case "edit": case "edit":
this.editVisible = false; this.editVisible = false;
@ -151,7 +151,7 @@ export default {
}, },
handleOperate({ type, data }) { handleOperate({ type, data }) {
console.log("payload", type, data); //console.log("payload", type, data);
switch (type) { switch (type) {
case "delete": { case "delete": {
// prompt // prompt
@ -197,7 +197,7 @@ export default {
.catch((err) => {}); .catch((err) => {});
} }
case "edit": { case "edit": {
console.log("[edit] ", data); //console.log("[edit] ", data);
this.editVisible = true; this.editVisible = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.edit.init({ this.$refs.edit.init({
@ -211,7 +211,7 @@ export default {
break; break;
} }
case "view-detail-action": { case "view-detail-action": {
console.log("[detail] ", data, data.techId); //console.log("[detail] ", data, data.techId);
if (!data || !data.techId) { if (!data || !data.techId) {
this.$message.warning("暂无详请可供查看"); this.$message.warning("暂无详请可供查看");
return; return;

View File

@ -7,21 +7,21 @@ export default function () {
const tableProps = [ const tableProps = [
{ type: "index", label: "序号" }, { type: "index", label: "序号" },
// { prop: "updateTime", label: "上料时间", filter: timeFilter }, // { prop: "updateTime", label: "上料时间", filter: timeFilter },
{ prop: "materialName", label: "原料" }, { width: 100, prop: "materialName", label: "原料" },
// { prop: "material", label: "原料编码" }, // { prop: "material", label: "原料编码" },
{ prop: "qty", label: "上料量" }, { width: 90, prop: "qty", label: "上料量[kg]", filter: val => (val != null) ? (+val).toFixed(0) : '-' },
{ prop: "siloName1", label: "上料料仓1" }, { width: 100, prop: "siloName1", label: "上料料仓1" },
{ prop: "siloName2", label: "上料料仓2" }, { width: 100, prop: "siloName2", label: "上料料仓2" },
{ prop: "siloName3", label: "上料料仓3" }, { width: 100, prop: "siloName3", label: "上料料仓3" },
{ prop: "startTime", label: "开始上料时间", filter: timeFilter }, { width: 256, prop: "startTime", label: "开始上料时间", filter: timeFilter },
{ prop: "endTime", label: "结束上料时间", filter: timeFilter }, { width: 256, prop: "endTime", label: "结束上料时间", filter: timeFilter },
{ prop: "silo1Change", label: "料仓1变化" }, { width: 128, prop: "silo1Change", label: "料仓1变化[kg]", filter: val => (val != null) ? (+val).toFixed(0) : '-' },
{ prop: "silo2Change", label: "料仓2变化" }, { width: 128, prop: "silo2Change", label: "料仓2变化[kg]", filter: val => (val != null) ? (+val).toFixed(0) : '-' },
{ prop: "silo3Change", label: "料仓3变化" }, { width: 128, prop: "silo3Change", label: "料仓3变化[kg]", filter: val => (val != null) ? (+val).toFixed(0) : '-' },
{ prop: "statusDictValue", label: "破碎作业", filter: (val) => ["正常停止", "废除"][val] ?? "-" }, // { width: 128, prop: "statusDictValue", label: "破碎作业", filter: (val) => ["正常停止", "废除"][val] ?? "-" },
// { prop: "description", label: "描述" }, // { prop: "description", label: "描述" },
{ prop: "remark", label: "备注" }, { width: 128, prop: "remark", label: "备注" },
{ prop: "createTime", label: "添加时间", filter: timeFilter }, // { width: 256, prop: "createTime", label: "添加时间", filter: timeFilter },
{ {
prop: "operations", prop: "operations",
name: "操作", name: "操作",
@ -60,7 +60,9 @@ export default function () {
} }
}; };
const now = new Date().getTime(); const now = new Date()
const [y, m, d] = [now.getFullYear(), now.getMonth(), now.getDate()]
const today = new Date(y, m, d, 0, 0, 0, 0).getTime()
const headFormFields = [ const headFormFields = [
{ {
prop: "material", prop: "material",
@ -96,7 +98,7 @@ export default function () {
"start-placeholder": "开始时间", "start-placeholder": "开始时间",
"end-placeholder": "结束时间", "end-placeholder": "结束时间",
}, },
default: { value: [now - 3600 * 24 * 7 * 1000, now] }, default: { value: [today - 3600 * 24 * 1000 * 7, today + 3600 * 1000 * 24] },
}, },
{ {
button: { button: {

View File

@ -9,19 +9,19 @@ export default function () {
// { prop: "updateTime", label: "上料时间", filter: timeFilter }, // { prop: "updateTime", label: "上料时间", filter: timeFilter },
{ prop: "materialName", label: "原料" }, { prop: "materialName", label: "原料" },
// { prop: "material", label: "原料编码" }, // { prop: "material", label: "原料编码" },
{ prop: "qty", label: "计划上料量" }, { prop: "qty", label: "计划上料量[kg]", filter: val => (val != null) ? (+val).toFixed(0) : '-' },
{ prop: "siloName1", label: "上料料仓" }, { prop: "siloName1", label: "上料料仓" },
// { prop: "siloName2", label: "上料料仓2" }, // { prop: "siloName2", label: "上料料仓2" },
// { prop: "siloName3", label: "上料料仓3" }, // { prop: "siloName3", label: "上料料仓3" },
{ prop: "startTime", label: "开始上料时间", filter: timeFilter }, { prop: "startTime", label: "开始上料时间", filter: timeFilter },
{ prop: "endTime", label: "结束上料时间", filter: timeFilter }, { prop: "endTime", label: "结束上料时间", filter: timeFilter },
{ prop: "silo1Change", label: "料仓变化" }, { prop: "silo1Change", label: "料仓变化[kg]", filter: val => (val != null) ? (+val).toFixed(0) : '-' },
// { prop: "silo2Change", label: "料仓2变化" }, // { prop: "silo2Change", label: "料仓2变化" },
// { prop: "silo3Change", label: "料仓3变化" }, // { prop: "silo3Change", label: "料仓3变化" },
{ prop: "statusDictValue", label: "破碎作业", filter: (val) => ["正常停止", "废除"][val] ?? "-" }, // { prop: "statusDictValue", label: "破碎作业", filter: (val) => ["正常停止", "废除"][val] ?? "-" },
// { prop: "description", label: "描述" }, // { prop: "description", label: "描述" },
{ prop: "remark", label: "备注" }, { prop: "remark", label: "备注" },
{ prop: "createTime", label: "添加时间", filter: timeFilter }, // { prop: "createTime", label: "添加时间", filter: timeFilter },
{ {
prop: "operations", prop: "operations",
name: "操作", name: "操作",
@ -60,15 +60,19 @@ export default function () {
} }
}; };
const now = new Date().getTime(); const now = new Date();
const [y, m, d] = [now.getFullYear(), now.getMonth(), now.getDate()];
const today = new Date(y, m, d, 0, 0, 0, 0).getTime();
const headFormFields = [ const headFormFields = [
{ {
prop: "material", prop: "material",
label: "按原料搜索", label: "按原料搜索",
// input: true, // input: true,
select: [], complexSelect: [],
fieldOptionValue: "name", // 把料仓筛选条件的label改为展示code而不是展示name fieldOptionLabel: 'code',
fieldOptionValue: "code", // 把料仓筛选条件的label改为展示code而不是展示name
default: { value: "" }, default: { value: "" },
customLabels: ["description", "name"],
fn: () => this.$http.get("/pms/material/page", { params: { page: 1, limit: 999 } }), fn: () => this.$http.get("/pms/material/page", { params: { page: 1, limit: 999 } }),
bind: { bind: {
placeholder: "请输入原料名", placeholder: "请输入原料名",
@ -96,7 +100,7 @@ export default function () {
"start-placeholder": "开始时间", "start-placeholder": "开始时间",
"end-placeholder": "结束时间", "end-placeholder": "结束时间",
}, },
default: { value: [now - 3600 * 24 * 7 * 1000, now] }, default: { value: [today - 24 * 7 * 1000 * 3600, today + 3600 * 24 * 1000] },
}, },
{ {
button: { button: {

View File

@ -65,7 +65,14 @@ const DIALOG_CARPAYLOAD = "DialogCarPayload";
export default { export default {
name: "ListViewWithHead", name: "ListViewWithHead",
components: { BaseSearchForm, BaseListTable, DialogWithMenu, DialogJustForm, DialogCarPayload, TemperatureDialog }, components: {
BaseSearchForm,
BaseListTable,
DialogWithMenu,
DialogJustForm,
DialogCarPayload,
TemperatureDialog,
},
props: { props: {
tableConfig: { tableConfig: {
type: Object, type: Object,
@ -109,7 +116,7 @@ export default {
}, },
}, },
activated() { activated() {
console.log("list view with ehad activated..........", this.triggerUpdate); //console.log("list view with ehad activated..........", this.triggerUpdate);
this.refreshLayoutKey = this.layoutTable(); this.refreshLayoutKey = this.layoutTable();
}, },
watch: { watch: {
@ -141,9 +148,9 @@ export default {
}; };
}, },
inject: ["urls"], inject: ["urls"],
mounted() { // mounted() {
this.initDataWhenLoad && this.getList(); // this.initDataWhenLoad && this.getList();
}, // },
methods: { methods: {
/** 获取 列表数据 */ /** 获取 列表数据 */
getList(queryParams) { getList(queryParams) {
@ -170,6 +177,7 @@ export default {
// if (this.urls.pageIsPostApi) { // if (this.urls.pageIsPostApi) {
// } else { // } else {
// get page // get page
// console.log("params: ", params);
this.$http[this.urls.pageIsPostApi ? "post" : "get"]( this.$http[this.urls.pageIsPostApi ? "post" : "get"](
this.urls.page, this.urls.page,
this.urls.pageIsPostApi this.urls.pageIsPostApi
@ -181,7 +189,7 @@ export default {
} }
) )
.then(({ data: res }) => { .then(({ data: res }) => {
console.log("[http response] res is: ", res); //console.log("[http response] res is: ", res);
if (res.code === 0) { if (res.code === 0) {
// page : // page :
@ -231,7 +239,7 @@ export default {
/** 处理 表格操作 */ /** 处理 表格操作 */
handleOperate({ type, data }) { handleOperate({ type, data }) {
console.log("payload", type, data); //console.log("payload", type, data);
// component url // component url
// payload: { type: string, data: string | number | object } // payload: { type: string, data: string | number | object }
switch (type) { switch (type) {
@ -304,7 +312,7 @@ export default {
break; break;
} }
case "status": { case "status": {
console.log("status", data); //console.log("status", data);
// TODO: // TODO:
const { id, code } = data; const { id, code } = data;
const queryCondition = { id, code }; const queryCondition = { id, code };
@ -333,7 +341,7 @@ export default {
break; break;
} }
case "to-bom-detail": { case "to-bom-detail": {
// console.log('to-bom-detail', data.name) // //console.log('to-bom-detail', data.name)
// //
return this.$router.push({ return this.$router.push({
name: "pms-bomDetails", name: "pms-bomDetails",
@ -394,7 +402,7 @@ export default {
}); });
} }
case "preview": { case "preview": {
console.log("[PREVIEW] data", data); //console.log("[PREVIEW] data", data);
// report preview // report preview
return this.$router.push({ return this.$router.push({
name: "pms-reportPreview", name: "pms-reportPreview",
@ -404,7 +412,7 @@ export default {
}); });
} }
case "design": { case "design": {
console.log("[DESIGN] data", data); //console.log("[DESIGN] data", data);
// report design // report design
return this.$router.push({ return this.$router.push({
name: "pms-reportDesign", name: "pms-reportDesign",
@ -415,7 +423,9 @@ export default {
} }
case "detach": { case "detach": {
return this.$http return this.$http
.post(this.urls.detach, data /* { id: data } */, { headers: { "Content-Type": "application/json" } }) .post(this.urls.detach, data /* { id: data } */, {
headers: { "Content-Type": "application/json" },
})
.then(({ data: res }) => { .then(({ data: res }) => {
if (res.code === 0) { if (res.code === 0) {
this.$message({ this.$message({
@ -470,7 +480,7 @@ export default {
}, },
handleBtnClick({ btnName, payload }) { handleBtnClick({ btnName, payload }) {
console.log("[search] form handleBtnClick", btnName, payload); //console.log("[search] form handleBtnClick", btnName, payload);
switch (btnName) { switch (btnName) {
case "新增": case "新增":
this.openDialog(); this.openDialog();
@ -512,7 +522,7 @@ export default {
}); });
} }
}); });
console.log("查询", this.cachedSearchCondition); //console.log("", this.cachedSearchCondition);
this.getList(this.cachedSearchCondition); this.getList(this.cachedSearchCondition);
break; break;
} }
@ -551,7 +561,7 @@ export default {
}); });
} }
this.$nextTick(() => { this.$nextTick(() => {
console.log(`[edit-dialog] extraParams: ${extraParams}`); //console.log(`[edit-dialog] extraParams: ${extraParams}`);
this.$refs["edit-dialog"].init(/** some args... */ row_id, detail_mode, tag_info, extraParams); this.$refs["edit-dialog"].init(/** some args... */ row_id, detail_mode, tag_info, extraParams);
}); });
}, },

View File

@ -2,18 +2,57 @@ const colors = {
line: '#555' line: '#555'
} }
export default (x_data, y_data) => ({ export default ({ x_data, y_data }, graph2) => {
// debugger;
return {
title: { title: {
text: "窑车温度", text: "窑车温度",
}, },
grid: {
show: true, legend: {
top: 96, icon: 'circle',
left: 52, top: 280,
right: 32, left: 'center',
bottom: 24, itemHeight: 8,
itemWidth: 8
}, },
xAxis: {
tooltip: {
show: true,
trigger: 'axis',
formatter: function (params) {
// debugger;
return `<span>位置${params[0].name}</span>` + params.map(item => {
return item.value ? `<div style="min-width: 180px; display: flex; justify-content: space-between;"><span>${item.seriesName}</span><span style="color: #888">${item.value}${item.seriesName == 'lambda' ? '' : item.seriesName == '温度' ? '℃' : 'm³'}</span></div>` : ''
}).join('')
}
// formatter:
// '<strong style="font-size: 16px">位置</strong> ({b}) <span style="font-size: 16px; font-weight: bold;">{c}</span> ℃'
},
grid: [
{
id: 'temp-grid',
top: 72,
left: 56,
right: 56,
bottom: 24,
height: 180,
},
{
id: 'lambda-grid',
top: 320,
left: 56,
right: 56,
bottom: 24,
height: 180,
}
],
xAxis: [
{
gridIndex: 0,
id: 'temp-x-axis',
type: "category", type: "category",
data: Array(65) data: Array(65)
.fill(1) .fill(1)
@ -26,15 +65,34 @@ export default (x_data, y_data) => ({
}, },
}, },
}, },
yAxis: { {
gridIndex: 1,
id: 'lambda-x-axis',
data: Array(65)
.fill(1)
.map((val, index) => {
return val + index;
}),
axisLine: {
lineStyle: {
color: colors.line
}
}
}
],
yAxis: [
{
gridIndex: 0,
type: "value", type: "value",
interval: 20,
name: "温度", name: "温度",
nameTextStyle: { nameTextStyle: {
fontSize: 18, fontSize: 14,
align: "right", align: "right",
verticalAlign: "bottom", verticalAlign: "bottom",
lineHeight: 36, lineHeight: 20,
padding: 10, padding: 6,
}, },
axisLine: { axisLine: {
show: true, show: true,
@ -46,25 +104,107 @@ export default (x_data, y_data) => ({
formatter: '{value} ℃' formatter: '{value} ℃'
}, },
splitLine: { splitLine: {
show: false,
lineStyle: { lineStyle: {
color: '#ddd' color: '#ddd'
} }
}, },
}, },
tooltip: { {
trigger: 'axis', gridIndex: 1,
formatter: '<strong style="font-size: 16px">位置</strong> ({b}) <span style="font-size: 16px; font-weight: bold;">{c}</span> ℃' type: "value",
interval: 20,
name: "消耗量",
nameTextStyle: {
fontSize: 14,
align: "right",
verticalAlign: "bottom",
lineHeight: 20,
padding: 6,
}, },
axisLine: {
show: true,
lineStyle: {
color: colors.line,
},
},
axisLabel: {
formatter: '{value} m³'
},
splitLine: {
lineStyle: {
color: '#ddd'
}
},
},
{
gridIndex: 0,
type: "value",
name: "lambda",
nameTextStyle: {
fontSize: 14,
align: "left",
verticalAlign: "bottom",
lineHeight: 20,
padding: 6,
},
axisLine: {
show: true,
lineStyle: {
color: colors.line,
},
},
axisLabel: {
formatter: '{value}'
},
splitLine: {
lineStyle: {
color: '#ddd'
}
},
}
],
dataZoom: { dataZoom: {
type: 'inside' type: 'inside'
}, },
series: [ series: [
{ {
id: 'temp-series',
name: '温度',
data: y_data, data: y_data,
xAxisIndex: 0,
yAxisIndex: 0,
// data: Array(65)
// .fill(1)
// .map((val) => Math.floor(Math.random() * 1000)),
type: "line",
},
{
id: 'gas-series',
name: '燃气消耗量(m³)',
xAxisIndex: 1,
yAxisIndex: 1,
data: graph2?.gas || [],
// data: Array(65)
// .fill(1)
// .map((val) => Math.floor(Math.random() * 128)),
type: "line",
},
{
id: 'lambda-series',
name: 'lambda',
// data: [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 33, 11, 21, 3, 5, 67, 8, 88, 90, 12, 32, 2, 31, 33, null, null],
data: [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, ...(graph2?.lambda || []), null, null],
xAxisIndex: 0,
yAxisIndex: 2,
// data: Array(65) // data: Array(65)
// .fill(1) // .fill(1)
// .map((val) => Math.floor(Math.random() * 1000)), // .map((val) => Math.floor(Math.random() * 1000)),
type: "line", type: "line",
}, },
], ],
}) }
}

View File

@ -8,7 +8,8 @@ export default [
{ width: 60, prop: "code", label: "位置" }, { width: 60, prop: "code", label: "位置" },
{ width: 60, prop: "temp1", label: "温度" }, { width: 60, prop: "temp1", label: "温度" },
{ width: 80, prop: "press1", label: "窑内压力" }, { width: 80, prop: "press1", label: "窑内压力" },
{ width: 80, prop: "press2", label: "车下压力" }, { width: 128, prop: "press2", label: "燃气消耗量(m3)" },
{ prop: "remark", label: "lambda" },
{ prop: "createTime", label: "时间", filter: timeFilter }, { prop: "createTime", label: "时间", filter: timeFilter },
// { prop: "endTime", label: "结束时间", filter: timeFilter }, // { prop: "endTime", label: "结束时间", filter: timeFilter },
// { // {

View File

@ -3,15 +3,14 @@
:visible="visible" :visible="visible"
title="烧制温度" title="烧制温度"
class="temperature-dialog" class="temperature-dialog"
width="80%" width="90%"
@close="handleClose" @close="handleClose"
:destroy-on-close="false" :destroy-on-close="false"
:close-on-click-modal="false" :close-on-click-modal="false">
>
<div class="data-list"> <div class="data-list">
<BaseListTable <BaseListTable
v-loading="tableLoading" v-loading="tableLoading"
style="height: 85%" style="height: 90%"
:table-config="{ height: '100%' }" :table-config="{ height: '100%' }"
:column-config="tableConfig" :column-config="tableConfig"
:table-data="dataList" :table-data="dataList"
@ -30,8 +29,9 @@
:total="totalPage" :total="totalPage"
layout="total, sizes, prev, pager, next, jumper"></el-pagination> layout="total, sizes, prev, pager, next, jumper"></el-pagination>
</div> </div>
<div class="temp-chart" style="height: 300px;"> <div class="temp-chart" style="height: 100%; overflow: hidden">
<div id="temp-chart" class="temp-chart__inner" style="height: 100%;" /> <div id="temp-chart" class="temp-chart__inner" style="height: 100%" />
<!-- <div id="lambda-chart" class="lambda-chart__inner" style="height: 50%; background: #f001;" /> -->
</div> </div>
</el-dialog> </el-dialog>
</template> </template>
@ -80,6 +80,50 @@ export default {
}); });
}, },
getList() { getList() {
// this.dataList = [
// {
// code: "1",
// temp1: 39,
// press1: 12,
// press2: 10,
// remark: 9.9,
// createTime: "2021-09-09 12:00:00",
// },
// {
// code: "2",
// temp1: 49,
// press1: 11,
// press2: 32,
// remark: 9.9,
// createTime: "2021-09-09 12:00:00",
// },
// {
// code: "3",
// temp1: 59,
// press1: 32,
// press2: 43,
// remark: 39,
// createTime: "2021-09-09 12:00:00",
// },
// {
// code: "1",
// temp1: 39,
// press1: 21,
// press2: 94,
// remark: 19,
// createTime: "2021-09-09 12:00:00",
// },
// {
// code: "1",
// temp1: 22,
// press1: 55,
// press2: 42,
// remark: 98,
// createTime: "2021-09-09 12:00:00",
// },
// ];
// return;
this.tableLoading = true; this.tableLoading = true;
this.$http this.$http
.post("/pms/kilnPosHistory/pageView", { .post("/pms/kilnPosHistory/pageView", {
@ -88,41 +132,38 @@ export default {
hisId: this.hisId, hisId: this.hisId,
}) })
.then(({ data: res }) => { .then(({ data: res }) => {
console.log("temp dialog res", res); //console.log("temp dialog res", res);
this.tableLoading = false; this.tableLoading = false;
if (res.code === 0) { if (res.code === 0) {
if ("list" in res.data) { if ("list" in res.data) {
this.dataList = res.data.list; this.dataList = res.data.list;
this.totalPage = res.data.total this.totalPage = res.data.total;
} else if (Array.isArray(res.data)) { } else if (Array.isArray(res.data)) {
this.dataList = res.data; this.dataList = res.data;
this.totalPage = res.data.length this.totalPage = res.data.length;
} // else ... } // else ...
} else { } else {
this.dataList.splice(0); this.dataList.splice(0);
this.totalPage = 0 this.totalPage = 0;
} }
// this.dataList = [
// { id: 1, code: 1, press1: 1, press2: 1, createTime: "2023-4-21 01:00:00", temp1: 1000 },
// { id: 2, code: 2, press1: 2, press2: 2, createTime: "2023-4-21 02:00:00", temp1: 2000 },
// { id: 3, code: 3, press1: 3, press2: 3, createTime: "2023-4-21 03:00:00", temp1: 3000 },
// { id: 4, code: 4, press1: 4, press2: 4, createTime: "2023-4-21 04:00:00", temp1: 4000 },
// { id: 5, code: 5, press1: 5, press2: 5, createTime: "2023-4-21 05:00:00", temp1: 5000 },
// { id: 6, code: 6, press1: 6, press2: 6, createTime: "2023-4-21 06:00:00", temp1: 6000 },
// { id: 7, code: 7, press1: 7, press2: 7, createTime: "2023-4-21 07:00:00", temp1: 7000 },
// { id: 8, code: 8, press1: 8, press2: 8, createTime: "2023-4-21 08:00:00", temp1: 8000 },
// { id: 9, code: 9, press1: 9, press2: 9, createTime: "2023-4-21 09:00:00", temp1: 9000 },
// { id: 10, code: 10, press1: 10, press2: 10, createTime: "2023-4-21 10:00:00", temp1: 10000 },
// { id: 11, code: 11, press1: 11, press2: 11, createTime: "2023-4-21 11:00:00", temp1: 11000 },
// { id: 12, code: 12, press1: 12, press2: 12, createTime: "2023-4-21 12:00:00", temp1: 12000 },
// ];
}); });
}, },
drawChart() { drawChart() {
// dataList 线 // dataList 线
if (!this.chart) this.chart = echarts.init(document.getElementById("temp-chart")); if (!this.chart) this.chart = echarts.init(document.getElementById("temp-chart"));
// const y_data = Array(65).fill(0) // const y_data = Array(65).fill(0)
this.chart.setOption(loadChartConfig(null, this.dataList.map(i => i.temp1))); // debugger;
this.chart.setOption(
loadChartConfig({
x_data: null,
y_data: this.dataList.map((i) => i.temp1),
},
{
gas: this.dataList.map((i) => i.press2),
lambda: this.dataList.map((i) => i.remark),
})
);
}, },
handleOperate() {}, handleOperate() {},
handlePageChange(page) { handlePageChange(page) {
@ -152,7 +193,7 @@ export default {
.data-list, .data-list,
.temp-chart { .temp-chart {
/* border: 1px solid #ccc; */ /* border: 1px solid #ccc; */
width: 35%; width: 45%;
overflow-y: auto; overflow-y: auto;
position: relative; position: relative;
} }
@ -161,7 +202,7 @@ export default {
flex: 1; flex: 1;
/* margin-left: 18px; */ /* margin-left: 18px; */
padding-left: 10px; padding-left: 10px;
margin-left: 10px;
/* border-left: 1px solid #ccc; */ /* border-left: 1px solid #ccc; */
/* background-color: lightblue; */ /* background-color: lightblue; */
} }

View File

@ -1,6 +1,6 @@
import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent"; import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent";
import StateSelect from "@/components/StateSelect.vue"; // import StateSelect from "@/components/StateSelect.vue";
import request from "@/utils/request"; // import request from "@/utils/request";
import { timeFilter } from "@/utils/filters"; import { timeFilter } from "@/utils/filters";
export default function () { export default function () {
@ -8,7 +8,7 @@ export default function () {
// { type: 'index', label: '序号' }, // { type: 'index', label: '序号' },
// { prop: "createTime", label: "添加时间", filter: timeFilter }, // { prop: "createTime", label: "添加时间", filter: timeFilter },
{ prop: "code", label: "窑车号" }, { prop: "code", label: "窑车号" },
{ prop: "stateDictValue", label: "状态", subcomponent: StateSelect }, // { prop: "stateDictValue", label: "状态", subcomponent: StateSelect },
// { prop: "stateDictValue", label: "状态", filter: v => (v !== null && v !== undefined) ? ['没有数据', '正常', '判废', '过渡'][v] : '-' }, // subcomponent // { prop: "stateDictValue", label: "状态", filter: v => (v !== null && v !== undefined) ? ['没有数据', '正常', '判废', '过渡'][v] : '-' }, // subcomponent
{ prop: "orderCode", label: "订单号" }, { prop: "orderCode", label: "订单号" },
{ prop: "posCode", label: "位置" }, { prop: "posCode", label: "位置" },
@ -28,7 +28,9 @@ export default function () {
}, },
]; ];
const now = new Date().getTime(); const now = new Date();
const [y, m, d] = [now.getFullYear(), now.getMonth(), now.getDate()];
const today = new Date(y, m, d, 0, 0, 0, 0).getTime();
const headFormFields = [ const headFormFields = [
{ {
input: true, input: true,
@ -58,7 +60,7 @@ export default function () {
"start-placeholder": "开始时间", "start-placeholder": "开始时间",
"end-placeholder": "结束时间", "end-placeholder": "结束时间",
}, },
default: { value: [now - 3600 * 24 * 7 * 1000, now] }, default: { value: [today - 24 * 7 * 1000 * 3600, today + 3600 * 24 * 1000] },
}, },
{ {
button: { button: {
@ -81,7 +83,7 @@ export default function () {
const dialogJustFormConfigs = null; const dialogJustFormConfigs = null;
const carPayloadDialogConfigs = { const carPayloadDialogConfigs = {
dialogWidth: "70%", dialogWidth: "100%",
carPayloadDialog: true, carPayloadDialog: true,
clickModalToClose: false, clickModalToClose: false,
tableConfig: { tableConfig: {
@ -94,6 +96,9 @@ export default function () {
{ width: 80, prop: "orderCate", label: "订单子号" }, { width: 80, prop: "orderCate", label: "订单子号" },
{ prop: "bomCode", label: "配方" }, { prop: "bomCode", label: "配方" },
{ prop: "shapeCode", label: "砖型" }, { prop: "shapeCode", label: "砖型" },
{ prop: "weight", label: "重量" },
{ width: 128, prop: "gas", label: "燃气用量(m³)" },
{ width: 144, prop: "gp", label: "燃气(m³)/砖(kg)" },
{ width: 80, prop: "qty", label: "订单数量" }, { width: 80, prop: "qty", label: "订单数量" },
{ width: 72, prop: "goodqty", label: "合格数" }, { width: 72, prop: "goodqty", label: "合格数" },
{ width: 72, prop: "badqty", label: "废砖数" }, { width: 72, prop: "badqty", label: "废砖数" },

View File

@ -27,7 +27,8 @@ export default {
// }, // },
// }, // },
data() { data() {
const { tableConfig, headFormConfigs, carPayloadDialogConfigs, urls, dialogConfigs } = initConfig.call(this); const { tableConfig, headFormConfigs, carPayloadDialogConfigs, urls, dialogConfigs } =
initConfig.call(this);
return { return {
carPayloadDialogConfigs, carPayloadDialogConfigs,
tableConfig, tableConfig,
@ -39,7 +40,6 @@ export default {
}; };
}, },
activated() { activated() {
console.log("activated", this.$route.query)
this.code = this.$route.query.code || ""; this.code = this.$route.query.code || "";
this.triggerUpdateKey = Math.random().toString(); this.triggerUpdateKey = Math.random().toString();
}, },

View File

@ -0,0 +1,144 @@
import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent";
import request from "@/utils/request";
import { timeFilter, dictFilter } from '@/utils/filters'
import { getDictDataList } from '@/utils'
export default function () {
const tableProps = [
{ type: 'index', label: '序号' },
{ prop: "code", label: "窑车号" },
{ prop: "typeDictValue", label: "维修类别", filter: dictFilter('carMain') },
{ prop: "description", label: "维修描述" },
{ prop: "remark", label: "备注" },
{ prop: "startTime", label: "开始时间", filter: timeFilter },
{ prop: "endTime", label: "结束时间", filter: timeFilter },
// { prop: "prtTag", label: "是否打印标签", filter: val => ({ yes: '是', no: '否' })[val] ?? '-' },
{ prop: "creatorName", label: "创建人" },
// { prop: "remark", label: "创建时间" },
{ prop: "createTime", label: "创建时间", filter: timeFilter },
{
prop: "operations",
name: "操作",
fixed: "right",
width: 90,
subcomponent: TableOperaionComponent,
options: [{ name: "edit", label: "编辑", icon: "edit-outline" }, { name: "delete", icon: "delete", label: "删除", emitFull: true, permission: "pms:carMaintain:delete" }],
},
];
const now = new Date();
const [y, m, d] = [now.getFullYear(), now.getMonth(), now.getDate()];
const today = new Date(y, m, d, 0, 0, 0, 0).getTime();
const headFormFields = [
{
prop: 'code',
label: "窑车号",
input: true,
default: { value: "" },
bind: {
placeholder: '请输入窑车号'
}
},
{
timerange: true,
prop: "timerange",
label: "时间段",
bind: {
placeholder: "请选择时间段",
type: "datetimerange",
"start-placeholder": "开始时间",
"end-placeholder": "结束时间",
},
default: { value: [today - 24 * 7 * 1000 * 3600, today + 3600 * 24 * 1000] },
},
{
button: {
type: "primary",
name: "查询",
},
},
{
button: {
type: "primary",
name: "新增",
permission: "pms:carMaintain:save"
},
bind: {
plain: true,
}
},
];
/**
* dialog config 有两个版本一个适用于 DialogWithMenu 组件另一个适用于 DialogJustForm 组件
* 适用于 DialogWithMenu 组件的配置示例详见 blenderStep/config.js
* 此为后者的配置:
*/
const dialogJustFormConfigs = {
form: {
rows: [
[
{
input: true,
label: "窑车号",
prop: "code",
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入窑车号" },
},
{
select: true,
label: "维修类别",
prop: "typeDictValue",
options: getDictDataList('carMain').map(_ => ({ label: _.dictLabel, value: _.dictValue })),
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入维修类别" },
},
],
[
{
datetime: true,
label: "开始时间",
prop: "startTime",
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请选择开始时间", type: "datetime" },
},
{
datetime: true,
label: "结束时间",
prop: "endTime",
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请选择结束时间", type: "datetime" },
},
],
[{ textarea: true, label: "维修描述", prop: "description", elparams: { placeholder: "维修描述" } }],
[{ input: true, label: "备注", prop: "remark", elparams: { placeholder: "备注" } }],
],
operations: [
{ name: "add", label: "保存", type: "primary", permission: "pms:carMaintain:save", showOnEdit: false },
{ name: "update", label: "更新", type: "primary", permission: "pms:carMaintain:update", showOnEdit: true },
{ name: "reset", label: "重置", type: "warning", showAlways: true },
],
},
};
// 备注:弹窗弹出的时间和网速有关......
return {
dialogConfigs: dialogJustFormConfigs,
tableConfig: {
table: null, // 此处可省略el-table 上的配置项
column: tableProps, // el-column-item 上的配置项
},
headFormConfigs: {
rules: null, // 名称是由 BaseSearchForm.vue 组件固定的
fields: headFormFields, // 名称是由 BaseSearchForm.vue 组件固定的
},
urls: {
base: "/pms/carMaintain",
page: "/pms/carMaintain/pageView",
pageIsPostApi: true
// subase: '/pms/blenderStepParam',
// subpage: '/pms/blenderStepParam/page',
// more...
},
};
}

View File

@ -0,0 +1,35 @@
<template>
<ListViewWithHead
:table-config="tableConfig"
:head-config="headFormConfigs"
:dialog-configs="dialogConfigs" />
</template>
<script>
import initConfig from "./config";
import ListViewWithHead from "@/views/atomViews/ListViewWithHead.vue";
export default {
name: "ProductionLineView",
components: { ListViewWithHead },
provide() {
return {
urls: this.allUrls,
};
},
data() {
const { tableConfig, headFormConfigs, urls, dialogConfigs } = initConfig.call(this);
return {
tableConfig,
headFormConfigs,
allUrls: urls,
dialogConfigs,
};
},
created() {},
mounted() {},
methods: {},
};
</script>
<style scoped></style>

View File

@ -0,0 +1,261 @@
import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent";
// import switchBtn from "@/components/noTemplateComponents/switchBtn";
// import QuillRichInput from "@/components/noTemplateComponents/richInput";
// import request from "@/utils/request";
import { timeFilter } from "@/utils/filters";
export default function () {
const tableProps = [
// 多选框
{ type: "selection", width: 60, align: "center" },
{ width: 128, prop: "createTime", label: "添加时间", filter: timeFilter },
{ width: 128, prop: "updaterName", label: "更改人" },
{ width: 128, prop: "posCode", label: "位置" },
{ width: 72, prop: "code", label: "窑车号" },
{ width: 128, prop: "orderCode", label: "订单号" },
{ width: 88, prop: "orderCate", label: "订单子号" },
{ width: 72, prop: "shapeCode", label: "砖型" },
{ width: 256, prop: "brand", label: "配方" },
{ width: 128, prop: "goodqty", label: "合格数量" },
{ width: 128, prop: "badqty", label: "报废数量" },
// { prop: "typeDictValue", label: "过渡车", filter: val => ['否', '是'][val] },
// { prop: "enabled", label: "状态", subcomponent: switchBtn }, // subcomponent
{
width: 128,
prop: "team",
label: "班次",
filter: (val) => (val != null ? ["早班", "中班", "晚班"][val] : "-"),
},
{
width: 128,
prop: "report",
label: "报工",
filter: (val) => (val != null ? ["未报工", "已报工"][val] : "-"),
},
{ width: 128, prop: "rtime", label: "报工时间", filter: timeFilter },
{
prop: "operations",
name: "操作",
fixed: "right",
width: 90,
subcomponent: TableOperaionComponent,
options: [
{ name: "edit", label: "编辑", icon: "edit-outline", enable: (row) => row.report == 0 },
// {
// name: "delete",
// icon: "delete",
// label: "删除",
// emitFull: true,
// permission: "pms:carOrderReport:delete",
// },
],
},
];
const now = new Date();
const [y, m, d] = [now.getFullYear(), now.getMonth(), now.getDate()];
const today = new Date(y, m, d, 0, 0, 0, 0).getTime();
const headFormFields = [
{
prop: "orderCode",
label: "订单号",
input: true,
default: { value: "" },
bind: {
placeholder: "请输入订单号",
},
},
{
prop: "carCode",
label: "窑车号",
input: true,
default: { value: "" },
bind: {
placeholder: "请输入窑车号",
},
},
{
prop: "team",
label: "班次",
select: [
{ label: "早班", value: "0" },
{ label: "中班", value: "1" },
{ label: "晚班", value: "2" },
],
default: { value: "" },
bind: {
placeholder: "请选择班次",
},
},
{
prop: "report",
label: "报工",
select: [
{ label: "未报工", value: "0" },
{ label: "已报工", value: "1" },
],
default: { value: "0" },
bind: {
placeholder: "请选择报工状态",
},
},
{
prop: "pos",
label: "压机",
select: [
{ label: "压机1", value: "1" },
{ label: "压机2", value: "7" },
],
bind: {
placeholder: "请选择压机",
},
},
{
timerange: true,
prop: "timerange",
label: "时间段",
default: { value: [now - 3600 * 24 * 7 * 1000, now] },
bind: {
placeholder: "请选择时间段",
type: "datetimerange",
"start-placeholder": "开始时间",
"end-placeholder": "结束时间",
},
default: { value: [today - 24 * 7 * 1000 * 3600, today + 3600 * 24 * 1000] },
},
{
button: {
type: "primary",
name: "查询",
},
},
{
button: {
type: "primary",
name: "报工",
permission: "pms:carOrderReport:report",
},
bind: {
plain: true,
},
},
];
/**
* dialog config 有两个版本一个适用于 DialogWithMenu 组件另一个适用于 DialogJustForm 组件
* 适用于 DialogWithMenu 组件的配置示例详见 blenderStep/config.js
* 此为后者的配置:
*/
const dialogJustFormConfigs = {
clickModalToClose: false,
form: {
rows: [
[
{
forceDisabled: true,
label: "窑车号",
prop: "code",
// rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入窑车号" },
},
],
[
{
forceDisabled: true,
label: "订单号",
prop: "orderCode",
// rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入订单号" },
},
],
[
{
forceDisabled: true,
label: "订单子号",
prop: "orderCate",
// rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入订单子号" },
},
],
[
{
input: true,
label: "合格数量",
prop: "goodqty",
rules: [
{ required: true, message: "必填项不能为空", trigger: "blur" },
{
type: "number",
message: "请输入正确的数字类型",
trigger: "blur",
transform: (val) => Number(val),
},
],
elparams: { placeholder: "请输入合格数量" },
},
],
[
{
input: true,
label: "报废数量",
prop: "badqty",
rules: [
{ required: true, message: "必填项不能为空", trigger: "blur" },
{
type: "number",
message: "请输入正确的数字类型",
trigger: "blur",
transform: (val) => Number(val),
},
],
elparams: { placeholder: "请输入报废数量" },
},
],
// [
// {
// richInput: true,
// label: "描述信息",
// prop: "description",
// },
// ],
// [{ input: true, label: "备注", prop: "remark", elparams: { placeholder: "备注" } }],
],
operations: [
{
name: "add",
label: "保存",
type: "primary",
permission: "pms:carOrderReport:save",
showOnEdit: false,
},
{
name: "update",
label: "更新",
type: "primary",
permission: "pms:carOrderReport:update",
showOnEdit: true,
},
{ name: "reset", label: "重置", type: "warning", showAlways: true },
],
},
};
return {
dialogConfigs: dialogJustFormConfigs,
tableConfig: {
table: null, // 此处可省略el-table 上的配置项
column: tableProps, // el-column-item 上的配置项
},
headFormConfigs: {
rules: null, // 名称是由 BaseSearchForm.vue 组件固定的
fields: headFormFields, // 名称是由 BaseSearchForm.vue 组件固定的
},
urls: {
base: "/pms/carOrderReport",
page: "/pms/carOrderReport/pageView",
pageIsPostApi: true,
reportPre: "/pms/workReport/pressReportPre",
report: "/pms/workReport/pressReport",
},
};
}

View File

@ -0,0 +1,44 @@
<template>
<ListViewWithHead
:table-config="tableConfig"
:head-config="headFormConfigs"
:dialog-configs="dialogConfigs"
:listQueryExtra="['carCode', 'orderCode', 'team', { report: 0, startTime: now[0], endTime: now[1] }]" />
</template>
<script>
import initConfig from "./config";
import ListViewWithHead from "@/views/atomViews/ListViewWithHead.vue";
import moment from "moment";
export default {
name: "CarView",
components: { ListViewWithHead },
provide() {
return {
urls: this.allUrls,
};
},
data() {
const { tableConfig, headFormConfigs, urls, dialogConfigs } = initConfig.call(this);
return {
tableConfig,
headFormConfigs,
allUrls: urls,
dialogConfigs,
};
},
computed: {
now() {
const curr = this.headFormConfigs.fields.find((item) => item.prop == "timerange").default.value;
return [
moment(curr[0]).format("YYYY-MM-DDTHH:mm:ss"),
moment(curr[1]).format("YYYY-MM-DDTHH:mm:ss"),
]
},
},
methods: {},
};
</script>
<style scoped></style>

View File

@ -87,8 +87,11 @@ export default function () {
{ width: 56, type: "index", label: "序号" }, { width: 56, type: "index", label: "序号" },
{ prop: "orderCode", label: "订单号" }, { prop: "orderCode", label: "订单号" },
{ width: 80, prop: "orderCate", label: "订单子号" }, { width: 80, prop: "orderCate", label: "订单子号" },
{ prop: "bomCode", label: "配方" }, { prop: "brand", label: "配方" },
{ prop: "shapeCode", label: "砖型" }, { prop: "shapeCode", label: "砖型" },
{ prop: "weight", label: "重量" },
{ width: 128, prop: "gas", label: "燃气用量(m³)" },
{ width: 144, prop: "gp", label: "燃气(m³)/砖(kg)" },
{ width: 80, prop: "qty", label: "订单数量" }, { width: 80, prop: "qty", label: "订单数量" },
{ width: 72, prop: "goodqty", label: "合格数" }, { width: 72, prop: "goodqty", label: "合格数" },
{ width: 72, prop: "badqty", label: "废砖数" }, { width: 72, prop: "badqty", label: "废砖数" },

View File

@ -112,7 +112,7 @@ export default {
}, },
}, },
activated() { activated() {
console.log("list view with ehad activated..........", this.triggerUpdate); //console.log("list view with ehad activated..........", this.triggerUpdate);
this.refreshLayoutKey = this.layoutTable(); this.refreshLayoutKey = this.layoutTable();
}, },
watch: { watch: {
@ -182,7 +182,7 @@ export default {
} }
) )
.then(({ data: res }) => { .then(({ data: res }) => {
console.log("[http response] res is: ", res); //console.log("[http response] res is: ", res);
if (res.code === 0) { if (res.code === 0) {
// page : // page :
@ -221,7 +221,7 @@ export default {
/** 处理 表格操作 */ /** 处理 表格操作 */
handleOperate({ type, data }) { handleOperate({ type, data }) {
console.log("payload", type, data); //console.log("payload", type, data);
// component url // component url
// payload: { type: string, data: string | number | object } // payload: { type: string, data: string | number | object }
switch (type) { switch (type) {
@ -291,7 +291,7 @@ export default {
// break; // break;
// } // }
// case "status": { // case "status": {
// console.log("status", data); // //console.log("status", data);
// // TODO: // // TODO:
// const { id, code } = data; // const { id, code } = data;
// const queryCondition = { id, code }; // const queryCondition = { id, code };
@ -320,7 +320,7 @@ export default {
// break; // break;
// } // }
// case "to-bom-detail": { // case "to-bom-detail": {
// // console.log('to-bom-detail', data.name) // // //console.log('to-bom-detail', data.name)
// // // //
// return this.$router.push({ // return this.$router.push({
// name: "pms-bomDetails", // name: "pms-bomDetails",
@ -381,7 +381,7 @@ export default {
// }); // });
// } // }
// case "preview": { // case "preview": {
// console.log("[PREVIEW] data", data); // //console.log("[PREVIEW] data", data);
// // report preview // // report preview
// return this.$router.push({ // return this.$router.push({
// name: "pms-reportPreview", // name: "pms-reportPreview",
@ -391,7 +391,7 @@ export default {
// }); // });
// } // }
// case "design": { // case "design": {
// console.log("[DESIGN] data", data); // //console.log("[DESIGN] data", data);
// // report design // // report design
// return this.$router.push({ // return this.$router.push({
// name: "pms-reportDesign", // name: "pms-reportDesign",
@ -457,7 +457,7 @@ export default {
}, },
handleBtnClick({ btnName, payload }) { handleBtnClick({ btnName, payload }) {
console.log("[search] form handleBtnClick", btnName, payload); //console.log("[search] form handleBtnClick", btnName, payload);
switch (btnName) { switch (btnName) {
case "新增": case "新增":
this.openDialog(); this.openDialog();
@ -500,7 +500,7 @@ export default {
}); });
} }
}); });
console.log("查询", this.cachedSearchCondition); //console.log("", this.cachedSearchCondition);
this.getList(this.cachedSearchCondition); this.getList(this.cachedSearchCondition);
break; break;
} }
@ -539,7 +539,7 @@ export default {
}); });
} }
this.$nextTick(() => { this.$nextTick(() => {
console.log(`[edit-dialog] extraParams: ${extraParams}`); //console.log(`[edit-dialog] extraParams: ${extraParams}`);
this.$refs["edit-dialog"].init(/** some args... */ row_id, detail_mode, tag_info, extraParams); this.$refs["edit-dialog"].init(/** some args... */ row_id, detail_mode, tag_info, extraParams);
}); });
}, },

View File

@ -66,7 +66,7 @@ export default {
}, },
methods: { methods: {
handleTabClick(tab) { handleTabClick(tab) {
console.log("handle tab click", tab); //console.log("handle tab click", tab);
if (tab > this.oldActiveTab) this.toLeft = true; if (tab > this.oldActiveTab) this.toLeft = true;
else this.toLeft = false; else this.toLeft = false;
switch (tab) { switch (tab) {
@ -89,7 +89,7 @@ export default {
/** init **/ /** init **/
init(order, detailMode) { init(order, detailMode) {
console.log("init menu dialog,", order); //console.log("init menu dialog,", order);
this.order = order; this.order = order;
this.detailMode = detailMode ?? false; this.detailMode = detailMode ?? false;
this.visible = true; this.visible = true;

View File

@ -260,7 +260,7 @@ export default {
}, },
handleBtnClick({ btnName, payload }) { handleBtnClick({ btnName, payload }) {
console.log("[search] form handleBtnClick", btnName, payload); //console.log("[search] form handleBtnClick", btnName, payload);
switch (btnName) { switch (btnName) {
case "新增": case "新增":
this.openDialog(); this.openDialog();
@ -300,14 +300,14 @@ export default {
}); });
} }
}); });
console.log("查询", this.cachedSearchCondition); //console.log("", this.cachedSearchCondition);
this.getList(this.cachedSearchCondition); this.getList(this.cachedSearchCondition);
break; break;
} }
case "同步": case "同步":
case "全部同步": case "全部同步":
this.$http.post(this.urls.syncUrl).then(({ data: res }) => { this.$http.post(this.urls.syncUrl).then(({ data: res }) => {
console.log("全部同步", res); //console.log("", res);
if (res.code === 0) { if (res.code === 0) {
this.$message({ message: "同步成功", type: "success" }); this.$message({ message: "同步成功", type: "success" });
this.getList(); this.getList();
@ -334,7 +334,7 @@ export default {
openDialog(row, detail) { openDialog(row, detail) {
this.dialogVisible = true; this.dialogVisible = true;
console.log("row detail", row, detail); //console.log("row detail", row, detail);
let extraParams = null; let extraParams = null;
if (this.attachListQueryExtra && this.listQueryExtra.length) { if (this.attachListQueryExtra && this.listQueryExtra.length) {
@ -344,7 +344,7 @@ export default {
}); });
} }
this.$nextTick(() => { this.$nextTick(() => {
console.log(`[edit-dialog] extraParams: ${extraParams}`); //console.log(`[edit-dialog] extraParams: ${extraParams}`);
this.$refs["edit-dialog"].init(/** some args... */ row, detail); this.$refs["edit-dialog"].init(/** some args... */ row, detail);
}); });
}, },

View File

@ -66,7 +66,7 @@ export default {
}, },
methods: { methods: {
handleOperate({ type, data }) { handleOperate({ type, data }) {
console.log("payload", type, data); //console.log("payload", type, data);
}, },
handleSizeChange(newSize) { handleSizeChange(newSize) {
@ -89,7 +89,7 @@ export default {
...this.extraQueryFields, ...this.extraQueryFields,
}; };
console.log("getAlist", data, this.pageIsPost); //console.log("getAlist", data, this.pageIsPost);
return this.$http({ return this.$http({
url: this.urls.page ?? this.urls.base + "/page", url: this.urls.page ?? this.urls.base + "/page",

View File

@ -114,7 +114,7 @@ export default {
orderId: { orderId: {
handler: function (val) { handler: function (val) {
if (val) { if (val) {
console.log("get car list based on orderId: ", val); //console.log("get car list based on orderId: ", val);
this.getAList(val); this.getAList(val);
} }
}, },
@ -125,7 +125,7 @@ export default {
}, },
}, },
// activated() { // activated() {
// console.log("hhh"); // //console.log("hhh");
// this.refreshLayoutKey = Math.random(); // this.refreshLayoutKey = Math.random();
// }, // },
methods: { methods: {
@ -218,7 +218,7 @@ export default {
}, },
getAList(orderId) { getAList(orderId) {
console.log("geting car list, ", orderId); //console.log("geting car list, ", orderId);
if (!orderId) orderId = this.orderId; if (!orderId) orderId = this.orderId;
this.tableLoading = true; this.tableLoading = true;
@ -227,7 +227,7 @@ export default {
if ("list" in res.data) { if ("list" in res.data) {
this.dataList = res.data.list; this.dataList = res.data.list;
this.totalPage = res.data.total; this.totalPage = res.data.total;
} else console.log("没有res.data.list属性"); }
} else { } else {
this.dataList.splice(0); this.dataList.splice(0);
this.totalPage = 0; this.totalPage = 0;

View File

@ -7,7 +7,11 @@
<el-col :span="6"> <el-col :span="6">
<el-form-item label="订单状态" prop="statusDictValue" :rules="null"> <el-form-item label="订单状态" prop="statusDictValue" :rules="null">
<span style="display: block; margin-top: 32px"> <span style="display: block; margin-top: 32px">
{{ ["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝", "已下发"][dataForm.statusDictValue] }} {{
["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝", "已下发"][
dataForm.statusDictValue
]
}}
</span> </span>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -160,7 +164,9 @@
:label="opt.label" :label="opt.label"
:value="opt.value" :value="opt.value"
style="display: flex; align-items: center"> style="display: flex; align-items: center">
<span style="display: inline-block; width: 128px; text-overflow: ellipsis">{{ opt.label }}</span> <span style="display: inline-block; width: 128px; text-overflow: ellipsis">
{{ opt.label }}
</span>
<span <span
v-if="requestList[3].extraLabel" v-if="requestList[3].extraLabel"
style="display: inline-block; margin-left: 12px; font-size: 0.9em"> style="display: inline-block; margin-left: 12px; font-size: 0.9em">
@ -375,9 +381,7 @@
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="6"> <el-col :span="6">
<el-form-item <el-form-item label="销售订单号" prop="saleNo">
label="销售订单号"
prop="saleNo">
<!-- :rules="{ required: true, message: '必填项不能为空', trigger: 'blur' }"> --> <!-- :rules="{ required: true, message: '必填项不能为空', trigger: 'blur' }"> -->
<el-input <el-input
v-model="dataForm.saleNo" v-model="dataForm.saleNo"
@ -413,9 +417,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item <el-form-item label="销售时间" prop="deliveryTime">
label="销售时间"
prop="deliveryTime">
<!-- :rules="{ required: true, message: '必填项不能为空', trigger: 'blur' }"> --> <!-- :rules="{ required: true, message: '必填项不能为空', trigger: 'blur' }"> -->
<el-date-picker <el-date-picker
v-model="dataForm.deliveryTime" v-model="dataForm.deliveryTime"
@ -456,8 +458,41 @@
<span style="display: block; margin-top: 32px">{{ dataForm.shortDesc }}</span> <span style="display: block; margin-top: 32px">{{ dataForm.shortDesc }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"></el-col> <el-col :span="6">
<el-col :span="6"></el-col> <el-form-item
label="托盘类型"
prop="palletType"
:rules="{ required: true, message: '必填项不能为空', trigger: 'blur' }">
<el-select
v-model="dataForm.palletType"
filterable
clearable
:disabled="mode.includes('detail')"
v-bind="{ placeholder: '选择托盘类型' }">
<el-option
v-for="pt in palletType"
:key="pt.dictValue"
:label="pt.dictLabel"
:value="pt.dictValue"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item
label="贴纸板"
prop="paperboard"
:rules="{ required: true, message: '必填项不能为空', trigger: 'blur' }">
<el-select
v-model="dataForm.paperboard"
filterable
clearable
:disabled="mode.includes('detail')"
v-bind="{ placeholder: '选择贴纸板' }">
<el-option label="否" value="0"></el-option>
<el-option label="是" value="1"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col> <el-col>
@ -477,6 +512,7 @@
<script> <script>
import { pick as __pick } from "@/utils/filters"; import { pick as __pick } from "@/utils/filters";
import InputsArea from "./InputsArea.vue"; import InputsArea from "./InputsArea.vue";
import { getDictDataList } from "@/utils";
export default { export default {
name: "OrderDetailTag", name: "OrderDetailTag",
@ -526,6 +562,8 @@ export default {
customerId: null, customerId: null,
shortDesc: null, shortDesc: null,
remark: null, remark: null,
palletType: null,
paperboard: null,
}, },
requestList: [ requestList: [
{ {
@ -619,6 +657,11 @@ export default {
promiseList: [], promiseList: [],
}; };
}, },
computed: {
palletType() {
return getDictDataList("pallet_type");
},
},
methods: { methods: {
/** /**
* 打开弹窗后准备下拉选项数据 * 打开弹窗后准备下拉选项数据

View File

@ -25,7 +25,7 @@ export default {
}, },
created() { }, created() { },
mounted() { mounted() {
console.log('this.order', this.order) //console.log('this.order', this.order)
this.$nextTick(() => { this.$nextTick(() => {
this.$refs["order-detail-tag"].init(this.order.id, this.detailMode); this.$refs["order-detail-tag"].init(this.order.id, this.detailMode);
}); });

View File

@ -100,18 +100,18 @@ export default {
filter: (val) => (val !== null && val !== undefined ? ["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝", "已下发"][val] : "-"), filter: (val) => (val !== null && val !== undefined ? ["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝", "已下发"][val] : "-"),
}, },
{ prop: "qty", label: "混料总量 [kg]" }, { prop: "qty", label: "混料总量 [kg]" },
{ // {
prop: "operations", // prop: "operations",
name: "操作", // name: "",
fixed: "right", // fixed: "right",
width: 200, // width: 200,
subcomponent: TableOperaionComponent, // subcomponent: TableOperaionComponent,
options: [ // options: [
{ name: "edit", label: "编辑", emitFull: true, icon: "edit-outline" }, // { name: "edit", label: "", emitFull: true, icon: "edit-outline" },
{ name: "view-batch", label: "查看批次", color: "#ff8000", toRouter: "pms-blenderBatch", icon: "document-copy" }, // pms-blenderBatch // { name: "view-batch", label: "", color: "#ff8000", toRouter: "pms-blenderBatch", icon: "document-copy" }, // pms-blenderBatch
{ name: "detach", label: "下发", color: "#099", icon: "bottom-right" }, // { name: "detach", label: "", color: "#099", icon: "bottom-right" },
], // ],
}, // },
], ],
refreshLayoutKey1: "", refreshLayoutKey1: "",
// //
@ -127,14 +127,14 @@ export default {
{ prop: "qtyComplete", label: "完成量" }, { prop: "qtyComplete", label: "完成量" },
{ prop: "goodqty", label: "合格数量" }, { prop: "goodqty", label: "合格数量" },
{ prop: "badqty", label: "不合格数量" }, { prop: "badqty", label: "不合格数量" },
{ // {
prop: "operations", // prop: "operations",
name: "操作", // name: "",
fixed: "right", // fixed: "right",
width: 200, // width: 200,
subcomponent: TableOperaionComponent, // subcomponent: TableOperaionComponent,
options: [{ name: "detach", label: "下发", icon: "bottom-right" }], // , url: '/pms/trans/pressDeli' }] // options: [{ name: "detach", label: "", icon: "bottom-right" }], // , url: '/pms/trans/pressDeli' }]
}, // },
], ],
refreshLayoutKey2: "", refreshLayoutKey2: "",
// //

View File

@ -88,7 +88,7 @@ export default {
hisId: this.hisId, hisId: this.hisId,
}) })
.then(({ data: res }) => { .then(({ data: res }) => {
console.log("temp dialog res", res); //console.log("temp dialog res", res);
this.tableLoading = false; this.tableLoading = false;
if (res.code === 0) { if (res.code === 0) {
if ("list" in res.data) { if ("list" in res.data) {

View File

@ -8,8 +8,8 @@ import { getDictDataList } from '@/utils';
export default function () { export default function () {
const tableProps = [ const tableProps = [
{ width: 60, type: "index", label: "序号", fixed: true },
{ width: 120, prop: "code", label: "订单号", fixed: "left" }, { width: 120, prop: "code", label: "订单号", fixed: "left" },
{ width: 60, type: "index", label: "序号", fixed: true },
{ width: 60, prop: "cate", label: "子号" }, { width: 60, prop: "cate", label: "子号" },
{ width: 100, prop: "productCode", label: "物料" }, { width: 100, prop: "productCode", label: "物料" },
{ width: 100, prop: "shapeCode", label: "砖型" }, { width: 100, prop: "shapeCode", label: "砖型" },
@ -23,7 +23,7 @@ export default function () {
{ width: 120, prop: "planStartTime", label: "计划开始时间", filter: timeFilter }, { width: 120, prop: "planStartTime", label: "计划开始时间", filter: timeFilter },
{ width: 120, prop: "startTime", label: "开始时间", filter: timeFilter }, { width: 120, prop: "startTime", label: "开始时间", filter: timeFilter },
{ width: 120, prop: "sapParam6", label: "烧成温度" }, { width: 120, prop: "sapParam6", label: "烧成温度" },
{ width: 120, prop: "sapParam7", label: "烧成时间(h)" }, { width: 120, prop: "sapParam7", label: "烧成时间(min)" },
{ width: 200, prop: "packTechCode", label: "包装工艺代码" }, { width: 200, prop: "packTechCode", label: "包装工艺代码" },
{ width: 120, prop: "pcsKilnCar", label: "托盘码放砖数" }, { width: 120, prop: "pcsKilnCar", label: "托盘码放砖数" },
{ width: 120, prop: "customerCode", label: "客户" }, { width: 120, prop: "customerCode", label: "客户" },
@ -37,6 +37,7 @@ export default function () {
{ width: 200, prop: "shortDesc", label: "喷码描述" }, { width: 200, prop: "shortDesc", label: "喷码描述" },
{ width: 120, prop: "yieldqty", label: "已生产数量" }, { width: 120, prop: "yieldqty", label: "已生产数量" },
{ width: 120, prop: "remark", label: "备注" }, { width: 120, prop: "remark", label: "备注" },
{ width: 120, prop: "description", label: "结束备注" },
// { width: 120, prop: "createTime", label: "添加时间", filter: timeFilter }, // { width: 120, prop: "createTime", label: "添加时间", filter: timeFilter },
{ {
prop: "operations", prop: "operations",
@ -495,7 +496,7 @@ export default function () {
}, },
{ {
input: true, input: true,
label: "烧成时间 H", label: "烧成时间(min)",
prop: "sapParam7", prop: "sapParam7",
rules: [ rules: [
{ required: true, message: "必填项不能为空", trigger: "blur" }, { required: true, message: "必填项不能为空", trigger: "blur" },

View File

@ -88,29 +88,6 @@ export default function () {
form: { form: {
rows: [ rows: [
[ [
// {
// input: true,
// label: "工艺名称",
// prop: "name",
// rules: { required: true, message: "必填项不能为空", trigger: "blur" },
// elparams: { placeholder: "请输入烧成曲线名称" },
// },
// {
// select: true,
// label: "配方",
// prop: "bomId",
// options: [],
// refreshOptionsAfterConfirm: true,
// rules: { required: true, message: "必填项不能为空", trigger: "blur" },
// elparams: { clearable: true, filterable: true, placeholder: "请选择配方" },
// fetchData: (techId = -1) => this.$http.get("/pms/bom/listUnR", { params: { wsId: 3, version: '', key: '', techId } }),
// cacheFetchedData: true,
// changeReflects: {
// fromKey: ['code', 'version'],
// delimiter: '-',
// toProp: 'code'
// }
// },
{ {
input: true, input: true,
autoDisabled: true, autoDisabled: true,
@ -120,13 +97,6 @@ export default function () {
elparams: { placeholder: "请输入烧成曲线编码" }, elparams: { placeholder: "请输入烧成曲线编码" },
}, },
], ],
// [
// {
// forceDisabled: true,
// prop: 'bomCode',
// label: '当前配方'
// },
// ],
[{ textarea: true, label: "备注", prop: "remark", elparams: { placeholder: "备注" } }], [{ textarea: true, label: "备注", prop: "remark", elparams: { placeholder: "备注" } }],
], ],
operations: [ operations: [
@ -139,14 +109,9 @@ export default function () {
table: { table: {
extraParams: ["techId", "key"], extraParams: ["techId", "key"],
props: [ props: [
// { type: 'index', label: '序号' },
// { prop: "createTime", label: "添加时间", filter: timeFilter },
{ prop: "name", label: "参数名称", isEditField: true }, { prop: "name", label: "参数名称", isEditField: true },
{ prop: "code", label: "参数编码", isEditField: true }, // { prop: "code", label: "参数编码", isEditField: true },
// { prop: "specifications", label: "规格", isEditField: true },
{ width: 80, prop: "value", label: "参数值", isEditField: true }, { width: 80, prop: "value", label: "参数值", isEditField: true },
// { prop: "valueFloor", label: "参数值下限", isEditField: true },
// { prop: "valueTop", label: "参数值上限", isEditField: true },
{ prop: "description", label: "描述", isEditField: true }, { prop: "description", label: "描述", isEditField: true },
{ {
prop: "operations", prop: "operations",
@ -155,7 +120,7 @@ export default function () {
width: 90, width: 90,
subcomponent: TableOperaionComponent, subcomponent: TableOperaionComponent,
options: [ options: [
{ name: "edit", label: "编辑", icon: "edit-outline", permission: "pms:blenderStepParam:update" }, { name: "edit", label: "编辑", icon: "edit-outline", permission: "pms:equipmentTechParam:update" },
// { name: "delete", icon: "delete", label: "删除", emitFull: true, permission: "pms:blenderStepParam:delete" }, // { name: "delete", icon: "delete", label: "删除", emitFull: true, permission: "pms:blenderStepParam:delete" },
], ],
}, },
@ -176,20 +141,24 @@ export default function () {
rules: { required: true, message: "必填项不能为空", trigger: "blur" }, rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入参数名称" }, elparams: { placeholder: "请输入参数名称" },
}, },
{ // {
input: true, // input: true,
label: "参数编码", // label: "参数编码",
prop: "code", // prop: "code",
rules: { required: true, message: "必填项不能为空", trigger: "blur" }, // rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入参数编码" }, // elparams: { placeholder: "请输入参数编码" },
}, // },
],
[
{ input: true, label: "参数值上限", prop: "valueTop", elparams: { placeholder: "请输入参数值上限" } }
], ],
[ [
{ input: true, label: "参数值上限", prop: "valueTop", elparams: { placeholder: "请输入参数值上限" } },
{ input: true, label: "参数值下限", prop: "valueFloor", elparams: { placeholder: "请输入参数值下限" } }, { input: true, label: "参数值下限", prop: "valueFloor", elparams: { placeholder: "请输入参数值下限" } },
], ],
[ [
{ input: true, label: "参数值", prop: "value", elparams: { placeholder: "请输入参数值" } }, { input: true, label: "参数值", prop: "value", elparams: { placeholder: "请输入参数值" } }
],
[
{ {
input: true, input: true,
label: "描述", label: "描述",
@ -200,8 +169,8 @@ export default function () {
], ],
], ],
operations: [ operations: [
{ name: "add", label: "保存", type: "primary", showOnEdit: false }, { name: "add", label: "保存", type: "primary", showOnEdit: false, permission: 'pms:equipmentTechParam:save' },
{ name: "update", label: "更新", type: "primary", showOnEdit: true }, { name: "update", label: "更新", type: "primary", showOnEdit: true, permission: 'pms:equipmentTechParam:update' },
// { name: "update", label: "更新", type: "primary", permission: "pms:blenderStepParam:update", showOnEdit: true }, // { name: "update", label: "更新", type: "primary", permission: "pms:blenderStepParam:update", showOnEdit: true },
// { name: 'reset', label: '重置', type: 'warning', showAlways: true }, // { name: 'reset', label: '重置', type: 'warning', showAlways: true },
// { name: 'cancel', label: '取消', showAlways: true }, // { name: 'cancel', label: '取消', showAlways: true },

View File

@ -6,20 +6,21 @@ import { timeFilter } from "@/utils/filters";
export default function () { export default function () {
const tableProps = [ const tableProps = [
{ type: "index", label: "序号" }, { type: "index", label: "序号" },
{ prop: "kilnCode", label: "窑炉" },
{ width: 160, prop: "orderCode", label: "主订单号" }, { width: 160, prop: "orderCode", label: "主订单号" },
{ width: 60, prop: "orderCate", label: "子号" }, { width: 60, prop: "orderCate", label: "子号" },
{ width: 160, prop: "code", label: "烧成订单号" }, { prop: "kilnCode", label: "窑炉" },
{ width: 60, prop: "percent", label: "进度", filter: (val) => (val !== null && val !== undefined ? val + " %" : "-") }, { width: 60, prop: "percent", label: "进度", filter: (val) => (val !== null && val !== undefined ? val + " %" : "-") },
// { width: 160, prop: "code", label: "烧成订单号" },
// { prop: "statusDictValue", label: "订单状态", filter: (val) => (val !== null && val !== undefined ? ["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝"][val] : "-"), }, // { prop: "statusDictValue", label: "订单状态", filter: (val) => (val !== null && val !== undefined ? ["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝"][val] : "-"), },
// { prop: "startTime", label: "开始时间" }, // { prop: "startTime", label: "开始时间" },
{ prop: "bomCode", label: "配方" }, { width: 180, prop: "bomName", label: "牌号" },
{ prop: 'sapParam6', label: '烧成温度' },
{ prop: 'sapParam7', label: '保温时间' },
{ width: 80, prop: "ai", label: "版本号" }, { width: 80, prop: "ai", label: "版本号" },
{ width: 80, prop: "qty", label: "生产量" }, { width: 80, prop: "qty", label: "生产量" },
{ prop: "qtyComplete", label: "完成量" }, { prop: "qtyComplete", label: "完成量" },
{ width: 160, prop: "createTime", label: "添加时间", filter: timeFilter }, { width: 160, prop: "createTime", label: "添加时间", filter: timeFilter },
// { prop: "remark", label: "备注" }, // { prop: "remark", label: "备注" },
// { prop: 'version', label: '配方号' },
// { prop: 'status', label: '状态', subcomponent: StatusComponent }, // subcomponent // { prop: 'status', label: '状态', subcomponent: StatusComponent }, // subcomponent
// { prop: "description", label: "详情", subcomponent: TableTextComponent }, // { prop: "description", label: "详情", subcomponent: TableTextComponent },
// { // {

View File

@ -110,7 +110,7 @@ export default {
}, },
}, },
activated() { activated() {
console.log("list view with ehad activated..........", this.triggerUpdate); //console.log("list view with ehad activated..........", this.triggerUpdate);
this.refreshLayoutKey = this.layoutTable(); this.refreshLayoutKey = this.layoutTable();
}, },
watch: { watch: {
@ -179,7 +179,7 @@ export default {
} }
) )
.then(({ data: res }) => { .then(({ data: res }) => {
console.log("[http response] res is: ", res); //console.log("[http response] res is: ", res);
if (res.code === 0) { if (res.code === 0) {
// page : // page :
@ -218,7 +218,7 @@ export default {
/** 处理 表格操作 */ /** 处理 表格操作 */
handleOperate({ type, data }) { handleOperate({ type, data }) {
console.log("payload", type, data); //console.log("payload", type, data);
// component url // component url
// payload: { type: string, data: string | number | object } // payload: { type: string, data: string | number | object }
switch (type) { switch (type) {
@ -287,7 +287,7 @@ export default {
// break; // break;
// } // }
// case "status": { // case "status": {
// console.log("status", data); // //console.log("status", data);
// // TODO: // // TODO:
// const { id, code } = data; // const { id, code } = data;
// const queryCondition = { id, code }; // const queryCondition = { id, code };
@ -316,7 +316,7 @@ export default {
// break; // break;
// } // }
// case "to-bom-detail": { // case "to-bom-detail": {
// // console.log('to-bom-detail', data.name) // // //console.log('to-bom-detail', data.name)
// // // //
// return this.$router.push({ // return this.$router.push({
// name: "pms-bomDetails", // name: "pms-bomDetails",
@ -377,7 +377,7 @@ export default {
// }); // });
// } // }
// case "preview": { // case "preview": {
// console.log("[PREVIEW] data", data); // //console.log("[PREVIEW] data", data);
// // report preview // // report preview
// return this.$router.push({ // return this.$router.push({
// name: "pms-reportPreview", // name: "pms-reportPreview",
@ -387,7 +387,7 @@ export default {
// }); // });
// } // }
// case "design": { // case "design": {
// console.log("[DESIGN] data", data); // //console.log("[DESIGN] data", data);
// // report design // // report design
// return this.$router.push({ // return this.$router.push({
// name: "pms-reportDesign", // name: "pms-reportDesign",
@ -453,7 +453,7 @@ export default {
}, },
handleBtnClick({ btnName, payload }) { handleBtnClick({ btnName, payload }) {
console.log("[search] form handleBtnClick", btnName, payload); //console.log("[search] form handleBtnClick", btnName, payload);
switch (btnName) { switch (btnName) {
case "新增": case "新增":
this.openDialog(); this.openDialog();
@ -495,7 +495,7 @@ export default {
}); });
} }
}); });
console.log("查询", this.cachedSearchCondition); //console.log("", this.cachedSearchCondition);
this.getList(this.cachedSearchCondition); this.getList(this.cachedSearchCondition);
break; break;
} }
@ -534,7 +534,7 @@ export default {
}); });
} }
this.$nextTick(() => { this.$nextTick(() => {
console.log(`[edit-dialog] extraParams: ${extraParams}`); //console.log(`[edit-dialog] extraParams: ${extraParams}`);
this.$refs["edit-dialog"].init(/** some args... */ row_id, detail_mode, tag_info, extraParams); this.$refs["edit-dialog"].init(/** some args... */ row_id, detail_mode, tag_info, extraParams);
}); });
}, },

View File

@ -127,7 +127,7 @@ export default {
}, },
methods: { methods: {
handleSubEmitData(payload) { handleSubEmitData(payload) {
console.log("[component] BaseListTable handleSubEmitData(): ", payload); //console.log("[component] BaseListTable handleSubEmitData(): ", payload);
this.$emit("operate-event", payload); this.$emit("operate-event", payload);
}, },
loadSubClassFn(tree, treeNode, resolve) { loadSubClassFn(tree, treeNode, resolve) {

View File

@ -155,12 +155,12 @@ export default {
resetForm(excludeId = false, immediate = false) { resetForm(excludeId = false, immediate = false) {
setTimeout( setTimeout(
() => { () => {
console.log("[Dialog Just Form] clearing form..."); //console.log("[Dialog Just Form] clearing form...");
Object.keys(this.dataForm).forEach((key) => { Object.keys(this.dataForm).forEach((key) => {
if (excludeId && key === "id") return; if (excludeId && key === "id") return;
this.dataForm[key] = null; this.dataForm[key] = null;
}); });
console.log("[Dialog Just Form] cleared form...", this.dataForm); //console.log("[Dialog Just Form] cleared form...", this.dataForm);
this.$refs.dataForm.clearValidate(); this.$refs.dataForm.clearValidate();
this.$emit("dialog-closed"); // this.$emit("dialog-closed"); //
}, },
@ -182,11 +182,11 @@ export default {
handleComponentModelUpdate(propName, { subject, payload: { data } }) { handleComponentModelUpdate(propName, { subject, payload: { data } }) {
this.dataForm[propName] = JSON.stringify(data); this.dataForm[propName] = JSON.stringify(data);
console.log("[DialogJustForm] handleComponentModelUpdate", this.dataForm[propName]); //console.log("[DialogJustForm] handleComponentModelUpdate", this.dataForm[propName]);
}, },
handleBtnClick(payload) { handleBtnClick(payload) {
console.log("btn click payload: ", payload); //console.log("btn click payload: ", payload);
if ("name" in payload) { if ("name" in payload) {
switch (payload.name) { switch (payload.name) {
@ -209,7 +209,7 @@ export default {
data: this.dataForm, data: this.dataForm,
}) })
.then(({ data: res }) => { .then(({ data: res }) => {
console.log("[add&update] res is: ", res); //console.log("[add&update] res is: ", res);
this.loadingStatus = false; this.loadingStatus = false;
if (res.code === 0) { if (res.code === 0) {
this.$message.success(payload.name === "add" ? "添加成功" : "更新成功"); this.$message.success(payload.name === "add" ? "添加成功" : "更新成功");

View File

@ -201,7 +201,7 @@ export default {
}, },
methods: { methods: {
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 }) => {
if (res.code === 0 && res.data) { if (res.code === 0 && res.data) {
resolve( resolve(
@ -246,7 +246,7 @@ export default {
}, },
}) })
.then(({ data: res }) => { .then(({ data: res }) => {
console.log("[http response] res is: ", res); //console.log("[http response] res is: ", res);
// page : // page :
if ("list" in res.data) { if ("list" in res.data) {
@ -267,7 +267,7 @@ export default {
/** 处理 表格操作 */ /** 处理 表格操作 */
handleOperate({ type, data }) { handleOperate({ type, data }) {
console.log("payload", type, data); //console.log("payload", type, data);
// component url // component url
// payload: { type: string, data: string | number | object } // payload: { type: string, data: string | number | object }
switch (type) { switch (type) {
@ -307,7 +307,7 @@ export default {
break; break;
} }
case "status": { case "status": {
console.log("status", data); //console.log("status", data);
// TODO: // TODO:
const { id, code } = data; const { id, code } = data;
const queryCondition = { id, code }; const queryCondition = { id, code };
@ -346,7 +346,7 @@ export default {
}, },
handleBtnClick({ btnName, payload }) { handleBtnClick({ btnName, payload }) {
console.log("[search] form handleBtnClick", btnName, payload); //console.log("[search] form handleBtnClick", btnName, payload);
switch (btnName) { switch (btnName) {
case "新增": case "新增":
this.openDialog(); this.openDialog();

View File

@ -12,14 +12,14 @@ export default function () {
{ width: 90, prop: "typeDictValue", label: "料仓类型", filter: dictFilter("liaocang") }, { width: 90, prop: "typeDictValue", label: "料仓类型", filter: dictFilter("liaocang") },
// { prop: "enabled", label: "状态", subcomponent: switchBtn }, // subcomponent // { prop: "enabled", label: "状态", subcomponent: switchBtn }, // subcomponent
{ width: 220, prop: "materialDescription", label: "原料" }, { width: 220, prop: "materialDescription", label: "原料" },
{ width: 128, prop: "materialName", label: "中文描述" },
{ prop: "qty", label: "料位[kg]" }, { prop: "qty", label: "料位[kg]" },
// { prop: "unitDictValue", label: "单位", filter: dictFilter('unit') }, // { prop: "unitDictValue", label: "单位", filter: dictFilter('unit') },
{ width: 128, prop: "materialTypeDictValue", label: "原料类型", filter: dictFilter("material_category") }, { width: 128, prop: "materialTypeDictValue", label: "原料类型", filter: dictFilter("material_category") },
{ width: 128, prop: "density", label: "原料堆积密度" }, // { width: 128, prop: "density", label: "原料堆积密度" },
{ width: 90, prop: "dosLow", label: "加料下限" }, // { width: 90, prop: "dosLow", label: "加料下限" },
{ width: 90, prop: "dosHigh", label: "加料上限" }, // { width: 90, prop: "dosHigh", label: "加料上限" },
{ width: 128, prop: "description", label: "描述" }, { width: 128, prop: "description", label: "描述" },
{ width: 128, prop: "materialName", label: "中文描述" },
// { prop: "remark", label: "备注" }, // { prop: "remark", label: "备注" },
{ width: 128, prop: "createTime", label: "添加时间", filter: timeFilter }, { width: 128, prop: "createTime", label: "添加时间", filter: timeFilter },
{ {

View File

@ -2,28 +2,52 @@
<div class="storage-box" :style="{ outlineColor: color }"> <div class="storage-box" :style="{ outlineColor: color }">
<div <div
class="storage-title" class="storage-title"
style="margin-bottom: 10px; padding-bottom: 12px; text-align: center; font-weight: bold; font-size: 1.125em; border-bottom: 1px solid #ccc3" style="
> margin-bottom: 10px;
<span style="display: inline-block; color: white; padding: 6px 12px; border-radius: 6px 20px" :style="{ background: color }"> padding-bottom: 12px;
text-align: center;
font-weight: bold;
font-size: 1.125em;
border-bottom: 1px solid #ccc3;
">
<span
style="display: inline-block; color: white; padding: 6px 12px; border-radius: 6px 20px"
:style="{ background: color }">
{{ storage }} {{ storage }}
</span> </span>
</div> </div>
<div class="storage-body" style="height: 120px; display: flex"> <div class="storage-body" style="height: 120px; display: flex">
<div class="storage-box__bg" style="height: 100%; width: 48px; margin-right: 12px; border-radius: 4px; overflow: hidden"> <div
class="storage-box__bg"
style="height: 100%; width: 48px; margin-right: 12px; border-radius: 4px; overflow: hidden">
<div <div
class="storage-box__inner" class="storage-box__inner"
style="position: absolute; bottom: 0; left: 0; height: 0; width: 100%; font-size: 1.125rem; text-align: center;" style="
:style="{ background: color, height: computedRatio + '%', color: computedRatio > 20 ? 'white' : '#ccc' }" position: absolute;
> bottom: 0;
<span style="height: 100%; display: flex; flex-direction: column; justify-content: flex-end;">{{ computedRatio + '%' }}</span> left: 0;
height: 0;
width: 100%;
font-size: 1.125rem;
text-align: center;
"
:style="{
background: color,
height: computedRatio + '%',
color: computedRatio > 20 ? 'white' : '#ccc',
}">
<span style="height: 100%; display: flex; flex-direction: column; justify-content: flex-end">
{{ computedRatio + "%" }}
</span>
</div> </div>
</div> </div>
<div style="display: flex; flex-direction: column; min-width: 128px; justify-content: space-between"> <div style="display: flex; flex-direction: column; min-width: 128px; justify-content: space-between">
<div style="font-size: 1.125em; line-height: 2.5; text-align: right">{{ material }}</div> <div style="font-size: 1.125em; line-height: 2.5; text-align: right">{{ material }}</div>
<div style="font-size: 1.5em; line-height: 1.25; text-align: right; font-weight: bold"> <div style="font-size: 1.5em; line-height: 1.25; text-align: right; font-weight: bold">
{{ qty }} <span style="color: #777; font-weight: normal; font-size: 1rem">{{ computedUnit }}</span> {{ qty }}
<span style="color: #777; font-weight: normal; font-size: 1rem">{{ computedUnit }}</span>
</div> </div>
<!-- <div class="btn-group" style="text-align: right"> <!-- <div class="btn-group" style="text-align: right">
@ -76,12 +100,12 @@ export default {
}, },
computed: { computed: {
computedUnit() { computedUnit() {
if (!this.unitValue) return "存量"; if (!this.unitValue) return "存量[kg]";
return this.unitList(this.unitValue) + " 存量"; return this.unitList(this.unitValue) + " 存量[kg]";
}, },
computedRatio() { computedRatio() {
return this.ratio ? this.ratio.toFixed(2) * 100 : 0 return this.ratio ? this.ratio.toFixed(2) * 100 : 0;
} },
}, },
created() {}, created() {},
mounted() {}, mounted() {},

View File

@ -15,7 +15,7 @@
layout="total, sizes, prev, pager, next, jumper"></el-pagination> layout="total, sizes, prev, pager, next, jumper"></el-pagination>
</div> </div>
</section> </section>
<section class="container-content"> <section class="container-content" v-if="dailyStorage.length || middleStorage.length || unknownStorage.length">
<div class="dialy-storage" v-if="dailyStorage.length"> <div class="dialy-storage" v-if="dailyStorage.length">
<h3 <h3
class="" class=""
@ -38,7 +38,7 @@
:qty="st.qty ?? 0" :qty="st.qty ?? 0"
:storage="st.name" :storage="st.name"
color="#8899ff" color="#8899ff"
:material="st.material ?? '默认物料'" :material="st.materialName ?? '默认物料'"
:total="2" :total="2"
:unit-value="st.unitDictValue" :unit-value="st.unitDictValue"
:ratio="st.ratio" /> :ratio="st.ratio" />
@ -66,7 +66,7 @@
:qty="st.qty ?? 0" :qty="st.qty ?? 0"
:storage="st.name" :storage="st.name"
color="#99aa11" color="#99aa11"
:material="st.material ?? '默认物料'" :material="st.materialName ?? '默认物料'"
:total="2" :total="2"
:unit-value="st.unitDictValue" :unit-value="st.unitDictValue"
:ratio="st.ratio" /> :ratio="st.ratio" />
@ -94,13 +94,17 @@
:qty="st.qty ?? 0" :qty="st.qty ?? 0"
color="#3388ff" color="#3388ff"
:storage="st.name" :storage="st.name"
:material="st.material ?? '默认物料'" :material="st.materialName ?? '默认物料'"
:total="2" :total="2"
:unit-value="st.unitDictValue" :unit-value="st.unitDictValue"
:ratio="st.ratio" /> :ratio="st.ratio" />
</div> </div>
</div> </div>
</section> </section>
<div v-else style="color: #ccc; letter-spacing: 1px; font-size: 18px; padding: 12px;">
无数据
</div>
</div> </div>
</template> </template>

View File

@ -70,7 +70,7 @@ export default {
deep: true, deep: true,
}, },
"dataForm.description": function (val) { "dataForm.description": function (val) {
console.log("here", val); //console.log("here", val);
if (val === "batch备用服务器") { if (val === "batch备用服务器") {
this.loadData(0); this.loadData(0);
} else { } else {

View File

@ -3,9 +3,9 @@
<div class="base-list-table w-full"> <div class="base-list-table w-full">
<el-table <el-table
:data="tableData" :data="tableData"
:cell-style="{ padding: 0 }"
v-bind="tableConfig" v-bind="tableConfig"
ref="base-list-table" ref="base-list-table"
:cell-style="{ padding: 0 }"
:header-cell-style="/** 重写表格样式 **/ { :header-cell-style="/** 重写表格样式 **/ {
padding: '5px 0', padding: '5px 0',
}" }"
@ -129,7 +129,7 @@ export default {
}, },
methods: { methods: {
handleSubEmitData(payload) { handleSubEmitData(payload) {
// console.log("[component] BaseListTable handleSubEmitData(): ", payload); // //console.log("[component] BaseListTable handleSubEmitData(): ", payload);
this.$emit("operate-event", payload); this.$emit("operate-event", payload);
}, },
loadSubClassFn(tree, treeNode, resolve) { loadSubClassFn(tree, treeNode, resolve) {

View File

@ -126,7 +126,7 @@ export default {
// TODO: ... // TODO: ...
if (field.watch) { if (field.watch) {
// const { index: innerIdx, condition } = field.watch; // const { index: innerIdx, condition } = field.watch;
// console.log("=====field.watch=====", innerIdx, this.searchForm[innerIdx], this.headConfig.fields[innerIdx].default); // //console.log("=====field.watch=====", innerIdx, this.searchForm[innerIdx], this.headConfig.fields[innerIdx].default);
// // // //
// this.$watch( // this.$watch(
// () => this.searchForm[innerIdx], // () => this.searchForm[innerIdx],
@ -136,19 +136,19 @@ export default {
// // queryParams // // queryParams
// // }) // // })
// this.$http(field.url, queryParams).then((res) => { // this.$http(field.url, queryParams).then((res) => {
// console.log("[==>] !!!", queryParams, res); // //console.log("[==>] !!!", queryParams, res);
// // index // // index
// this.searchForm[index] = Math.floor(Math.random() * 10); // this.searchForm[index] = Math.floor(Math.random() * 10);
// }); // });
// } // }
// ); // );
// console.log("[BaseSearchForm] mounted(): ", this.searchForm); // //console.log("[BaseSearchForm] mounted(): ", this.searchForm);
// // // //
// if (this.searchForm[innerIdx]) { // if (this.searchForm[innerIdx]) {
// // TODO: ... // // TODO: ...
// console.log("TODO: ..."); // //console.log("TODO: ...");
// } else { // } else {
// console.log("TODO: ..."); // //console.log("TODO: ...");
// } // }
} }
}); });

View File

@ -80,7 +80,7 @@ export default {
methods: { methods: {
init(id) { init(id) {
this.visible = true; this.visible = true;
console.log("[BatchDialog--detail] init", id); //console.log("[BatchDialog--detail] init", id);
this.batchId = id; this.batchId = id;
this.getBatchDetailList(); this.getBatchDetailList();
}, },
@ -98,7 +98,7 @@ export default {
batchId: this.batchId, batchId: this.batchId,
}, },
}); });
console.log("[BatchDialog] getBatchList", data); //console.log("[BatchDialog] getBatchList", data);
if (code == 0) { if (code == 0) {
this.dataList = data.list; this.dataList = data.list;
this.total = data.total; this.total = data.total;

View File

@ -91,7 +91,7 @@ export default {
data: { code, data, msg }, data: { code, data, msg },
} = await this.$http.get("/pms/blenderBatch/" + batchId); } = await this.$http.get("/pms/blenderBatch/" + batchId);
if (code == 0) { if (code == 0) {
console.log("[BatchDialog] getBatch", data); //console.log("[BatchDialog] getBatch", data);
this.$set(this.dataForm, "id", data.id); this.$set(this.dataForm, "id", data.id);
this.$set(this.dataForm, "batchSize", data.batchSize); this.$set(this.dataForm, "batchSize", data.batchSize);
} else { } else {

View File

@ -148,7 +148,7 @@ export default {
methods: { methods: {
init(id) { init(id) {
this.visible = true; this.visible = true;
console.log("[BatchDialog] init", id); //console.log("[BatchDialog] init", id);
this.blenderOrderId = id; this.blenderOrderId = id;
this.getBatchList(); this.getBatchList();
}, },
@ -166,7 +166,7 @@ export default {
blenderOrderId: this.blenderOrderId, blenderOrderId: this.blenderOrderId,
}, },
}); });
console.log("[BatchDialog] getBatchList", data); //console.log("[BatchDialog] getBatchList", data);
if (code == 0) { if (code == 0) {
this.dataList = data.list; this.dataList = data.list;
this.total = data.total; this.total = data.total;
@ -185,7 +185,7 @@ export default {
}, },
handleOperate({ type, data }) { handleOperate({ type, data }) {
console.log("[BatchDialog] handleOperate", type, data); //console.log("[BatchDialog] handleOperate", type, data);
switch (type) { switch (type) {
case "create": case "create":
this.editDialogVisible = true; this.editDialogVisible = true;

View File

@ -165,7 +165,7 @@ export default {
else if (col.fetchTreeData) { else if (col.fetchTreeData) {
// parentId 0 // parentId 0
col.fetchTreeData().then(({ data: res }) => { col.fetchTreeData().then(({ data: res }) => {
// console.log("[DialogJustForm fetchTreeData -->]", res.data); // //console.log("[DialogJustForm fetchTreeData -->]", res.data);
if (res.code === 0 && res.data) { if (res.code === 0 && res.data) {
if ("list" in res.data) { if ("list" in res.data) {
this.$set(col, "options", res.data.list); this.$set(col, "options", res.data.list);
@ -198,7 +198,7 @@ export default {
row.forEach((col) => { row.forEach((col) => {
if (!col.prop) return; if (!col.prop) return;
if ("injectTo" in col && Array.isArray(col.injectTo)) { if ("injectTo" in col && Array.isArray(col.injectTo)) {
// console.log("watching options ..... ", col); // //console.log("watching options ..... ", col);
col.injectTo.map((item) => { col.injectTo.map((item) => {
const unwatch = this.$watch( const unwatch = this.$watch(
() => this.dataForm[col.prop], () => this.dataForm[col.prop],
@ -264,7 +264,7 @@ export default {
if (excludeId && key === "id") return; if (excludeId && key === "id") return;
this.dataForm[key] = null; this.dataForm[key] = null;
}); });
// console.log("[DialogJustForm resetForm()] clearing form..."); // //console.log("[DialogJustForm resetForm()] clearing form...");
this.$refs.dataForm.clearValidate(); this.$refs.dataForm.clearValidate();
this.$emit("dialog-closed"); // this.$emit("dialog-closed"); //
this.watchList.map((unwatch) => unwatch()); this.watchList.map((unwatch) => unwatch());
@ -277,9 +277,9 @@ export default {
/** init **/ /** init **/
init(id, detailMode) { init(id, detailMode) {
this.visible = true; this.visible = true;
// console.log("[DialogJustForm] init", this.dataForm, id, detailMode); // //console.log("[DialogJustForm] init", this.dataForm, id, detailMode);
if (this.$refs.dataForm) { if (this.$refs.dataForm) {
// console.log("[DialogJustForm] clearing form validation..."); // //console.log("[DialogJustForm] clearing form validation...");
// dialog dataForm [0] // dialog dataForm [0]
this.$refs.dataForm.clearValidate(); this.$refs.dataForm.clearValidate();
} }
@ -306,7 +306,7 @@ export default {
url: file.fileUrl, url: file.fileUrl,
})); }));
} }
// console.log("[DialogJustForm] init():", this.dataForm); // //console.log("[DialogJustForm] init():", this.dataForm);
} else { } else {
this.$message({ this.$message({
message: `${res.code}: ${res.msg}`, message: `${res.code}: ${res.msg}`,
@ -333,22 +333,22 @@ export default {
/** handlers */ /** handlers */
handleSelectChange(col, eventValue) { handleSelectChange(col, eventValue) {
// console.log("[dialog] select change: ", col, eventValue); // //console.log("[dialog] select change: ", col, eventValue);
this.$forceUpdate(); this.$forceUpdate();
}, },
handleSwitchChange(val) { handleSwitchChange(val) {
// console.log("[dialog] switch change: ", val, this.dataForm); // //console.log("[dialog] switch change: ", val, this.dataForm);
}, },
handleComponentModelUpdate(propName, { subject, payload: { data } }) { handleComponentModelUpdate(propName, { subject, payload: { data } }) {
this.dataForm[propName] = JSON.stringify(data); this.dataForm[propName] = JSON.stringify(data);
// console.log("[DialogJustForm] handleComponentModelUpdate", this.dataForm[propName]); // //console.log("[DialogJustForm] handleComponentModelUpdate", this.dataForm[propName]);
}, },
addOrUpdate(method = "POST") { addOrUpdate(method = "POST") {
if ("parentId" in this.dataForm) { if ("parentId" in this.dataForm) {
// console.log("[DialogJustForm parentId]", this.dataForm.parentId); // //console.log("[DialogJustForm parentId]", this.dataForm.parentId);
// parentId cascader ["xxx"]xxx // parentId cascader ["xxx"]xxx
const lastItem = this.dataForm.parentId.length - 1; const lastItem = this.dataForm.parentId.length - 1;
this.dataForm.parentId = this.dataForm.parentId[lastItem]; this.dataForm.parentId = this.dataForm.parentId[lastItem];
@ -400,7 +400,7 @@ export default {
// Object.getOwnPropertyNames(this.dataForm).forEach((prop) => { // Object.getOwnPropertyNames(this.dataForm).forEach((prop) => {
// if (/.*?Time/.test(prop)) { // if (/.*?Time/.test(prop)) {
// console.log("HTTP prop", prop, this.dataForm[prop]); // //console.log("HTTP prop", prop, this.dataForm[prop]);
// } // }
// }); // });
@ -413,7 +413,7 @@ export default {
data: httpPayload, data: httpPayload,
}) })
.then(({ data: res }) => { .then(({ data: res }) => {
// console.log("[add&update] res is: ", res); // //console.log("[add&update] res is: ", res);
this.loadingStatus = false; this.loadingStatus = false;
if (res.code === 0) { if (res.code === 0) {
this.$message.success(method === "POST" ? "添加成功" : "更新成功"); this.$message.success(method === "POST" ? "添加成功" : "更新成功");
@ -438,7 +438,7 @@ export default {
}, },
handleBtnClick(payload) { handleBtnClick(payload) {
// console.log("btn click payload: ", payload); // //console.log("btn click payload: ", payload);
if ("name" in payload) { if ("name" in payload) {
switch (payload.name) { switch (payload.name) {
@ -454,12 +454,12 @@ export default {
break; break;
} }
} else { } else {
console.log("[x] 不是这么用的! 缺少name属性"); //console.log("[x] ! name");
} }
}, },
handleUploadChange(file, fileList) { handleUploadChange(file, fileList) {
// console.log("[Upload] handleUploadChange...", file, fileList); // //console.log("[Upload] handleUploadChange...", file, fileList);
}, },
handleClose() { handleClose() {

View File

@ -110,7 +110,7 @@ export default {
}, },
handleSuccess(response, file, fileList) { handleSuccess(response, file, fileList) {
// console.log("success response", response); // //console.log("success response", response);
if ("code" in response && response.code === 500) { if ("code" in response && response.code === 500) {
this.$message({ this.$message({
@ -141,7 +141,7 @@ export default {
}, },
handleError(err, file, fileList) { handleError(err, file, fileList) {
console.log("err", err); //console.log("err", err);
}, },
handleBtnClick(payload) { handleBtnClick(payload) {
@ -174,7 +174,7 @@ export default {
}, },
handleUploadChange(file, fileList) { handleUploadChange(file, fileList) {
// console.log("[Upload] handleUploadChange...", file, fileList); // //console.log("[Upload] handleUploadChange...", file, fileList);
}, },
handleClose() { handleClose() {

View File

@ -66,7 +66,7 @@ export default {
}, },
methods: { methods: {
handleTabClick(tab) { handleTabClick(tab) {
console.log("handle tab click", tab); //console.log("handle tab click", tab);
if (tab > this.oldActiveTab) this.toLeft = true; if (tab > this.oldActiveTab) this.toLeft = true;
else this.toLeft = false; else this.toLeft = false;
switch (tab) { switch (tab) {
@ -89,7 +89,7 @@ export default {
/** init **/ /** init **/
init(order, detailMode) { init(order, detailMode) {
console.log("init menu dialog,", order); //console.log("init menu dialog,", order);
this.order = order; this.order = order;
this.detailMode = detailMode ?? false; this.detailMode = detailMode ?? false;
this.visible = true; this.visible = true;

View File

@ -156,7 +156,7 @@ export default {
if ("list" in res.data) { if ("list" in res.data) {
this.dataList = res.data.list; this.dataList = res.data.list;
this.totalPage = res.data.total; this.totalPage = res.data.total;
} else console.log("没有res.data.list属性"); }
} else { } else {
this.dataList.splice(0); this.dataList.splice(0);
this.totalPage = 0; this.totalPage = 0;
@ -183,7 +183,7 @@ export default {
/** 处理 表格操作 */ /** 处理 表格操作 */
handleOperate({ type, data }) { handleOperate({ type, data }) {
console.log("payload", type, data); //console.log("payload", type, data);
// component url // component url
// payload: { type: string, data: string | number | object } // payload: { type: string, data: string | number | object }
switch (type) { switch (type) {
@ -211,7 +211,9 @@ export default {
type: "success", type: "success",
duration: 2000, duration: 2000,
onClose: () => { onClose: () => {
this.getAList(Object.assign({}, this.listQuery, this.extraSearchConditions, this.params)); this.getAList(
Object.assign({}, this.listQuery, this.extraSearchConditions, this.params)
);
this.$emit("refresh-tables", ["ongoing"]); this.$emit("refresh-tables", ["ongoing"]);
}, },
}); });
@ -221,7 +223,7 @@ export default {
} }
}) })
.catch((errMsg) => { .catch((errMsg) => {
console.log("ere..."); //console.log("ere...");
this.$message({ this.$message({
message: errMsg, message: errMsg,
type: "error", type: "error",
@ -234,6 +236,60 @@ export default {
case "destroy-order": case "destroy-order":
// //
case "end-order": { case "end-order": {
this.$prompt("确认结束请输入结束备注", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
})
.then(({ value }) => {
return value;
})
.catch(() => {
this.$message({
type: "info",
message: "取消输入",
});
return Promise.reject();
})
.then((value) => {
return this.$http({
method: "post",
url: "/pms/order/end",
headers: {
"Content-Type": "application/json",
},
data: {
id: data,
description: value,
},
});
})
.then(({ data: res }) => {
if (res.code === 0) {
// success
this.$message({
message: "已结束订单!",
type: "success",
duration: 2000,
onClose: () => {
this.getAList(
Object.assign({}, this.listQuery, this.extraSearchConditions, this.params)
);
this.$emit("refresh-tables", ["finished"]);
},
});
} else {
// failed
throw new Error(res.msg);
}
})
.catch((err) => {
this.$message({
type: "error",
message: err,
});
});
return;
this.$confirm(`确定${type === "end-order" ? "结束订单" : "废除订单"}?`, "提示", { this.$confirm(`确定${type === "end-order" ? "结束订单" : "废除订单"}?`, "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
@ -254,7 +310,9 @@ export default {
type: "success", type: "success",
duration: 2000, duration: 2000,
onClose: () => { onClose: () => {
this.getAList(Object.assign({}, this.listQuery, this.extraSearchConditions, this.params)); this.getAList(
Object.assign({}, this.listQuery, this.extraSearchConditions, this.params)
);
this.$emit("refresh-tables", ["finished"]); this.$emit("refresh-tables", ["finished"]);
}, },
}); });
@ -340,13 +398,29 @@ export default {
this.openDialog(data); /** data is ==> id */ this.openDialog(data); /** data is ==> id */
break; break;
} }
case "copy": {
this.$http({
url: "/pms/order/copy",
method: "post",
headers: {
"Content-Type": "application/json",
},
data,
}).then(({ data: res }) => {
if (res.code === 0) {
this.$message.success("复制成功!");
this.getAList(Object.assign({}, this.listQuery, this.extraSearchConditions, this.params));
}
});
break;
}
case "view": case "view":
case "view-detail-action": { case "view-detail-action": {
this.openDialog(data, true); this.openDialog(data, true);
break; break;
} }
case "view-ongoing": { case "view-ongoing": {
console.log("view-ongoing", data); //console.log("view-ongoing", data);
this.openMenuDialog(data, false); this.openMenuDialog(data, false);
break; break;
} }
@ -358,12 +432,12 @@ export default {
}, },
handleBtnClick({ btnName, payload }) { handleBtnClick({ btnName, payload }) {
console.log("SearchForm", btnName, payload); //console.log("SearchForm", btnName, payload);
switch (btnName) { switch (btnName) {
case "查询": { case "查询": {
this.params = Object.assign({}, payload); this.params = Object.assign({}, payload);
console.log("this.params", this.params); //console.log("this.params", this.params);
if ("timerange" in payload) { if ("timerange" in payload) {
// //
if (!!payload.timerange) { if (!!payload.timerange) {
@ -384,6 +458,57 @@ export default {
this.showUploadDialog(payload); this.showUploadDialog(payload);
// alert('/pms/order/importExcelOrder'); // alert('/pms/order/importExcelOrder');
break; break;
case "导出订单":
this.$confirm(`确定要导出订单吗?`, "提示", {
confirmButtonText: "是",
cancelButtonText: "否",
type: "warning",
})
.then(() => {
this.overlayVisible = true;
console.log("导出: ", payload);
return this.$http({
url: "/pms/order/export",
method: "post",
headers: {
"Content-Type": "application/json",
},
responseType: "blob",
});
})
.then(({ data: res }) => {
const blob = new Blob([res]);
/** 通知 */
this.$notify({
title: "成功",
message: "开始下载",
type: "success",
duration: 1200,
});
const fileName = "订单导出.xlsx";
if ("download" in document.createElement("a")) {
const alink = document.createElement("a");
alink.download = fileName;
alink.style.display = "none";
alink.target = "_blank";
alink.href = URL.createObjectURL(blob);
document.body.appendChild(alink);
alink.click();
URL.revokeObjectURL(alink.href);
document.body.removeChild(alink);
} else {
navigator.msSaveBlob(blob, fileName);
}
this.overlayVisible = false;
})
.catch((err) => {
this.$message.error("导出出错!");
this.overlayVisible = false;
});
break;
case "压制工艺": case "压制工艺":
// //
this.$router.push({ name: "pms-shapeStep" }); this.$router.push({ name: "pms-shapeStep" });
@ -421,7 +546,7 @@ export default {
this.renderDialog = true; this.renderDialog = true;
this.$nextTick(() => { this.$nextTick(() => {
// console.log("init dialog", row_id, detail_mode); // //console.log("init dialog", row_id, detail_mode);
this.$refs["order-dialog"].init(/** some args... */ row_id, detail_mode); this.$refs["order-dialog"].init(/** some args... */ row_id, detail_mode);
}); });
}, },

View File

@ -148,7 +148,7 @@ export default {
watch: { watch: {
$route: function (route) { $route: function (route) {
if (route.hash) { if (route.hash) {
console.log("acitive hash", route.hash); //console.log("acitive hash", route.hash);
this.activeTable = route.hash; this.activeTable = route.hash;
} }
}, },
@ -269,7 +269,7 @@ export default {
inject: ["urls"], inject: ["urls"],
mounted() { mounted() {
this.getSpecificList("ongoing", this.conditions.ongoing); this.getSpecificList("ongoing", this.conditions.ongoing);
console.log("[list view with head]", this.headConfigs); //console.log("[list view with head]", this.headConfigs);
}, },
activated() { activated() {
this.refreshLayoutKey = this.layoutTable(); this.refreshLayoutKey = this.layoutTable();
@ -296,7 +296,7 @@ export default {
if ("list" in res.data) { if ("list" in res.data) {
this.dataLists[type] = res.data.list; this.dataLists[type] = res.data.list;
this.totalPage[type] = res.data.total; this.totalPage[type] = res.data.total;
} else console.log("没有res.data.list属性"); }
} else { } else {
this.dataLists[type].splice(0); this.dataLists[type].splice(0);
this.totalPage[type] = 0; this.totalPage[type] = 0;
@ -339,7 +339,7 @@ export default {
}, },
}) })
.then(({ data: res }) => { .then(({ data: res }) => {
console.log("[http response] res is: ", res); //console.log("[http response] res is: ", res);
// page : // page :
if ("list" in res.data) { if ("list" in res.data) {
@ -360,7 +360,7 @@ export default {
/** 处理 表格操作 */ /** 处理 表格操作 */
handleOperate({ type, data }) { handleOperate({ type, data }) {
console.log("payload", type, data); //console.log("payload", type, data);
// component url // component url
// payload: { type: string, data: string | number | object } // payload: { type: string, data: string | number | object }
switch (type) { switch (type) {
@ -404,7 +404,7 @@ export default {
break; break;
} }
case "status": { case "status": {
console.log("status", data); //console.log("status", data);
// TODO: // TODO:
const { id, code } = data; const { id, code } = data;
const queryCondition = { id, code }; const queryCondition = { id, code };
@ -448,13 +448,13 @@ export default {
} }
delete params.timerange; delete params.timerange;
} }
console.log("[search form btn click]", Object.assign({}, this.conditions.ongoing, params)); //console.log("[search form btn click]", Object.assign({}, this.conditions.ongoing, params));
// //
this.getSpecificList("ongoing", Object.assign({}, this.conditions.ongoing, params)); this.getSpecificList("ongoing", Object.assign({}, this.conditions.ongoing, params));
} }
} }
case "pending": case "pending":
console.log("[search form btn click]", type, btnName, payload); //console.log("[search form btn click]", type, btnName, payload);
if (btnName === "压制工艺") { if (btnName === "压制工艺") {
// //
alert("跳转至压制工艺页面"); alert("跳转至压制工艺页面");
@ -470,7 +470,7 @@ export default {
case "finished": case "finished":
break; break;
} }
// console.log("[search] form handleBtnClick", type, btnName, payload); // //console.log("[search] form handleBtnClick", type, btnName, payload);
// switch (btnName) { // switch (btnName) {
// case "": // case "":
// this.openDialog(); // this.openDialog();

View File

@ -85,7 +85,7 @@ export default {
}, },
methods: { methods: {
handleOperate({ type, data: id }) { handleOperate({ type, data: id }) {
console.log("payload", type, id); //console.log("payload", type, id);
switch (type) { switch (type) {
case "blender-edit": case "blender-edit":
this.blenderOrderEditVisible = true; this.blenderOrderEditVisible = true;
@ -108,7 +108,7 @@ export default {
type: "warning", type: "warning",
}) })
.then(() => { .then(() => {
console.log("here"); //console.log("here");
this.$http this.$http
.post(this.urls.detach, id /* { id: data } */, { headers: { "Content-Type": "application/json" } }) .post(this.urls.detach, id /* { id: data } */, { headers: { "Content-Type": "application/json" } })
.then(({ data: res }) => { .then(({ data: res }) => {
@ -159,7 +159,7 @@ export default {
...this.extraQueryFields, ...this.extraQueryFields,
}; };
console.log("getAlist", data, this.pageIsPost); //console.log("getAlist", data, this.pageIsPost);
return this.$http({ return this.$http({
url: this.urls.page ?? this.urls.base + "/page", url: this.urls.page ?? this.urls.base + "/page",

Some files were not shown because too many files have changed in this diff Show More