update DialogJustForm disabled status

Tento commit je obsažen v:
lb 2023-04-03 15:39:37 +08:00
rodič 4e01129793
revize 697320d744
2 změnil soubory, kde provedl 22 přidání a 12 odebrání

Zobrazit soubor

@ -20,7 +20,7 @@
<el-col v-for="(col, colIndex) in row" :key="colIndex" :span="24 / row.length">
<!-- 通过多个 col === null 可以控制更灵活的 span 大小 -->
<el-form-item v-if="col !== null" :label="col.label" :prop="col.prop" :rules="col.rules || null">
<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="IsNotAvaliable(col)" 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="handleButtonClick(col)">{{
@ -30,7 +30,7 @@
v-if="col.cascader"
v-model="dataForm[col.prop]"
:options="col.options"
:disabled="detailMode"
:disabled="IsNotAvaliable(col)"
v-bind="col.elparams"
></el-cascader>
<el-select v-if="col.forceDisabledSelect" disabled v-model="dataForm[col.prop]" clearable v-bind="col.elparams">
@ -40,7 +40,7 @@
v-if="col.select"
v-model="dataForm[col.prop]"
clearable
:disabled="detailMode"
:disabled="IsNotAvaliable(col)"
v-bind="col.elparams"
@change="handleSelectChange(col, $event)"
>
@ -54,14 +54,14 @@
@change="handleSwitchChange"
:disabled="detailMode"
/>
<el-input v-if="col.textarea" type="textarea" v-model="dataForm[col.prop]" :disabled="detailMode" v-bind="col.elparams" />
<el-date-picker v-if="col.datetime" v-model="dataForm[col.prop]" :disabled="detailMode" v-bind="col.elparams" />
<el-input v-if="col.textarea" type="textarea" v-model="dataForm[col.prop]" :disabled="IsNotAvaliable(col)" v-bind="col.elparams" />
<el-date-picker v-if="col.datetime" v-model="dataForm[col.prop]" :disabled="IsNotAvaliable(col)" v-bind="col.elparams" />
<uploadBtn
v-if="col.upload"
:key="'upload_' + rowIndex + colIndex"
:action="col.actionUrl"
:file-list="dataForm['files']"
:disabled="detailMode"
:disabled="IsNotAvaliable(col)"
v-bind="col.elparams"
@update-file-list="handleFilelistUpdate"
/>
@ -72,7 +72,7 @@
v-model="dataForm[col.prop]"
:options="col.quillConfig ?? defaultQuillConfig"
style="margin-top: 42px"
:disabled="detailMode"
:disabled="IsNotAvaliable(col)"
/>
<div class="" v-if="col.component" style="margin: 42px 0 0">
@ -384,6 +384,9 @@ export default {
},
},
methods: {
IsNotAvaliable(col) {
return this.detailMode || (col.disableOnEdit && this.editMode);
},
handleFilelistUpdate(newFilelist) {
// TODO: 访 .files
this.dataForm.files = newFilelist.map((file) => ({

Zobrazit soubor

@ -104,6 +104,7 @@ export default function () {
optionValue: 'carId',
fetchData: () => this.$http.post("/pms/carHandle/pageView", { page: 1, limit: 999 }),
disableWatcherOnEdit: true,
disableOnEdit: true, // 编辑模式下不可编辑
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入窑车号", filterable: true },
injectTo: [
@ -117,6 +118,7 @@ export default function () {
label: "当前位置",
// options: getDictDataList(),
prop: "posCode",
elparams: { placeholder: "-" },
},
{
forceDisabledSelect: true,
@ -130,6 +132,7 @@ export default function () {
{ label: '摆渡车', value: '3' },
{ label: '空窑车', value: '4' },
],
elparams: { placeholder: "-" },
},
{
select: true,
@ -139,7 +142,8 @@ export default function () {
{ label: '是', value: 'yes' },
{ label: '否', value: 'no', default: true },
],
// rules: { required: true, message: "必选项不能为空", trigger: "blur" },
default: 'no',
rules: { required: true, message: "必选项不能为空", trigger: "blur" },
elparams: { placeholder: "请选择报废状态" },
},
],
@ -154,7 +158,8 @@ export default function () {
hasPrev: 'carId', // 当 carId 改变的时候,也会 fetchData
fetchDataParam: { search: 'carId', get: 'id' }, // 伴随着 hasPrev 出现
fetchData: (hisId) => this.$http.get(`/pms/carHandle/${hisId}`),
disableWatcherOnEdit: true,
disableWatcherOnEdit: true, // 编辑模式下关闭 watcher
disableOnEdit: true, // 编辑模式下不可编辑
rules: { required: true, message: "必选项不能为空", trigger: "blur" },
elparams: { placeholder: "请选择订单" },
injectTo: [
@ -167,19 +172,19 @@ export default function () {
forceDisabled: true,
label: "子号",
prop: "orderCate",
elparams: { placeholder: "" },
elparams: { placeholder: "-" },
},
{
forceDisabled: true,
label: "砖型",
prop: "shapeCode",
elparams: { placeholder: "" },
elparams: { placeholder: "-" },
},
{
forceDisabled: true,
label: "订单砖数",
prop: "orderQty",
elparams: { placeholder: "" },
elparams: { placeholder: "-" },
},
],
[
@ -205,6 +210,7 @@ export default function () {
},
{
input: true,
disableOnEdit: true, // 编辑模式下不可编辑
label: "检测人",
prop: "checkPerson",
// rules: { required: true, message: "必填项不能为空", trigger: "blur" },
@ -212,6 +218,7 @@ export default function () {
},
{
datetime: true,
disableOnEdit: true, // 编辑模式下不可编辑
label: "检测时间",
prop: "checkTime",
rules: { required: true, message: "必填项不能为空", trigger: "blur" },