Ver a proveniência

update

pull/9/head
lb há 1 ano
ascendente
cometimento
a402a8bf63
2 ficheiros alterados com 69 adições e 27 eliminações
  1. +50
    -13
      src/views/quality/base/qualityInspectionDet/index.vue
  2. +19
    -14
      src/views/quality/components/dialogForm.vue

+ 50
- 13
src/views/quality/base/qualityInspectionDet/index.vue Ver ficheiro

@@ -31,6 +31,42 @@

<!-- 对话框(添加 / 修改) -->
<base-dialog
:dialogTitle="title"
:dialogVisible="open"
width="40%"
@close="cancel"
@cancel="cancel"
@confirm="submitForm">
<DialogForm
v-if="open"
ref="form"
:dataForm="form"
:rows="[
[
{
select: true,
label: '检测类型',
prop: 'typeId',
url: '/base/quality-inspection-type/listAll',
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
// bind: {
// disabled: true, // some condition, like detail mode...
// }
},
],
[
{
input: true,
label: '检测内容',
prop: 'content',
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
},
],
[{ input: true, label: '检测编码', prop: 'code' }],
[{ input: true, label: '备注', prop: 'remark' }],
]" />
</base-dialog>
<!-- <base-dialog
:dialogTitle="title"
:dialogVisible="open"
@cancel="cancel"
@@ -55,7 +91,7 @@
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
</el-form>
</base-dialog>
</base-dialog> -->
</div>
</template>

@@ -70,10 +106,11 @@ import {
} from '@/api/base/qualityInspectionDet';

import moment from 'moment';
import DialogForm from '../../components/dialogForm.vue';

export default {
name: 'QualityInspectionDet',
components: {},
components: { DialogForm },
data() {
return {
typeList: [], // 检测类型列表
@@ -209,7 +246,7 @@ export default {
},
/** search bar related */
handleSearchBarBtnClick(btn) {
const keys = ['name', 'createTime']; // timeVal
const keys = ['content', 'createTime']; // timeVal
switch (btn.btnName) {
case 'search':
keys.forEach((key) => {
@@ -218,8 +255,10 @@ export default {
this.queryParams['endTime'] = btn.timeVal[1];
return;
}
console.log('key', key, btn[key])
this.queryParams[key] = btn[key] || null;
});
console.log('queryParams', this.queryParams)
this.handleQuery();
break;
case 'add':
@@ -239,16 +278,14 @@ export default {
},
/** 获取检测类型id */
getTypeList() {
this.$axios('/base/quality-inspection-type/listAll').then(
(response) => {
this.typeList = response.data.map((item) => {
return {
label: item.name,
value: item.id,
};
});
}
);
this.$axios('/base/quality-inspection-type/listAll').then((response) => {
this.typeList = response.data.map((item) => {
return {
label: item.name,
value: item.id,
};
});
});
},
/** 查询列表 */
getList() {


+ 19
- 14
src/views/quality/components/dialogForm.vue Ver ficheiro

@@ -18,10 +18,12 @@
v-if="col.input"
v-model="form[col.prop]"
@change="$emit('update', form)"
:placeholder="`请输入${col.label}`"
v-bind="col.bind" />
<el-select
v-if="col.select"
v-model="form[col.prop]"
:placeholder="`请选择${col.label}`"
@change="$emit('update', form)"
v-bind="col.bind">
<el-option
@@ -73,7 +75,7 @@ export default {
},
data() {
return {
formLoading: false,
formLoading: true,
optionListOf: {},
};
},
@@ -88,10 +90,10 @@ export default {
get() {
return this.dataForm;
},
set(val) {
console.log('set form', val);
// this.$emit('update', val);
},
// set(val) {
// console.log('set form', val);
// // this.$emit('update', val);
// },
},
},
mounted() {
@@ -99,15 +101,16 @@ export default {
this.handleOptions();
},
methods: {
/** 模拟透传 ref */
validate(cb) {
return this.$refs.form.validate(cb);
},
resetFields(args) {
return this.$refs.form.resetFields(args);
},
/** 模拟透传 ref */
validate(cb) {
return this.$refs.form.validate(cb);
},
resetFields(args) {
return this.$refs.form.resetFields(args);
},

handleOptions() {
// console.log("[dialogForm:handleOptions]")
const promiseList = [];
this.rows.forEach((cols) => {
cols.forEach(async (opt) => {
@@ -131,9 +134,11 @@ export default {
);
});
try {
this.formLoading = true;
await Promise.all(promiseList);
// this.formLoading = true;
// console.log("[dialogForm:handleOptions:promiseList]", promiseList)
await Promise.all(promiseList.map((fn) => fn()));
this.formLoading = false;
// console.log("[dialogForm:handleOptions:optionListOf]", this.optionListOf)
} catch (error) {
console.log('[dialogForm:handleOptions:error]', error);
this.formLoading = false;


Carregando…
Cancelar
Guardar