Bläddra i källkod

履职计划前端

luojun 2 år sedan
förälder
incheckning
d7f292a1c8

+ 8 - 2
src/api/resumption/plan.js

@@ -10,14 +10,20 @@ export function list(query) {
 }
 
 // 查询【请填写功能名称】详细
+export function itemfind(id) {
+  return request({
+    url: '/core/api/plan/item/find' + id,
+    method: 'get'
+  })
+}
+
+// 查询【请填写功能名称】详细
 export function get(id) {
   return request({
     url: '/core/api/plan/find/' + id,
     method: 'get'
   })
 }
-
-
 // 修改【请填写功能名称】
 export function update(data) {
   return request({

+ 46 - 49
src/views/resumption/plan/dialog.edit.vue

@@ -149,6 +149,7 @@
             />
           </el-form-item>
         </el-form>
+        <el-button>新增履职内容</el-button>
         <el-table :data="tableData" style="width: 100%">
           <el-table-column
             :prop="propItem.prop"
@@ -164,6 +165,7 @@
                 size="mini"
                 type="text"
                 icon="el-icon-edit"
+                @click="removeRow(index)"
                 >删除</component
               >
             </template>
@@ -185,67 +187,56 @@ import * as api from "@/api/resumption/plan";
 import { statusOptions } from "./../../commonOption";
 
 export default {
+  dicts: ['resumption_plan_type'],
   data() {
     // const params = this.$route.params;
     // let o1=options;
     // let o=statusOptions;
     // debugger
     return {
+      planName: null,
+        planType: null,
+        planCycle: null,
+        planStatus: null,
+        execOrgType: null,
+        roleNames: null,
+
+        count: null,
+        description: null,
       propItem: "",
       propList: [
         {
           label: "是否扫描",
-          prop: "name",
+          prop: "pointScan",
         },
         {
           label: "必须履职",
-          prop: "date",
+          prop: "required",
         },
         {
           label: "履职内容库",
-          prop: "address",
+          prop: "pointName",
         },
         {
           label: "履职项",
-          prop: "address",
+          prop: "itemName",
         },
         {
           label: "履职内容",
-          prop: "address",
+          prop: "itemDesc",
         },
         {
           label: "履职区域",
-          prop: "address",
+          prop: "areaName",
         },
         {
-          label: "履职项",
+          label: "操作",
           prop: "lc-component",
           component: "el-button",
         },
       ],
       row: "",
-      tableData: [
-        {
-          date: "2016-05-02",
-          name: "王小虎",
-          address: "上海市普陀区金沙江路 1518 弄",
-        },
-        {
-          date: "2016-05-04",
-          name: "王小虎",
-          address: "上海市普陀区金沙江路 1517 弄",
-        },
-        {
-          date: "2016-05-01",
-          name: "王小虎",
-          address: "上海市普陀区金沙江路 1519 弄",
-        },
-        {
-          date: "2016-05-03",
-          name: "王小虎",
-          address: "上海市普陀区金沙江路 1516 弄",
-        },
-      ],
+      tableData: [],
       id: null,
       isShow: false,
       formData: this.reset(),
@@ -274,43 +265,49 @@ export default {
     ...mapMutations([]),
     reset() {
       return {
-        id: null,
-        name: null,
-        type: null,
-        orgType: null,
-        status: null,
-        remark: null,
+        planName: null,
+        planType: null,
+        planCycle: null,
+        planStatus: null,
+        execOrgType: null,
+        roleNames: null,
+        count: null,
+        description: null,
+        tableData:null,
+        itemList:null,
       };
     },
-    findItem(id){
-      this.loading = true;
-      api
-        .list(this.queryParams)
-        .then((response) => {
-          this.pageData = response.data.records;
-          this.total = response.data.total;
-          this.loading = false;
-        })
-        .catch(() => {
-          this.loading = false;
-        });
-    },
+    
     async refresh(id, other) {
       this.formData = id ? (await api.get(id)).data : this.reset(other);
     },
     async show(id, other = {}) {
       this.id = id;
+      this.tableData=null;
+      this.formData.itemList=null;
       await this.refresh(id, other);
+      console.log(id)
+      if(id!==undefined){
+        await api.get(id).then((res) => {
+        console.log(res);
+        this.tableData = res.data.itemList;
+      });
+      }
+ 
       this.isShow = true;
     },
-
+    removeRow(index) {
+      this.tableData.splice(index, 1);
+    },
     // 事件
     onHide() {
       this.isShow = false;
     },
     onSubmit() {
       this.$refs.form.validate(async (isValidate) => {
+        console.log(this.formData)
         if (!isValidate) return;
+        this.formData.itemList=this.tableData;
         await api.update(this.formData);
         this.$emit("success");
         this.onHide();

+ 3 - 3
src/views/resumption/plan/index.vue

@@ -26,11 +26,11 @@
               prop="planType"
               label="计划类型"
               v-model="queryParams.planType"
-              placeholder="请选择计划类型"
+              placeholder="请选择22计划类型"
               clearable
             >
               <el-option
-                v-for="dict in dict.type.planType"
+                v-for="dict in dict.type.resumption_plan_type"
                 :key="dict.value"
                 :label="dict.label"
                 :value="dict.value"
@@ -294,7 +294,7 @@ import { statusOptions, getLabel } from "./../../commonOption";
 
 export default {
   name: "resumptionplan",
-  dicts: ["sys_org_type", "rule_type"],
+  dicts: ["sys_org_type", "rule_type","resumption_plan_type"],
   components: {
     DialogEdit,
     OrgTree,