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

View File

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

View File

@ -72,7 +72,7 @@ export default function () {
fetchData: () => this.$http.get("/pms/car/page", { params: { page: 1, limit: 999 } }), fetchData: () => this.$http.get("/pms/car/page", { params: { page: 1, limit: 999 } }),
rules: { required: true, message: "必填项不能为空", trigger: "blur" }, rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { elparams: {
fliterable: true disabled: true,
} }
}, },
{ {
@ -94,16 +94,17 @@ export default function () {
prop: "pos", prop: "pos",
// options: getDictDataList(), // options: getDictDataList(),
rules: { required: true, message: "必填项不能为空", trigger: "blur" }, rules: { required: true, message: "必填项不能为空", trigger: "blur" },
// elparams: { elparams: {
// fliterable: true // fliterable: true
// }
}
}, },
{ {
label: "查看载砖详情", label: "查看载砖详情",
button: true, button: true,
onClick: (id) => { onClick: function (id) { // 必须用 function 形式
console.log(`查看载砖详情`, id) 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" :table-config="tableConfig"
:head-config="headFormConfigs" :head-config="headFormConfigs"
:dialog-configs="dialogConfigs" :dialog-configs="dialogConfigs"
:car-payload-dialog-configs="carPayloadDialogConfigs"
:list-query-extra="[ :list-query-extra="[
/** { pos: [] } **/ /** { pos: [] } **/
]" ]"
@ -24,9 +25,10 @@ export default {
}; };
}, },
data() { data() {
const { tableConfig, headFormConfigs, urls, dialogConfigs } = initConfig.call(this); const { tableConfig, headFormConfigs, urls, carPayloadDialogConfigs, dialogConfigs } = initConfig.call(this);
return { return {
tableConfig, tableConfig,
carPayloadDialogConfigs,
headFormConfigs, headFormConfigs,
allUrls: urls, allUrls: urls,
dialogConfigs, dialogConfigs,