修改页面

This commit is contained in:
‘937886381’ 2023-07-14 16:01:10 +08:00
parent 9702f23d55
commit f8dd086cf9

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-02-14 15:02:26 * @Date: 2023-02-14 15:02:26
* @LastEditTime: 2023-07-14 15:21:15 * @LastEditTime: 2023-07-14 15:55:36
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -34,7 +34,7 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item prop="processList" :label="$t('researchquality.processName')"> <el-form-item prop="processList" :label="$t('researchquality.processName')">
<el-select @change="getProcessList" v-model="dataForm.processList" multiple :placeholder="$t('researchquality.processName')"> <el-select v-model="dataForm.processList" multiple :placeholder="$t('researchquality.processName')">
<el-option v-for="item in processList" :key="item.id" :label="item.processName" :value="item.id"> <el-option v-for="item in processList" :key="item.id" :label="item.processName" :value="item.id">
</el-option> </el-option>
</el-select> </el-select>
@ -250,7 +250,7 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs["dataForm"].resetFields(); this.$refs["dataForm"].resetFields();
if (this.dataForm.id) { if (this.dataForm.id) {
this.getInfo(); this.getInfo()
} else { } else {
} }
}); });
@ -305,9 +305,6 @@ export default {
.catch(() => { .catch(() => {
}) })
}, },
getProcessList(val) {
console.log(val);
},
// //
getInfo() { getInfo() {
this.$http this.$http
@ -324,6 +321,41 @@ export default {
.catch(() => {}); .catch(() => {});
}, },
// //
dataFormSubmit() {
this.$refs["dataForm"].validate((valid) => {
if (!valid) {
return false;
}
const processArr = this.dataForm.processList.map((item) => {
return {
id:item
}
})
this.dataForm.processList = processArr
const productTypeArr = this.dataForm.productTypeList.map((item) => {
return {
id: item
}
})
this.dataForm.productTypeList = productTypeArr
this.$http[!this.dataForm.id ? "post" : "put"](this.urlOptions.submitURL, this.dataForm)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.$message({
message: this.$t("prompt.success"),
type: "success",
duration: 500,
onClose: () => {
this.visible = false;
this.$emit("refreshDataList");
},
});
})
.catch(() => { });
});
},
dataFormSubmitHandle: debounce( dataFormSubmitHandle: debounce(
function () { function () {
this.$refs["dataForm"].validate((valid) => { this.$refs["dataForm"].validate((valid) => {
@ -340,9 +372,8 @@ export default {
type: "success", type: "success",
duration: 500, duration: 500,
onClose: () => { onClose: () => {
console.log(1111);
this.visible = false; this.visible = false;
this.$emit("successSubmit"); this.$emit("refreshDataList");
}, },
}); });
}) })