bugfix 0706 zentao

Šī revīzija ir iekļauta:
lb 2023-07-06 09:59:08 +08:00
vecāks b8765af77f
revīzija eac4976304
6 mainīti faili ar 62 papildinājumiem un 28 dzēšanām

Parādīt failu

@ -75,9 +75,7 @@
:label="opt.label"
:value="opt.value">
<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] || "-" }}
</span>
</el-option>
@ -187,10 +185,14 @@ export default {
const savedDatalist = {};
const cachedList = {};
const watchList = [];
const resetFields = [];
this.configs.form.rows.forEach((row) => {
row.forEach((col) => {
if (col == null) return
if (col == null) return;
if (!col.disableOnEdit && !col.forceDisabled && !col.forceDisabledSelect) {
resetFields.push(col.prop);
}
if (!col.eraseOnSubmit && col.prop) dataForm[col.prop] = col.default ?? null;
else shadowDataForm[col.prop] = col.default ?? null;
@ -206,6 +208,7 @@ export default {
});
return {
resetFields,
loadingStatus: false,
dataForm,
shadowDataForm,
@ -401,7 +404,7 @@ export default {
this.configs.form.rows.forEach((row) => {
row.forEach((col) => {
if (col == null) return
if (col == null) return;
if (col.fetchData && typeof col.fetchData === "function" && !col.hasPrev) {
getData(col);
}
@ -411,7 +414,7 @@ export default {
/** 必须要遍历两遍 */
this.configs.form.rows.forEach((row) => {
row.forEach((col) => {
if (col == null) return
if (col == null) return;
if (col.fetchData && typeof col.fetchData === "function" && col.hasPrev) {
console.log("[hasPrev] set watcher: ", col.hasPrev);
@ -481,7 +484,7 @@ export default {
IsNotAvaliable(col) {
return this.detailMode || (col.disableOnEdit && this.editMode);
},
handleFilelistUpdate(newFilelist, isDelete=false) {
handleFilelistUpdate(newFilelist, isDelete = false) {
// TODO: 访 .files
this.dataForm.files = newFilelist.map((file) => ({
id: file.id,
@ -492,7 +495,8 @@ export default {
//
// if ("id" in this.dataForm && this.dataForm.id != null) this.addOrUpdate("PUT");
// else
!isDelete && this.$notify({
!isDelete &&
this.$notify({
title: "等待保存",
message: "已添加文件,请手动点击保存!",
type: "warning",
@ -510,6 +514,18 @@ export default {
return notDetailMode && (showAlways || ((editMode || addMode) && permission));
},
resetSpecificFields(fields) {
Object.keys(this.dataForm).forEach((key) => {
// console.log(`${key} ${fields}`, key in fields, fields.indexOf(key))
if (fields.indexOf(key) !== -1) {
// console.log(`key ${key} in fields`)
// this.dataForm[key] = null;
this.$set(this.dataForm, key, null)
}
});
console.log("this.dataform", this.dataForm);
},
resetForm(excludeId = false, immediate = false) {
setTimeout(
() => {
@ -718,6 +734,11 @@ export default {
case "reset":
this.resetForm(true, true); // true means exclude id, immediate execution
break;
case "resetSpecific":
// qualityInspectionRecord config
console.log("resetFields", this.resetFields);
this.resetSpecificFields(this.resetFields);
break;
case "add":
case "update":
this.addOrUpdate(payload.name === "add" ? "POST" : "PUT");

Parādīt failu

@ -11,7 +11,8 @@ import i18n from "@/i18n";
const table = {
sex: {
'0': '男',
'1': '女'
'1': '女',
'2': '保密'
},
userStatus: {
'0': i18n.t('user.status0'),

Parādīt failu

@ -15,6 +15,7 @@
:refresh-layout-key="refreshLayoutKey" />
<el-pagination
v-if="navigator"
class="mt-5 flex justify-end"
@size-change="handleSizeChange"
@current-change="handlePageChange"
@ -50,7 +51,11 @@
filename="bomTemplate.xlsx"
@refresh-list="getList"
@uploadSuccess="getList"
@destroy-dialog="() => { uploadDialogVisible = false }" />
@destroy-dialog="
() => {
uploadDialogVisible = false;
}
" />
<Overlay v-if="overlayVisible" />
</div>
</template>
@ -81,6 +86,10 @@ export default {
Overlay,
},
props: {
navigator: {
type: Boolean,
default: true
},
tableConfig: {
type: Object,
default: () => ({
@ -126,11 +135,11 @@ export default {
this.refreshLayoutKey = this.layoutTable();
},
watch: {
page: val => {
console.log('page changed:', val)
page: (val) => {
console.log("page changed:", val);
},
size: val => {
console.log('size changed:', val)
size: (val) => {
console.log("size changed:", val);
},
triggerUpdate(val, oldVal) {
if (val && val !== oldVal) {
@ -157,7 +166,7 @@ export default {
refreshLayoutKey: null,
uploadDialogVisible: false,
overlayVisible: false,
cachedSearchCondition: {}
cachedSearchCondition: {},
};
},
inject: ["urls"],
@ -177,7 +186,7 @@ export default {
? { ...queryParams, page: this.page, limit: this.size }
: {
page: this.page,
limit: this.size
limit: this.size,
};
if (!queryParams && this.listQueryExtra && this.listQueryExtra.length) {
@ -189,7 +198,7 @@ export default {
});
}
});
this.cachedSearchCondition = Object.assign({}, params)
this.cachedSearchCondition = Object.assign({}, params);
}
this.$http[this.urls.pageIsPostApi ? "post" : "get"](
@ -231,6 +240,8 @@ export default {
id: item._id ?? item.id,
}));
this.totalPage = res.data.total;
} else if (Array.isArray(res.data)) {
this.dataList = res.data
} else {
this.dataList.splice(0);
this.totalPage = 0;
@ -273,7 +284,7 @@ export default {
promptName = data[deleteConfig.promptField];
}
let currenPageListLength = this.dataList.length
let currenPageListLength = this.dataList.length;
//
return this.$confirm(`确定要删除记录 "${promptName}" 吗?`, "提示", {
confirmButtonText: "确认",
@ -296,8 +307,8 @@ export default {
// this.page = 1;
// this.size =
// "defaultPageSize" in this.tableConfig.column ? this.tableConfig.column.defaultPageSize : 20;
if (currenPageListLength == 1) this.page = this.page > 1 ? this.page - 1 : 1
if (currenPageListLength == 1) this.page = this.page > 1 ? this.page - 1 : 1;
this.getList();
} else {
this.$message({
@ -359,7 +370,7 @@ export default {
break;
}
case "view-attachment-justform-version": {
console.log(data)
console.log(data);
break;
}
case "view-recipe": {
@ -573,7 +584,7 @@ export default {
this.openDialog();
return;
}
case "查询": {
case "查询": {
if (typeof payload === "object") {
// BaseSearchForm
Object.assign(this.cachedSearchCondition, payload);

Parādīt failu

@ -4,7 +4,8 @@
:table-config="tableConfig"
:head-config="headFormConfigs"
:dialog-configs="dialogConfigs"
:listQueryExtra="['']" />
:listQueryExtra="['']"
:navigator="false" />
</template>
<script>

Parādīt failu

@ -39,7 +39,7 @@ export default function () {
const headFormFields = [
{
prop: "orderId",
prop: "order",
label: "订单号",
fieldOptionLabel: 'code',
// fieldOptionValue: 'id',
@ -253,7 +253,7 @@ export default function () {
operations: [
{ name: "add", label: "保存", type: "primary", permission: "", showOnEdit: false },
{ name: "update", label: "更新", type: "primary", permission: "", showOnEdit: true },
{ name: "reset", label: "重置", type: "warning", showAlways: true },
{ name: "resetSpecific", label: "重置", type: "warning", showAlways: true },
],
},
};

Parādīt failu

@ -6,11 +6,11 @@ import { timeFilter } from "@/utils/filters";
export default function () {
const tableProps = [
{ type: "index", label: "序号" },
{ prop: "kilnCode", label: "窑炉" },
// { prop: "kilnCode", label: "窑炉" },
{ width: 120, prop: "orderCode", label: "主订单号" },
{ width: 60, prop: "orderCate", label: "子号" },
{ width: 210, prop: "code", label: "检测包装订单号" },
{ width: 60, prop: "percent", label: "进度", filter: (val) => (val !== null && val !== undefined ? val + " %" : "-") },
{ width: 60, prop: "percent1", label: "进度", filter: (val) => (val !== null && val !== undefined ? val + " %" : "-") },
// {
// prop: "statusDictValue",
// label: "订单状态",
@ -18,7 +18,7 @@ export default function () {
// },
// { width: 120, prop: "startTime", label: "开始时间" },
{ width: 120, prop: "shapeCode", label: "砖型" },
{ width: 90, prop: "ai", label: "版本号" },
{ width: 90, prop: "packTech", label: "版本号" },
{ width: 90, prop: "qty1", label: "检测量" },
{ width: 120, prop: "qty1Complete", label: "完成量" },
{ width: 120, prop: "goodqty1", label: "检测合格量" },