|  | @@ -1,34 +1,60 @@
 | 
	
		
			
				|  |  |  <template>
 | 
	
		
			
				|  |  | -    <div class="rule-type">
 | 
	
		
			
				|  |  | -      <DialogCom
 | 
	
		
			
				|  |  | -        :title="id ? '安全保卫部年度工作计划详情' : '新增安全保卫部年度工作计划'"
 | 
	
		
			
				|  |  | -        :visible.sync="isShow"
 | 
	
		
			
				|  |  | -        @close="onHide"
 | 
	
		
			
				|  |  | -        width="700px"
 | 
	
		
			
				|  |  | -      >
 | 
	
		
			
				|  |  | -        <div class="page-body">
 | 
	
		
			
				|  |  | -          <el-form
 | 
	
		
			
				|  |  | -            :model="formData"
 | 
	
		
			
				|  |  | -            :rules="formDataRules"
 | 
	
		
			
				|  |  | -            size="small"
 | 
	
		
			
				|  |  | -            ref="form"
 | 
	
		
			
				|  |  | -            label-position="right"
 | 
	
		
			
				|  |  | -            label-width="130px"
 | 
	
		
			
				|  |  | -            label-prefix=":"
 | 
	
		
			
				|  |  | +  <div class="rule-type">
 | 
	
		
			
				|  |  | +    <DialogCom
 | 
	
		
			
				|  |  | +      :title="id ? '安全保卫部年度工作计划详情' : '新增安全保卫部年度工作计划'"
 | 
	
		
			
				|  |  | +      :visible.sync="isShow"
 | 
	
		
			
				|  |  | +      @close="onHide"
 | 
	
		
			
				|  |  | +      width="700px"
 | 
	
		
			
				|  |  | +    >
 | 
	
		
			
				|  |  | +      <div class="page-body">
 | 
	
		
			
				|  |  | +        <el-form
 | 
	
		
			
				|  |  | +          :model="formData"
 | 
	
		
			
				|  |  | +          :rules="formDataRules"
 | 
	
		
			
				|  |  | +          size="small"
 | 
	
		
			
				|  |  | +          ref="form"
 | 
	
		
			
				|  |  | +          label-position="right"
 | 
	
		
			
				|  |  | +          label-width="130px"
 | 
	
		
			
				|  |  | +          label-prefix=":"
 | 
	
		
			
				|  |  | +        >
 | 
	
		
			
				|  |  | +          <el-descriptions
 | 
	
		
			
				|  |  | +            class="margin-top"
 | 
	
		
			
				|  |  | +            :column="1"
 | 
	
		
			
				|  |  | +            size="medium"
 | 
	
		
			
				|  |  | +            border
 | 
	
		
			
				|  |  | +            :label-style="labelStyle"
 | 
	
		
			
				|  |  | +            :contentStyle="content_style"
 | 
	
		
			
				|  |  |            >
 | 
	
		
			
				|  |  | -            <el-form-item prop="orgId" label="行社名称:">
 | 
	
		
			
				|  |  | +            <el-descriptions-item
 | 
	
		
			
				|  |  | +              labelClassName="gx_info_label"
 | 
	
		
			
				|  |  | +              label="行社名称"
 | 
	
		
			
				|  |  | +            >
 | 
	
		
			
				|  |  | +              {{ formData.orgName }}
 | 
	
		
			
				|  |  | +            </el-descriptions-item>
 | 
	
		
			
				|  |  | +            <!-- <el-form-item prop="orgId" label="行社名称:">
 | 
	
		
			
				|  |  |                  <el-input
 | 
	
		
			
				|  |  |                :readonly="true"
 | 
	
		
			
				|  |  |                v-model="formData.orgName"
 | 
	
		
			
				|  |  |                :disabled="true"
 | 
	
		
			
				|  |  |              ></el-input>
 | 
	
		
			
				|  |  | -            </el-form-item>
 | 
	
		
			
				|  |  | -            <el-form-item prop="type" label="文件种类:">
 | 
	
		
			
				|  |  | +            </el-form-item> -->
 | 
	
		
			
				|  |  | +            <el-descriptions-item
 | 
	
		
			
				|  |  | +              labelClassName="gx_info_label"
 | 
	
		
			
				|  |  | +              label="文件种类"
 | 
	
		
			
				|  |  | +            >
 | 
	
		
			
				|  |  | +              {{ formData.type }}
 | 
	
		
			
				|  |  | +            </el-descriptions-item>
 | 
	
		
			
				|  |  | +            <!-- <el-form-item prop="type" label="文件种类:">
 | 
	
		
			
				|  |  |                <el-input :disabled="true" :readonly="true"
 | 
	
		
			
				|  |  |                  v-model="formData.type"
 | 
	
		
			
				|  |  |                ></el-input>
 | 
	
		
			
				|  |  | -            </el-form-item>
 | 
	
		
			
				|  |  | -            <el-form-item label="工作年度" prop="year">
 | 
	
		
			
				|  |  | +            </el-form-item> -->
 | 
	
		
			
				|  |  | +            <el-descriptions-item
 | 
	
		
			
				|  |  | +              labelClassName="gx_info_label"
 | 
	
		
			
				|  |  | +              label="工作年度"
 | 
	
		
			
				|  |  | +            >
 | 
	
		
			
				|  |  | +              {{ formData.year }}
 | 
	
		
			
				|  |  | +            </el-descriptions-item>
 | 
	
		
			
				|  |  | +            <!-- <el-form-item label="工作年度" prop="year">
 | 
	
		
			
				|  |  |                    <el-date-picker :disabled="true" :readonly="true"
 | 
	
		
			
				|  |  |                      v-model="formData.year"
 | 
	
		
			
				|  |  |                      :clearable="timeClearable"
 | 
	
	
		
			
				|  | @@ -37,8 +63,8 @@
 | 
	
		
			
				|  |  |                      value-format="yyyy"
 | 
	
		
			
				|  |  |                    >
 | 
	
		
			
				|  |  |                    </el-date-picker>
 | 
	
		
			
				|  |  | -                </el-form-item>
 | 
	
		
			
				|  |  | -            <el-form-item prop="userIds" label="参与人员:" v-if="false">
 | 
	
		
			
				|  |  | +                </el-form-item> -->
 | 
	
		
			
				|  |  | +            <!-- <el-form-item prop="userIds" label="参与人员:" v-if="false">
 | 
	
		
			
				|  |  |                <div>
 | 
	
		
			
				|  |  |                  <el-input :disabled="true" :readonly="true"
 | 
	
		
			
				|  |  |                    v-model="joinedStringArray"
 | 
	
	
		
			
				|  | @@ -46,8 +72,14 @@
 | 
	
		
			
				|  |  |                  ></el-input>
 | 
	
		
			
				|  |  |                  <el-button @click="selectUser">选择</el-button>
 | 
	
		
			
				|  |  |                </div>
 | 
	
		
			
				|  |  | -            </el-form-item>
 | 
	
		
			
				|  |  | -            <el-form-item prop="date" label="文件日期:">
 | 
	
		
			
				|  |  | +            </el-form-item> -->
 | 
	
		
			
				|  |  | +            <el-descriptions-item
 | 
	
		
			
				|  |  | +              labelClassName="gx_info_label"
 | 
	
		
			
				|  |  | +              label="文件日期"
 | 
	
		
			
				|  |  | +            >
 | 
	
		
			
				|  |  | +              {{ formData.date }}
 | 
	
		
			
				|  |  | +            </el-descriptions-item>
 | 
	
		
			
				|  |  | +            <!-- <el-form-item prop="date" label="文件日期:">
 | 
	
		
			
				|  |  |                <el-date-picker :disabled="true" :readonly="true"
 | 
	
		
			
				|  |  |                  v-model="formData.date"
 | 
	
		
			
				|  |  |                  value-format="yyyy-MM-dd"
 | 
	
	
		
			
				|  | @@ -55,179 +87,204 @@
 | 
	
		
			
				|  |  |                  type="date"
 | 
	
		
			
				|  |  |                  :clearable="false"
 | 
	
		
			
				|  |  |                ></el-date-picker>
 | 
	
		
			
				|  |  | -            </el-form-item>
 | 
	
		
			
				|  |  | -  
 | 
	
		
			
				|  |  | -            <el-form-item label="上传附件(word、pdf文件格式)" prop="images">
 | 
	
		
			
				|  |  | +            </el-form-item> -->
 | 
	
		
			
				|  |  | +            <el-descriptions-item
 | 
	
		
			
				|  |  | +              labelClassName="gx_info_label"
 | 
	
		
			
				|  |  | +              label="附件(word、pdf文件格式)"
 | 
	
		
			
				|  |  | +            >
 | 
	
		
			
				|  |  |                <imgs-upload
 | 
	
		
			
				|  |  |                  :limit="5"
 | 
	
		
			
				|  |  |                  v-model="formData.images"
 | 
	
		
			
				|  |  |                  :fileSize="2"
 | 
	
		
			
				|  |  |                ></imgs-upload>
 | 
	
		
			
				|  |  | -            </el-form-item>
 | 
	
		
			
				|  |  | -            <div>
 | 
	
		
			
				|  |  | +            </el-descriptions-item>
 | 
	
		
			
				|  |  | +            <!-- <el-form-item label="上传附件(word、pdf文件格式)" prop="images">
 | 
	
		
			
				|  |  | +              <imgs-upload
 | 
	
		
			
				|  |  | +                :limit="5"
 | 
	
		
			
				|  |  | +                v-model="formData.images"
 | 
	
		
			
				|  |  | +                :fileSize="2"
 | 
	
		
			
				|  |  | +              ></imgs-upload>
 | 
	
		
			
				|  |  | +            </el-form-item> -->
 | 
	
		
			
				|  |  | +            <!-- <el-descriptions-item labelClassName="gx_info_label" label="内容" >
 | 
	
		
			
				|  |  | +            {{
 | 
	
		
			
				|  |  | +            formData.content
 | 
	
		
			
				|  |  | +            }}
 | 
	
		
			
				|  |  | +          </el-descriptions-item> -->
 | 
	
		
			
				|  |  | +          </el-descriptions>
 | 
	
		
			
				|  |  | +          <!-- <div>
 | 
	
		
			
				|  |  |                <el-form-item label="内容" prop="content" v-if="false">
 | 
	
		
			
				|  |  |                  <Editor style="height: 150px" v-model="formData.content"></Editor>
 | 
	
		
			
				|  |  |                </el-form-item>
 | 
	
		
			
				|  |  | -            </div>
 | 
	
		
			
				|  |  | -          </el-form>
 | 
	
		
			
				|  |  | -        </div>
 | 
	
		
			
				|  |  | -  
 | 
	
		
			
				|  |  | -        <div style="margin-top: 100px" slot="footer" class="dialog-footer">
 | 
	
		
			
				|  |  | -         
 | 
	
		
			
				|  |  | -          <!-- <el-button type="primary" @click="onSubmit">确定</el-button> -->
 | 
	
		
			
				|  |  | -          <el-button @click="isShow = false">确定</el-button>
 | 
	
		
			
				|  |  | -        </div>
 | 
	
		
			
				|  |  | -      </DialogCom>
 | 
	
		
			
				|  |  | -      <UserSelector ref="UserSelector" @select="onUserSelect"></UserSelector>
 | 
	
		
			
				|  |  | -    </div>
 | 
	
		
			
				|  |  | -  </template>
 | 
	
		
			
				|  |  | -  
 | 
	
		
			
				|  |  | -  <script>
 | 
	
		
			
				|  |  | -  import { mapState, mapMutations } from "vuex";
 | 
	
		
			
				|  |  | -  import { Add, edit, getaqbwbndjh } from "@/api/safetyBook/aqbwbndjh";
 | 
	
		
			
				|  |  | -  import { deptTreeSelect } from "@/api/system/public";
 | 
	
		
			
				|  |  | -  import UserSelector from "@/components/userSelector/index.vue";
 | 
	
		
			
				|  |  | -  import ImgsUpload from "@/components/ImgsUpload";
 | 
	
		
			
				|  |  | -  import Editor from "@/components/Editor";
 | 
	
		
			
				|  |  | -  export default {
 | 
	
		
			
				|  |  | -    dicts: ["safety_book_type"],
 | 
	
		
			
				|  |  | -    components: { UserSelector, ImgsUpload, Editor },
 | 
	
		
			
				|  |  | -    data() {
 | 
	
		
			
				|  |  | -      return {
 | 
	
		
			
				|  |  | -        id: null,
 | 
	
		
			
				|  |  | -        isShow: false,
 | 
	
		
			
				|  |  | -        timeClearable: true,
 | 
	
		
			
				|  |  | -        formData: this.reset(),
 | 
	
		
			
				|  |  | -        //修改新增中的机构树
 | 
	
		
			
				|  |  | -        deptOptions: [],
 | 
	
		
			
				|  |  | -        formDataRules: {
 | 
	
		
			
				|  |  | -          userIds: [{ required: true, message: "请选择参与人员" }],
 | 
	
		
			
				|  |  | -          date: [{ required: true, message: "请选择记录日期" }],
 | 
	
		
			
				|  |  | -          images: [{ required: true, message: "请选择照片" }],
 | 
	
		
			
				|  |  | -          content: [{ required: true, message: "请输入内容" }],
 | 
	
		
			
				|  |  | -          orgId: [{ required: true, message: "请选择机构" }],
 | 
	
		
			
				|  |  | -        },
 | 
	
		
			
				|  |  | -      };
 | 
	
		
			
				|  |  | -    },
 | 
	
		
			
				|  |  | -  
 | 
	
		
			
				|  |  | -    watch: {},
 | 
	
		
			
				|  |  | -    computed: {
 | 
	
		
			
				|  |  | -      ...mapState([]),
 | 
	
		
			
				|  |  | -      joinedStringArray: {
 | 
	
		
			
				|  |  | -        get() {
 | 
	
		
			
				|  |  | -          if (this.formData.names == null || this.formData.names == undefined) {
 | 
	
		
			
				|  |  | -            this.formData.names = this.formData.userNames.split(", ");
 | 
	
		
			
				|  |  | -          }
 | 
	
		
			
				|  |  | -          return this.formData.names.join(", ");
 | 
	
		
			
				|  |  | -        },
 | 
	
		
			
				|  |  | -        set(value) {
 | 
	
		
			
				|  |  | -          this.formData.names = value.split(", ");
 | 
	
		
			
				|  |  | -        },
 | 
	
		
			
				|  |  | +            </div> -->
 | 
	
		
			
				|  |  | +        </el-form>
 | 
	
		
			
				|  |  | +      </div>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +      <div style="margin-top: 100px" slot="footer" class="dialog-footer">
 | 
	
		
			
				|  |  | +        <!-- <el-button type="primary" @click="onSubmit">确定</el-button> -->
 | 
	
		
			
				|  |  | +        <el-button @click="isShow = false">确定</el-button>
 | 
	
		
			
				|  |  | +      </div>
 | 
	
		
			
				|  |  | +    </DialogCom>
 | 
	
		
			
				|  |  | +    <UserSelector ref="UserSelector" @select="onUserSelect"></UserSelector>
 | 
	
		
			
				|  |  | +  </div>
 | 
	
		
			
				|  |  | +</template>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +<script>
 | 
	
		
			
				|  |  | +import { mapState, mapMutations } from "vuex";
 | 
	
		
			
				|  |  | +import { Add, edit, getaqbwbndjh } from "@/api/safetyBook/aqbwbndjh";
 | 
	
		
			
				|  |  | +import { deptTreeSelect } from "@/api/system/public";
 | 
	
		
			
				|  |  | +import UserSelector from "@/components/userSelector/index.vue";
 | 
	
		
			
				|  |  | +import ImgsUpload from "@/components/ImgsUpload";
 | 
	
		
			
				|  |  | +import Editor from "@/components/Editor";
 | 
	
		
			
				|  |  | +export default {
 | 
	
		
			
				|  |  | +  dicts: ["safety_book_type"],
 | 
	
		
			
				|  |  | +  components: { UserSelector, ImgsUpload, Editor },
 | 
	
		
			
				|  |  | +  data() {
 | 
	
		
			
				|  |  | +    return {
 | 
	
		
			
				|  |  | +      labelStyle: {
 | 
	
		
			
				|  |  | +        color: "#000",
 | 
	
		
			
				|  |  | +        "text-align": "center",
 | 
	
		
			
				|  |  | +        height: "40px",
 | 
	
		
			
				|  |  | +        "min-width": "150px",
 | 
	
		
			
				|  |  | +        "word-break": "keep-all",
 | 
	
		
			
				|  |  |        },
 | 
	
		
			
				|  |  | -    },
 | 
	
		
			
				|  |  | -    methods: {
 | 
	
		
			
				|  |  | -      ...mapMutations([]),
 | 
	
		
			
				|  |  | -  
 | 
	
		
			
				|  |  | -      /** 查询机构树数据 */
 | 
	
		
			
				|  |  | -      getDeptTree() {
 | 
	
		
			
				|  |  | -        deptTreeSelect().then((response) => {
 | 
	
		
			
				|  |  | -          this.deptOptions = response.data;
 | 
	
		
			
				|  |  | -        });
 | 
	
		
			
				|  |  | +      content_style: {
 | 
	
		
			
				|  |  | +        "text-align": "left",
 | 
	
		
			
				|  |  | +        "min-width": "150px",
 | 
	
		
			
				|  |  | +        "word-break": "break-all",
 | 
	
		
			
				|  |  |        },
 | 
	
		
			
				|  |  | -      /** treeSelect组件自定义数据*/
 | 
	
		
			
				|  |  | -      tenantIdnormalizer(node, instanceId) {
 | 
	
		
			
				|  |  | -        if (node.children && !node.children.length) {
 | 
	
		
			
				|  |  | -          delete node.children;
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -        return {
 | 
	
		
			
				|  |  | -          id: node.id,
 | 
	
		
			
				|  |  | -          label: node.shortName,
 | 
	
		
			
				|  |  | -          children: node.children,
 | 
	
		
			
				|  |  | -        };
 | 
	
		
			
				|  |  | +      id: null,
 | 
	
		
			
				|  |  | +      isShow: false,
 | 
	
		
			
				|  |  | +      timeClearable: true,
 | 
	
		
			
				|  |  | +      formData: this.reset(),
 | 
	
		
			
				|  |  | +      //修改新增中的机构树
 | 
	
		
			
				|  |  | +      deptOptions: [],
 | 
	
		
			
				|  |  | +      formDataRules: {
 | 
	
		
			
				|  |  | +        userIds: [{ required: true, message: "请选择参与人员" }],
 | 
	
		
			
				|  |  | +        date: [{ required: true, message: "请选择记录日期" }],
 | 
	
		
			
				|  |  | +        images: [{ required: true, message: "请选择照片" }],
 | 
	
		
			
				|  |  | +        content: [{ required: true, message: "请输入内容" }],
 | 
	
		
			
				|  |  | +        orgId: [{ required: true, message: "请选择机构" }],
 | 
	
		
			
				|  |  |        },
 | 
	
		
			
				|  |  | -  
 | 
	
		
			
				|  |  | -      reset() {
 | 
	
		
			
				|  |  | -        return {
 | 
	
		
			
				|  |  | -          id: null,
 | 
	
		
			
				|  |  | -          // names: [],
 | 
	
		
			
				|  |  | -          // userIds: [],
 | 
	
		
			
				|  |  | -          date: null,
 | 
	
		
			
				|  |  | -          images: [],
 | 
	
		
			
				|  |  | -          // content: null,
 | 
	
		
			
				|  |  | -          title: null,
 | 
	
		
			
				|  |  | -          orgId:null,
 | 
	
		
			
				|  |  | -          type:"工作计划",
 | 
	
		
			
				|  |  | -          year:null,
 | 
	
		
			
				|  |  | -        };
 | 
	
		
			
				|  |  | -      },
 | 
	
		
			
				|  |  | -      async refresh(id) {
 | 
	
		
			
				|  |  | -        if (id != null && id != undefined) {
 | 
	
		
			
				|  |  | -          await getaqbwbndjh(id).then((res) => {
 | 
	
		
			
				|  |  | -            // this.formData.names = res.data.userNames.split(",");
 | 
	
		
			
				|  |  | -            this.formData = res.data;
 | 
	
		
			
				|  |  | -            // this.formData.year=res.data.year;
 | 
	
		
			
				|  |  | -          });
 | 
	
		
			
				|  |  | +    };
 | 
	
		
			
				|  |  | +  },
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  watch: {},
 | 
	
		
			
				|  |  | +  computed: {
 | 
	
		
			
				|  |  | +    ...mapState([]),
 | 
	
		
			
				|  |  | +    joinedStringArray: {
 | 
	
		
			
				|  |  | +      get() {
 | 
	
		
			
				|  |  | +        if (this.formData.names == null || this.formData.names == undefined) {
 | 
	
		
			
				|  |  | +          this.formData.names = this.formData.userNames.split(", ");
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | +        return this.formData.names.join(", ");
 | 
	
		
			
				|  |  |        },
 | 
	
		
			
				|  |  | -      async show(id) {
 | 
	
		
			
				|  |  | -        // console.log(id, "id");
 | 
	
		
			
				|  |  | -        this.getDeptTree();
 | 
	
		
			
				|  |  | -        this.formData = this.reset();
 | 
	
		
			
				|  |  | -        this.id = id;
 | 
	
		
			
				|  |  | -        await this.refresh(id);
 | 
	
		
			
				|  |  | -        this.isShow = true;
 | 
	
		
			
				|  |  | +      set(value) {
 | 
	
		
			
				|  |  | +        this.formData.names = value.split(", ");
 | 
	
		
			
				|  |  |        },
 | 
	
		
			
				|  |  | -  
 | 
	
		
			
				|  |  | -      // 事件
 | 
	
		
			
				|  |  | -      onHide() {
 | 
	
		
			
				|  |  | -        this.formData = this.reset();
 | 
	
		
			
				|  |  | -        this.$refs.form.resetFields();
 | 
	
		
			
				|  |  | -      },
 | 
	
		
			
				|  |  | -      onSubmit() {
 | 
	
		
			
				|  |  | -        console.log(this.formData, "this.formData");
 | 
	
		
			
				|  |  | -        this.$refs.form.validate(async (isValidate) => {
 | 
	
		
			
				|  |  | -          if (!isValidate) return;
 | 
	
		
			
				|  |  | -          if (this.id == null || this.id == undefined) {
 | 
	
		
			
				|  |  | -            await Add(this.formData).then((res) => {
 | 
	
		
			
				|  |  | -              this.$emit("success");
 | 
	
		
			
				|  |  | -              this.isShow = false;
 | 
	
		
			
				|  |  | -            });
 | 
	
		
			
				|  |  | -          } else {
 | 
	
		
			
				|  |  | -            await edit(this.formData).then((res) => {
 | 
	
		
			
				|  |  | -              this.$emit("success");
 | 
	
		
			
				|  |  | -              this.isShow = false;
 | 
	
		
			
				|  |  | -            });
 | 
	
		
			
				|  |  | -          }
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +  },
 | 
	
		
			
				|  |  | +  methods: {
 | 
	
		
			
				|  |  | +    ...mapMutations([]),
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    /** 查询机构树数据 */
 | 
	
		
			
				|  |  | +    getDeptTree() {
 | 
	
		
			
				|  |  | +      deptTreeSelect().then((response) => {
 | 
	
		
			
				|  |  | +        this.deptOptions = response.data;
 | 
	
		
			
				|  |  | +      });
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    /** treeSelect组件自定义数据*/
 | 
	
		
			
				|  |  | +    tenantIdnormalizer(node, instanceId) {
 | 
	
		
			
				|  |  | +      if (node.children && !node.children.length) {
 | 
	
		
			
				|  |  | +        delete node.children;
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +      return {
 | 
	
		
			
				|  |  | +        id: node.id,
 | 
	
		
			
				|  |  | +        label: node.shortName,
 | 
	
		
			
				|  |  | +        children: node.children,
 | 
	
		
			
				|  |  | +      };
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    reset() {
 | 
	
		
			
				|  |  | +      return {
 | 
	
		
			
				|  |  | +        id: null,
 | 
	
		
			
				|  |  | +        // names: [],
 | 
	
		
			
				|  |  | +        // userIds: [],
 | 
	
		
			
				|  |  | +        date: null,
 | 
	
		
			
				|  |  | +        images: [],
 | 
	
		
			
				|  |  | +        // content: null,
 | 
	
		
			
				|  |  | +        title: null,
 | 
	
		
			
				|  |  | +        orgId: null,
 | 
	
		
			
				|  |  | +        type: "工作计划",
 | 
	
		
			
				|  |  | +        year: null,
 | 
	
		
			
				|  |  | +      };
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    async refresh(id) {
 | 
	
		
			
				|  |  | +      if (id != null && id != undefined) {
 | 
	
		
			
				|  |  | +        await getaqbwbndjh(id).then((res) => {
 | 
	
		
			
				|  |  | +          // this.formData.names = res.data.userNames.split(",");
 | 
	
		
			
				|  |  | +          this.formData = res.data;
 | 
	
		
			
				|  |  | +          // this.formData.year=res.data.year;
 | 
	
		
			
				|  |  |          });
 | 
	
		
			
				|  |  | -      },
 | 
	
		
			
				|  |  | -      //选择用户回调
 | 
	
		
			
				|  |  | -      onUserSelect(data) {
 | 
	
		
			
				|  |  | -        var ids = data.map((obj) => obj.id);
 | 
	
		
			
				|  |  | -        var names = data.map((obj) => obj.name);
 | 
	
		
			
				|  |  | -        this.formData.userIds = ids;
 | 
	
		
			
				|  |  | -        this.formData.names = names;
 | 
	
		
			
				|  |  | -        this.formData.userNames = names.join(",");
 | 
	
		
			
				|  |  | -        //   console.log(this.formData.userIds, "this.formData.userIds");
 | 
	
		
			
				|  |  | -      },
 | 
	
		
			
				|  |  | -      //用户选择
 | 
	
		
			
				|  |  | -      selectUser(event) {
 | 
	
		
			
				|  |  | -        //   event.preventDefault();
 | 
	
		
			
				|  |  | -        this.$refs.UserSelector.show();
 | 
	
		
			
				|  |  | -      },
 | 
	
		
			
				|  |  | -  
 | 
	
		
			
				|  |  | -      // 事件
 | 
	
		
			
				|  |  | -      //apimark//
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    async show(id) {
 | 
	
		
			
				|  |  | +      // console.log(id, "id");
 | 
	
		
			
				|  |  | +      this.getDeptTree();
 | 
	
		
			
				|  |  | +      this.formData = this.reset();
 | 
	
		
			
				|  |  | +      this.id = id;
 | 
	
		
			
				|  |  | +      await this.refresh(id);
 | 
	
		
			
				|  |  | +      this.isShow = true;
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    // 事件
 | 
	
		
			
				|  |  | +    onHide() {
 | 
	
		
			
				|  |  | +      this.formData = this.reset();
 | 
	
		
			
				|  |  | +      this.$refs.form.resetFields();
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    onSubmit() {
 | 
	
		
			
				|  |  | +      console.log(this.formData, "this.formData");
 | 
	
		
			
				|  |  | +      this.$refs.form.validate(async (isValidate) => {
 | 
	
		
			
				|  |  | +        if (!isValidate) return;
 | 
	
		
			
				|  |  | +        if (this.id == null || this.id == undefined) {
 | 
	
		
			
				|  |  | +          await Add(this.formData).then((res) => {
 | 
	
		
			
				|  |  | +            this.$emit("success");
 | 
	
		
			
				|  |  | +            this.isShow = false;
 | 
	
		
			
				|  |  | +          });
 | 
	
		
			
				|  |  | +        } else {
 | 
	
		
			
				|  |  | +          await edit(this.formData).then((res) => {
 | 
	
		
			
				|  |  | +            this.$emit("success");
 | 
	
		
			
				|  |  | +            this.isShow = false;
 | 
	
		
			
				|  |  | +          });
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +      });
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    //选择用户回调
 | 
	
		
			
				|  |  | +    onUserSelect(data) {
 | 
	
		
			
				|  |  | +      var ids = data.map((obj) => obj.id);
 | 
	
		
			
				|  |  | +      var names = data.map((obj) => obj.name);
 | 
	
		
			
				|  |  | +      this.formData.userIds = ids;
 | 
	
		
			
				|  |  | +      this.formData.names = names;
 | 
	
		
			
				|  |  | +      this.formData.userNames = names.join(",");
 | 
	
		
			
				|  |  | +      //   console.log(this.formData.userIds, "this.formData.userIds");
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    //用户选择
 | 
	
		
			
				|  |  | +    selectUser(event) {
 | 
	
		
			
				|  |  | +      //   event.preventDefault();
 | 
	
		
			
				|  |  | +      this.$refs.UserSelector.show();
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | -    mounted() {},
 | 
	
		
			
				|  |  | -  };
 | 
	
		
			
				|  |  | -  </script>
 | 
	
		
			
				|  |  | -  
 | 
	
		
			
				|  |  | -  <style lang="scss" scoped>
 | 
	
		
			
				|  |  | -  .brand_info {
 | 
	
		
			
				|  |  | -    .el-form {
 | 
	
		
			
				|  |  | -      width: 600px;
 | 
	
		
			
				|  |  | -      padding-top: 40px;
 | 
	
		
			
				|  |  | -    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    // 事件
 | 
	
		
			
				|  |  | +    //apimark//
 | 
	
		
			
				|  |  | +  },
 | 
	
		
			
				|  |  | +  mounted() {},
 | 
	
		
			
				|  |  | +};
 | 
	
		
			
				|  |  | +</script>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +<style lang="scss" scoped>
 | 
	
		
			
				|  |  | +.brand_info {
 | 
	
		
			
				|  |  | +  .el-form {
 | 
	
		
			
				|  |  | +    width: 600px;
 | 
	
		
			
				|  |  | +    padding-top: 40px;
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  | -  </style>
 | 
	
		
			
				|  |  | -  
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +</style>
 |