update 托盘-载砖详情

This commit is contained in:
lb 2023-03-30 11:12:29 +08:00
parent 4a8694ca55
commit 0268af8557
5 changed files with 34 additions and 17 deletions

View File

@ -8,9 +8,11 @@
:width="configs.dialogWidth ?? '50%'"
>
<!-- title -->
<div slot="title" class="dialog-title" style="display: flex; align-items: center;">
<span style="font-size: 18px;">装载详情</span>
<el-button v-if="configs.showAdd ?? false" size="small" type="primary" plain style="margin-left: 16px;" @click="$emit('add-record', id)">添加记录</el-button>
<div slot="title" class="dialog-title" style="display: flex; align-items: center">
<span style="font-size: 18px">装载详情</span>
<el-button v-if="configs.showAdd ?? false" size="small" type="primary" plain style="margin-left: 16px" @click="$emit('add-record', id)"
>添加记录</el-button
>
</div>
<!-- main content -->
@ -59,8 +61,8 @@ export default {
},
updateKey: {
type: Number,
default: 1
}
default: 1,
},
// extraParams: {
// type: Object,
// default: () => ({})
@ -83,10 +85,10 @@ export default {
watch: {
updateKey(val, oldVal) {
if (val !== oldVal) {
this.getList()
}
this.getList();
}
},
},
activated() {
this.refreshLayoutKey = Math.random();
},
@ -120,7 +122,7 @@ export default {
};
this.$http
.get(this.urls.base + `/${this.id}`, {
.get((this.urls.payload ? this.urls.payload : this.urls.base) + `/${this.id}`, {
params,
})
.then(({ data: res }) => {

View File

@ -23,7 +23,9 @@
<el-input v-if="col.input" v-model="dataForm[col.prop]" clearable :disabled="detailMode" v-bind="col.elparams" />
<el-input v-if="col.forceDisabled && col.eraseOnSubmit" v-model="shadowDataForm[col.prop]" disabled v-bind="col.elparams" />
<el-input v-if="col.forceDisabled && !col.eraseOnSubmit" v-model="dataForm[col.prop]" disabled v-bind="col.elparams" />
<el-button type="" plain v-if="col.button" v-bind="col.elparams" style="width: 100%" @click="col.onClick(dataForm.id)">{{ col.label }}</el-button>
<el-button type="" plain v-if="col.button" v-bind="col.elparams" style="width: 100%" @click="handleButtonClick(col)">{{
col.label
}}</el-button>
<el-cascader
v-if="col.cascader"
v-model="dataForm[col.prop]"
@ -359,6 +361,15 @@ export default {
});
},
handleButtonClick(col) {
if (!("onClick" in col)) {
console.log("[handleButtonClick] 配置文件config.js 里没有绑定 onClick");
return;
}
col.onClick.call(this, this.dataForm.id)
},
/** handlers */
handleSelectChange(col, eventValue) {
if ("autoUpdateProp" in col) {

View File

@ -41,6 +41,7 @@
:dialog-visible.sync="dialogVisible"
:configs="dialogConfigs"
@refreshDataList="getList"
@emit-data="handleOperate"
/>
<DialogCarPayload
ref="car-payload-dialog"
@ -295,7 +296,7 @@ export default {
}
case "view-car-record": {
// - from
this.openDialog(data);
this.openDialog(data, true);
break;
}
case "status": {

View File

@ -72,7 +72,7 @@ export default function () {
fetchData: () => this.$http.get("/pms/car/page", { params: { page: 1, limit: 999 } }),
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: {
fliterable: true
disabled: true,
}
},
{
@ -94,16 +94,17 @@ export default function () {
prop: "pos",
// options: getDictDataList(),
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
// elparams: {
elparams: {
// fliterable: true
// }
}
},
{
label: "查看载砖详情",
button: true,
onClick: (id) => {
onClick: function (id) { // 必须用 function 形式
console.log(`查看载砖详情`, id)
this.$emit({ type: 'to-car-payload', data: id })
this.$emit('emit-data', { type: 'to-car-payload', data: id })
}
},
],

View File

@ -3,6 +3,7 @@
:table-config="tableConfig"
:head-config="headFormConfigs"
:dialog-configs="dialogConfigs"
:car-payload-dialog-configs="carPayloadDialogConfigs"
:list-query-extra="[
/** { pos: [] } **/
]"
@ -24,9 +25,10 @@ export default {
};
},
data() {
const { tableConfig, headFormConfigs, urls, dialogConfigs } = initConfig.call(this);
const { tableConfig, headFormConfigs, urls, carPayloadDialogConfigs, dialogConfigs } = initConfig.call(this);
return {
tableConfig,
carPayloadDialogConfigs,
headFormConfigs,
allUrls: urls,
dialogConfigs,