zhp #23

Merged
zhp merged 3 commits from zhp into master 2023-07-17 17:01:47 +08:00
Showing only changes of commit f8dd086cf9 - Show all commits

View File

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2023-02-14 15:02:26
* @LastEditTime: 2023-07-14 15:21:15
* @LastEditTime: 2023-07-14 15:55:36
* @LastEditors: zhp
* @Description:
-->
@ -34,7 +34,7 @@
</el-input>
</el-form-item>
<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>
</el-select>
@ -250,7 +250,7 @@ export default {
this.$nextTick(() => {
this.$refs["dataForm"].resetFields();
if (this.dataForm.id) {
this.getInfo();
this.getInfo()
} else {
}
});
@ -305,9 +305,6 @@ export default {
.catch(() => {
})
},
getProcessList(val) {
console.log(val);
},
//
getInfo() {
this.$http
@ -324,6 +321,41 @@ export default {
.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(
function () {
this.$refs["dataForm"].validate((valid) => {
@ -340,9 +372,8 @@ export default {
type: "success",
duration: 500,
onClose: () => {
console.log(1111);
this.visible = false;
this.$emit("successSubmit");
this.$emit("refreshDataList");
},
});
})