Prechádzať zdrojové kódy

Merge branch 'master' of http://101.43.194.146:10101/root/supervision-ui

liangjiahao 3 rokov pred
rodič
commit
47d9906fc8

+ 55 - 45
src/views/grassrootsregistration/bdglfood/index.vue

@@ -135,7 +135,12 @@
     />
 
     <!-- 添加或修改伙食管理登记薄对话框 -->
-    <el-dialog :title="title" :visible.sync="open" width="1016px" append-to-body>
+    <el-dialog
+      :title="title"
+      :visible.sync="open"
+      width="1016px"
+      append-to-body
+    >
       <el-form
         ref="form"
         :model="form"
@@ -211,7 +216,7 @@
             width="920"
             cellspacing="0"
             align="center"
-            style="border-color: white; margin: 0px;"
+            style="border-color: white; margin: 0px"
           >
             <tr align="center">
               <td colspan="2">主食内容:</td>
@@ -261,7 +266,7 @@
               width="920"
               cellspacing="0"
               align="center"
-              style="border-color: white;margin: 0px;"
+              style="border-color: white; margin: 0px"
             >
               <tr align="center">
                 <td>面粉</td>
@@ -366,7 +371,7 @@
             width="920"
             cellspacing="0"
             align="center"
-            style="border-color: white;margin: 0px;"
+            style="border-color: white; margin: 0px"
           >
             <tr align="center">
               <td colspan="2">主食内容:</td>
@@ -416,7 +421,7 @@
               width="920"
               cellspacing="0"
               align="center"
-              style="border-color: white;margin: 0px;"
+              style="border-color: white; margin: 0px"
             >
               <tr align="center">
                 <td>面粉</td>
@@ -521,7 +526,7 @@
             width="920"
             cellspacing="0"
             align="center"
-            style="border-color: white;margin: 0px;"
+            style="border-color: white; margin: 0px"
           >
             <tr align="center">
               <td colspan="2">主食内容:</td>
@@ -571,7 +576,7 @@
               width="920"
               cellspacing="0"
               align="center"
-              style="border-color: white;margin: 0px;"
+              style="border-color: white; margin: 0px"
             >
               <tr align="center">
                 <td>面粉</td>
@@ -670,7 +675,7 @@
         </div>
 
         <div class="jiben">实物检查验收</div>
-        <div class="box3" >
+        <div class="box3">
           <el-form v-for="(item, i) in acceptance" :key="i">
             <el-form-item label="" prop="">
               <el-select v-model="item.distinctions" placeholder="请选择">
@@ -719,7 +724,7 @@
                 type="primary"
                 icon="el-icon-plus"
                 size="mini"
-                v-if="i==acceptance.length-1 "
+                v-if="i == acceptance.length - 1"
                 @click="tianJia"
               ></el-button>
               <el-button
@@ -734,7 +739,7 @@
         </div>
 
         <div class="jiben">采购食材</div>
-        <div class="box3" >
+        <div class="box3">
           <el-form v-for="(item1, i) in caiGou" :key="i + ' '">
             <el-form-item label="" prop="">
               <el-select v-model="item1.distinction" placeholder="请选择">
@@ -785,8 +790,8 @@
               <el-button
                 type="primary"
                 icon="el-icon-plus"
-                 @click="tianJia1"
-                v-if="i==caiGou.length-1 "
+                @click="tianJia1"
+                v-if="i == caiGou.length - 1"
                 size="mini"
               ></el-button>
               <el-button
@@ -801,7 +806,7 @@
         </div>
 
         <div class="jiben">交/退伙食费</div>
-        <div class="box3" >
+        <div class="box3">
           <el-form v-for="(item2, i) in expenses" :key="i + 's'">
             <el-form-item label="" prop="">
               <el-select v-model="item2.peopleId" placeholder="姓名">
@@ -847,7 +852,7 @@
                 type="primary"
                 icon="el-icon-plus"
                 size="mini"
-                 v-if="i==expenses.length-1 "
+                v-if="i == expenses.length - 1"
                 @click="tianJia2"
               ></el-button>
               <el-button
@@ -862,7 +867,7 @@
         </div>
 
         <div class="jiben">在食堂购物</div>
-        <div class="box3" >
+        <div class="box3">
           <el-form v-for="(item3, i) in canteen" :key="i + 'p'">
             <el-form-item label="" prop="">
               <el-select v-model="item3.peopleId" placeholder="姓名">
@@ -940,14 +945,14 @@
                 type="primary"
                 icon="el-icon-plus"
                 size="mini"
-                v-if="i==canteen.length-1 "
+                v-if="i == canteen.length - 1"
                 @click="tianJia3"
               ></el-button>
               <el-button
                 type="primary"
                 icon="el-icon-delete"
                 size="mini"
-                 @click="jtDelete3(i)"
+                @click="jtDelete3(i)"
                 v-if="i > 0"
               ></el-button>
             </el-form-item>
@@ -961,7 +966,7 @@
             width="920"
             cellspacing="0"
             align="center"
-            style="border-color: white; margin: 0px;"
+            style="border-color: white; margin: 0px"
           >
             <tr align="center">
               <td colspan="2" width="150">炊事人员及食堂卫生:</td>
@@ -1194,7 +1199,7 @@ export default {
           peopleId: null,
           type: null,
           sky: null,
-          syandard: null,
+          standard: null,
           money: null,
         },
       ],
@@ -1239,7 +1244,7 @@ export default {
     this.getList();
   },
   methods: {
-      //增加实物检查验收表单
+    //增加实物检查验收表单
     tianJia() {
       this.acceptance.push({
         distinctions: null,
@@ -1275,7 +1280,7 @@ export default {
         peopleId: null,
         type: null,
         sky: null,
-        syandard: null,
+        standard: null,
         money: null,
       });
     },
@@ -1284,22 +1289,21 @@ export default {
       this.expenses.splice(i, 1);
     },
     //添加在食堂购物表单
-    tianJia3(){
+    tianJia3() {
       this.canteen.push({
         peopleId: null,
-          zName: null,
-          zWeight: null,
-          zMoney: null,
-          total: null,
-          fName: null,
-          fWeight: null,
-          fMoney: null,
-          qName: null,
-          qWeight: null,
-          qMoney: null,
-      })
+        zName: null,
+        zWeight: null,
+        zMoney: null,
+        total: null,
+        fName: null,
+        fWeight: null,
+        fMoney: null,
+        qName: null,
+        qWeight: null,
+        qMoney: null,
+      });
     },
-    //删除在食堂购物表单
     //点击删除腿交伙食费
     jtDelete3(i) {
       this.canteen.splice(i, 1);
@@ -1451,7 +1455,7 @@ export default {
             peopleId: null,
             type: null,
             sky: null,
-            syandard: null,
+            standard: null,
             money: null,
           },
         ]),
@@ -1511,9 +1515,8 @@ export default {
     },
     /** 新增按钮操作 */
     handleAdd() {
-       // 人员列表
-      this.renYuan= [],
-      this.reset();
+      // 人员列表
+      (this.renYuan = []), this.reset();
       this.getShu();
       this.getdict();
       this.open = true;
@@ -1526,6 +1529,7 @@ export default {
       this.getShu();
       const id = row.id || this.ids;
       getBdglfood(id).then((response) => {
+        console.log(response);
         this.form = response.data;
         this.getdict();
         this.getRen(this.form.unitId);
@@ -1545,15 +1549,18 @@ export default {
         // 实物检查验收
         this.acceptance = response.data.bdglFoodKinds;
         // 采购食材
+        console.log(response.data.bdglFoodProcurements, "点");
         this.caiGou = response.data.bdglFoodProcurements;
         // 交/退伙食费
         this.expenses = response.data.bdglFoodBoardWagess;
         // 在食堂购物
         this.canteen = response.data.bdglFoodShoppings;
         // 后厨
-        this.form.peopleIds = response.data.peopleIds.split(",");
-        this.arr = this.form.peopleIds;
-        this.form.peopleIds = this.arr.map((i) => parseInt(i, 0));
+        if (response.data.peopleIds !== null) {
+          this.form.peopleIds = response.data.peopleIds.split(",");
+          this.arr = this.form.peopleIds;
+          this.form.peopleIds = this.arr.map((i) => parseInt(i, 0));
+        }
         this.open = true;
         this.title = "修改伙食管理登记薄";
       });
@@ -1571,6 +1578,7 @@ export default {
             this.Arr.push(this.zhongCan);
             this.Arr.push(this.wanCan);
             this.form.bdglFoodMeal = this.Arr;
+            console.log(this.form.bdglFoodMeal);
             // 赋值字段
             this.form.bdglFoodKinds = this.acceptance;
             // 采购食物
@@ -1586,11 +1594,12 @@ export default {
             });
           } else {
             // 转换字符串
-            this.form.peopleIds = this.form.peopleIds.join(",");
+            console.log(11);
+            if (this.form.peopleIds !== null) {
+              this.form.peopleIds = this.form.peopleIds.join(",");
+            }
             // 追加元素
-            this.Arr.push(this.meal);
-            this.Arr.push(this.zhongCan);
-            this.Arr.push(this.wanCan);
+            this.Arr.push(this.meal, this.zhongCan, this.wanCan);
             this.form.bdglFoodMeal = this.Arr;
             // 赋值字段
             this.form.bdglFoodKinds = this.acceptance;
@@ -1600,6 +1609,7 @@ export default {
             this.form.bdglFoodBoardWagess = this.expenses;
             // 在食堂购物
             this.form.bdglFoodShoppings = this.canteen;
+            console.log(this.form);
             addBdglfood(this.form).then((response) => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;