|
@@ -1,7 +1,7 @@
|
|
|
<!--
|
|
|
* @Author: your name
|
|
|
* @Date: 2024-05-27 09:23:37
|
|
|
- * @LastEditTime: 2024-07-05 14:51:22
|
|
|
+ * @LastEditTime: 2024-07-05 16:03:11
|
|
|
* @LastEditors: bogon
|
|
|
* @Description: In User Settings Edit
|
|
|
* @FilePath: /performance-test/src/views/performance/batchMag.vue
|
|
@@ -179,7 +179,11 @@
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="批次名称" prop="batchName">
|
|
|
+ <el-form-item
|
|
|
+ label="批次名称"
|
|
|
+ prop="batchName"
|
|
|
+ v-if="title === '编辑'"
|
|
|
+ >
|
|
|
<el-input
|
|
|
v-model="ruleForm.batchName"
|
|
|
placeholder="请输入批次名称"
|
|
@@ -210,6 +214,7 @@ import {
|
|
|
queryCodeNum,
|
|
|
onOrOffFieldBatch,
|
|
|
deleteFieldBatch,
|
|
|
+ createBatchName,
|
|
|
} from "@/api/performance.js";
|
|
|
export default {
|
|
|
data() {
|
|
@@ -363,21 +368,32 @@ export default {
|
|
|
this.loadingView = true;
|
|
|
switch (this.title) {
|
|
|
case "新增":
|
|
|
- addFieldBatch({ ...this.ruleForm, batchCode: undefined })
|
|
|
- .then((res) => {
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: res.msg,
|
|
|
- });
|
|
|
- // this.loading = false;
|
|
|
- this.getTableList();
|
|
|
- this.nuedialog = false;
|
|
|
- this.loadingView = false;
|
|
|
+ const obj = this.fieldCodeList.find(
|
|
|
+ (item) => item.codeNumber === this.ruleForm.fieldCode
|
|
|
+ );
|
|
|
+ const form = new FormData();
|
|
|
+ form.append("fieldName", obj.fieldName);
|
|
|
+ createBatchName(form).then((results) => {
|
|
|
+ addFieldBatch({
|
|
|
+ ...this.ruleForm,
|
|
|
+ batchName: results.data,
|
|
|
+ batchCode: undefined,
|
|
|
})
|
|
|
- .catch(() => {
|
|
|
- this.loadingView = false;
|
|
|
- // this.loading = false;
|
|
|
- });
|
|
|
+ .then((res) => {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: res.msg,
|
|
|
+ });
|
|
|
+ // this.loading = false;
|
|
|
+ this.getTableList();
|
|
|
+ this.nuedialog = false;
|
|
|
+ this.loadingView = false;
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.loadingView = false;
|
|
|
+ // this.loading = false;
|
|
|
+ });
|
|
|
+ });
|
|
|
|
|
|
break;
|
|
|
case "编辑":
|