|
|
@@ -1,23 +1,21 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <div class="my-title">变更</div>
|
|
|
+ <div class="my-title">变更通知人设置</div>
|
|
|
+ <!-- 表单 -->
|
|
|
<el-form
|
|
|
:model="dataForm"
|
|
|
:rules="dataRule"
|
|
|
ref="dataForm"
|
|
|
- @keyup.enter.native="dataFormSubmit()"
|
|
|
- label-width="100px"
|
|
|
+ label-width="auto"
|
|
|
>
|
|
|
<el-row class="my-row">
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="变更内容" prop="content">
|
|
|
- <el-input
|
|
|
- type="textarea"
|
|
|
- v-model="dataForm.content"
|
|
|
- placeholder=""
|
|
|
- ></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
+ <el-form-item label="通知接收人" prop="userIds">
|
|
|
+ <user-components
|
|
|
+ v-model="dataForm.userIds"
|
|
|
+ :userIds.sync="dataForm.userIds"
|
|
|
+ @change="userSelectedChanged"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
@@ -28,19 +26,21 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import UserComponents from "../common/user-components";
|
|
|
export default {
|
|
|
name: "material-tech-note-change",
|
|
|
- components: {},
|
|
|
+ components: {
|
|
|
+ UserComponents,
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
- id: 0,
|
|
|
- isEdit: false,
|
|
|
+ visible: false,
|
|
|
dataForm: {
|
|
|
- content: "",
|
|
|
+ userIds: [],
|
|
|
},
|
|
|
dataRule: {
|
|
|
- optionCode: [
|
|
|
- { required: true, message: "请输入方案编码", trigger: "blur" },
|
|
|
+ userIds: [
|
|
|
+ { required: true, message: "请选择通知接收人", trigger: "change" },
|
|
|
],
|
|
|
},
|
|
|
};
|
|
|
@@ -50,33 +50,35 @@ export default {
|
|
|
onChose() {
|
|
|
this.$emit("onChose");
|
|
|
},
|
|
|
- init() {},
|
|
|
+ async init() {
|
|
|
+ this.dataForm = {};
|
|
|
+ this.$http({
|
|
|
+ url: this.$http.adornUrl(
|
|
|
+ `/biz-service/pro-technology-option/noteChangeConfig`
|
|
|
+ ),
|
|
|
+ method: "get",
|
|
|
+ }).then(({ data }) => {
|
|
|
+ if (data && data.code === "200") {
|
|
|
+ this.dataForm = {
|
|
|
+ userIds: data.data,
|
|
|
+ };
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.visible = true;
|
|
|
+ },
|
|
|
+ validateField(type) {
|
|
|
+ this.$refs.dataForm.validateField(type);
|
|
|
+ },
|
|
|
+ // 表单提交
|
|
|
dataFormSubmit() {
|
|
|
this.$refs["dataForm"].validate((valid) => {
|
|
|
if (valid) {
|
|
|
- // 产品技术文件
|
|
|
- let fList = this.fileList;
|
|
|
- if (fList.length > 0) {
|
|
|
- this.dataForm.attachList = [];
|
|
|
- for (let i = 0; i < fList.length; i++) {
|
|
|
- this.dataForm.attachList.push({
|
|
|
- fileName: fList[i].name,
|
|
|
- url: fList[i].url,
|
|
|
- });
|
|
|
- }
|
|
|
- } else {
|
|
|
- this.$message.error("请上传工艺方案附件");
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
this.$http({
|
|
|
- url: !this.id
|
|
|
- ? this.$http.adornUrl(`/biz-service/pro-technology-option/save`)
|
|
|
- : this.$http.adornUrl(
|
|
|
- `/biz-service/pro-technology-option/update`
|
|
|
- ),
|
|
|
+ url: this.$http.adornUrl(
|
|
|
+ `/biz-service/pro-technology-option/noteChangeConfig`
|
|
|
+ ),
|
|
|
method: "post",
|
|
|
- data: this.$http.adornData({ ...this.dataForm, orgId: this.orgId }),
|
|
|
+ data: this.dataForm.userIds,
|
|
|
}).then(({ data }) => {
|
|
|
if (data && data.code === "200") {
|
|
|
this.$message({
|
|
|
@@ -85,7 +87,6 @@ export default {
|
|
|
duration: 1500,
|
|
|
onClose: () => {
|
|
|
this.onChose();
|
|
|
- this.$emit("refreshDataList");
|
|
|
},
|
|
|
});
|
|
|
} else {
|
|
|
@@ -95,6 +96,9 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ userSelectedChanged(val) {
|
|
|
+ this.dataForm.userIds = val;
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|