Procházet zdrojové kódy

更改要事日记值班首长获取

sunyanqiang před 3 roky
rodič
revize
6177abcad3

+ 8 - 0
src/api/grassrootsregistration/bdglmeeting.js

@@ -84,6 +84,14 @@ export function getUser(data) {
     params: { deptId: data }
   })
 }
+// 查询所有人员首长
+export function getUsers(data) {
+  return request({
+    url: '/grassrootsregistration/common/getUser',
+    method: 'get',
+    params: { deptId: data }
+  })
+}
 
 // 获取实力情况
 export function getShiLi(query) {

+ 83 - 76
src/views/grassrootsregistration/bdgldiary/index.vue

@@ -21,7 +21,7 @@
       <div class="tree">
         <el-tree
           class="userAgrees"
-          style="height:700px;overflow:auto;"
+          style="height: 700px; overflow: auto"
           :data="deptOptions"
           :props="defaultProps"
           @node-click="handleNodeClick"
@@ -115,8 +115,8 @@
           <template scope="scope">
             <span>{{
               (queryParams.pageNum - 1) * queryParams.pageSize +
-                scope.$index +
-                1
+              scope.$index +
+              1
             }}</span>
           </template>
         </el-table-column>
@@ -660,7 +660,7 @@
                     <el-time-picker
                       v-model="item1.examineDate"
                       :picker-options="{
-                        selectableRange: '00:00:00 - 23:59:59'
+                        selectableRange: '00:00:00 - 23:59:59',
                       }"
                       placeholder="选择日期时间"
                       value-format="HH:mm:ss"
@@ -733,7 +733,7 @@
                     <el-time-picker
                       v-model="item1.comeDate"
                       :picker-options="{
-                        selectableRange: '00:00:00 - 23:59:59'
+                        selectableRange: '00:00:00 - 23:59:59',
                       }"
                       placeholder="来队时间"
                       value-format="HH:mm:ss"
@@ -753,7 +753,7 @@
                     <el-time-picker
                       v-model="item1.leaveDate"
                       :picker-options="{
-                        selectableRange: '00:00:00 - 23:59:59'
+                        selectableRange: '00:00:00 - 23:59:59',
                       }"
                       placeholder="离队时间"
                       value-format="HH:mm:ss"
@@ -843,7 +843,7 @@ import {
   updateBdgldiary,
   exportBdgldiary,
   exportBdgShuju,
-  updateBdglShenPi
+  updateBdglShenPi,
 } from "@/api/grassrootsregistration/bdgldiary";
 
 import {
@@ -852,7 +852,8 @@ import {
   getUser,
   getShiLi,
   getXunLian,
-  getWeiShu
+  getWeiShu,
+  getUsers,
 } from "@/api/grassrootsregistration/bdglmeeting";
 
 import { getDicts } from "@/api/system/dict/data";
@@ -933,50 +934,50 @@ export default {
         weekwork: null,
         examine: null,
         peopleId1: null,
-        contents: null
+        contents: null,
       },
       // 表单参数
       form: {},
       // 表单校验
       rules: {
         unitId: [
-          { required: true, message: "单位名称不能为空", trigger: "blur" }
+          { required: true, message: "单位名称不能为空", trigger: "blur" },
         ],
         peopleId: [
           // { required: true, message: "值班人员不能为空", trigger: "blur" },
         ],
         blogDate: [
-          { required: true, message: "值班日期不能为空", trigger: "blur" }
+          { required: true, message: "值班日期不能为空", trigger: "blur" },
         ],
         weather: [{ required: true, message: "天气不能为空", trigger: "blur" }],
         lead: [
-          { required: true, message: "值班首长不能为空", trigger: "change" }
+          { required: true, message: "值班首长不能为空", trigger: "change" },
         ],
         orgcadre: [
-          { required: true, message: "编制干部不能为空", trigger: "blur" }
+          { required: true, message: "编制干部不能为空", trigger: "blur" },
         ],
         orgsoldier: [
-          { required: true, message: "编制战士不能为空", trigger: "blur" }
+          { required: true, message: "编制战士不能为空", trigger: "blur" },
         ],
         orgcivilian: [
-          { required: true, message: "编制文职不能为空", trigger: "blur" }
+          { required: true, message: "编制文职不能为空", trigger: "blur" },
         ],
         nowcadre: [
-          { required: true, message: "现有干部不能为空", trigger: "blur" }
+          { required: true, message: "现有干部不能为空", trigger: "blur" },
         ],
         nowsoldier: [
-          { required: true, message: "现有战士不能为空", trigger: "blur" }
+          { required: true, message: "现有战士不能为空", trigger: "blur" },
         ],
         nowcivilian: [
-          { required: true, message: "现有文职不能为空", trigger: "blur" }
-        ]
+          { required: true, message: "现有文职不能为空", trigger: "blur" },
+        ],
       },
       BdgDay: [],
       // 搜索人员
       Renyuan: [],
       // 字典类型查询
       dictType: {
-        dictType: "yssp"
+        dictType: "yssp",
       },
       // 字典数据
       ziDian: [],
@@ -986,12 +987,12 @@ export default {
       pickerOptions: {
         disabledDate(time) {
           return time.getTime() > Date.now();
-        }
+        },
       },
       // 树形配置
       defaultProps: {
         children: "children",
-        label: "label"
+        label: "label",
       },
       // 组织人搜索列表00
       list: [],
@@ -1004,8 +1005,8 @@ export default {
           foremanName: null,
           sentryName: null,
           examineDate: null,
-          dialogue: null
-        }
+          dialogue: null,
+        },
       ],
       //添加对话框来访人员表格为空
       relatives: [
@@ -1014,8 +1015,8 @@ export default {
           name: null,
           relation: null,
           comeDate: null,
-          leaveDate: null
-        }
+          leaveDate: null,
+        },
       ],
       // 临时来队亲属
       relatives: [
@@ -1024,8 +1025,8 @@ export default {
           name: null,
           relation: null,
           comeDate: null,
-          leaveDate: null
-        }
+          leaveDate: null,
+        },
       ],
       // 搜索时间保存
       tiem: null,
@@ -1037,8 +1038,8 @@ export default {
           shouldArrive: null,
           realTo: null,
           percentage: null,
-          organizer: null
-        }
+          organizer: null,
+        },
       ],
       // 数据时间
       DataTime: "",
@@ -1058,7 +1059,7 @@ export default {
       weishenpi: "",
       // 数据时间的保存
       tiems: "",
-      centertext: null
+      centertext: null,
     };
   },
   // updated() {
@@ -1090,7 +1091,7 @@ export default {
       this.opens = false;
       this.statusShen = true;
       const id = row.id || this.ids;
-      getBdgldiary(id).then(response => {
+      getBdgldiary(id).then((response) => {
         if (new Date(response.data.blogDate).getDay() == 0) {
           response.data.week = "星期日";
         } else if (new Date(response.data.blogDate).getDay() == 1) {
@@ -1115,7 +1116,7 @@ export default {
     queDing() {
       this.wordInfo.examine = "1";
       if (this.wordInfo.id != null) {
-        updateBdglShenPi(this.wordInfo).then(response => {
+        updateBdglShenPi(this.wordInfo).then((response) => {
           this.menuRoleVisible = false;
           this.getList();
           this.getShuJu(this.timeDate);
@@ -1125,7 +1126,7 @@ export default {
     },
     // 获取部门数据
     getShuJu(data) {
-      exportBdgShuju(data).then(res => {
+      exportBdgShuju(data).then((res) => {
         this.DataTime = data;
         this.registrationData = res;
         this.cg = res.cg;
@@ -1144,7 +1145,7 @@ export default {
     },
     // 应到人数失去焦点触发
     yinDao() {
-      this.xunlian.forEach(item => {
+      this.xunlian.forEach((item) => {
         if (item.shouldArrive != null && item.realTo != null) {
           var str = ((item.realTo / item.shouldArrive) * 100).toFixed(2);
           str += "%";
@@ -1154,7 +1155,7 @@ export default {
     },
     // 实到人数失去焦点触发
     shiDao() {
-      this.xunlian.forEach(item => {
+      this.xunlian.forEach((item) => {
         if (item.shouldArrive != null && item.realTo != null) {
           var str = ((item.realTo / item.shouldArrive) * 100).toFixed(2);
           str += "%";
@@ -1176,7 +1177,7 @@ export default {
       let s = tiem.getSeconds();
       s = s < 10 ? "0" + s : s;
       let dateTime = y + "-" + m + "-" + d + " " + h + ":" + M + ":" + s;
-      getXunLian(id, dateTime).then(res => {
+      getXunLian(id, dateTime).then((res) => {
         console.log(res.data);
         this.xunlian = res.data;
         // for (var i = 0; i < res.data.length; i++) {
@@ -1212,7 +1213,7 @@ export default {
     },
     /** 新增查询部门下拉树结构 */
     getTreeselect() {
-      getDept().then(response => {
+      getDept().then((response) => {
         this.rese = response.data;
       });
     },
@@ -1224,7 +1225,7 @@ export default {
         foremanName: null,
         sentryName: null,
         examineDate: null,
-        dialogue: null
+        dialogue: null,
       });
     },
 
@@ -1240,7 +1241,7 @@ export default {
         name: null,
         relation: null,
         comeDate: null,
-        leaveDate: null
+        leaveDate: null,
       });
     },
     //删除对话框临时来访人员
@@ -1250,7 +1251,7 @@ export default {
 
     // 获取外面部门树形
     treeselect() {
-      getWeiShu().then(res => {
+      getWeiShu().then((res) => {
         this.deptOptions = res.data;
       });
     },
@@ -1276,12 +1277,12 @@ export default {
         dutyD: null,
         dutyE: null,
         dutyF: null,
-        dutylead: null
+        dutylead: null,
       }),
         (this.relatives = [
           {
-            peopleId: null
-          }
+            peopleId: null,
+          },
         ]);
     },
     // 当点击完成值班时间的选择发起请求
@@ -1293,7 +1294,7 @@ export default {
     },
     // 获取实力情况
     getShiLiRen(id) {
-      getShiLi(id).then(res => {
+      getShiLi(id).then((res) => {
         this.form.orgcadre = res.data.ganbu;
         this.form.orgsoldier = res.data.shiBin;
         this.form.orgcivilian = res.data.wenZhi;
@@ -1318,19 +1319,25 @@ export default {
     },
     // 根据部门获取人员
     getRenYuan(id) {
-      getZhuChiRen(id).then(res => {
+      getZhuChiRen(id).then((res) => {
         this.renYuan = res.data;
       });
     },
     // 获取首长
     getShou(id) {
-      getUser(id).then(res => {
+      getUser(id).then((res) => {
+        this.shouZhang = res.data;
+      });
+    },
+    // 修改里获取首长
+    getShous(id) {
+      getUsers(id).then((res) => {
         this.shouZhang = res.data;
       });
     },
     // 搜索第一个选中触发
     search() {
-      getZhuChiRen(this.queryParams.deptId).then(res => {
+      getZhuChiRen(this.queryParams.deptId).then((res) => {
         this.Renyuan = res.data;
       });
       this.getList();
@@ -1342,7 +1349,7 @@ export default {
     },
     // 字典查询
     getdict() {
-      getDicts(this.dictType.dictType).then(res => {
+      getDicts(this.dictType.dictType).then((res) => {
         // console.log(res);
         this.ziDian = res.data;
       });
@@ -1350,7 +1357,7 @@ export default {
     /** 查询要事日记列表 */
     getList() {
       this.loading = true;
-      listBdgldiary(this.queryParams).then(response => {
+      listBdgldiary(this.queryParams).then((response) => {
         this.bdgldiaryList = response.rows;
         this.total = response.total;
         this.loading = false;
@@ -1403,7 +1410,7 @@ export default {
         peopleId1: null,
         contents: null,
         createId: null,
-        createName: null
+        createName: null,
       };
       (this.relatives = [
         {
@@ -1412,8 +1419,8 @@ export default {
           comeDate: null,
           leaveDate: null,
           peopleId: null,
-          peopleName: null
-        }
+          peopleName: null,
+        },
       ]),
         (this.checkShop = [
           {
@@ -1421,8 +1428,8 @@ export default {
             foremanName: null,
             sentryName: null,
             examineDate: null,
-            dialogue: null
-          }
+            dialogue: null,
+          },
         ]),
         (this.xunlian = [
           {
@@ -1431,8 +1438,8 @@ export default {
             shouldArrive: null,
             realTo: null,
             percentage: null,
-            organizer: null
-          }
+            organizer: null,
+          },
         ]),
         this.resetForm("form");
     },
@@ -1453,7 +1460,7 @@ export default {
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.id);
+      this.ids = selection.map((item) => item.id);
       this.single = selection.length !== 1;
       this.multiple = !selection.length;
     },
@@ -1472,11 +1479,14 @@ export default {
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
+      this.title = "修改要事日记";
       this.getTreeselect();
       this.reset();
       const id = row.id || this.ids;
-      getBdgldiary(id).then(response => {
+      getBdgldiary(id).then((response) => {
         this.form = response.data;
+        //  请求首长
+        this.getShous(this.form.unitId);
         this.xunlian = response.data.weekworkRegisters;
         if (this.xunlian) {
           for (var i = 0; i < this.xunlian.length; i++) {
@@ -1498,16 +1508,18 @@ export default {
               shouldArrive: null,
               realTo: null,
               percentage: null,
-              organizer: null
-            }
+              organizer: null,
+            },
           ];
         }
 
         // 请求人员
         this.getRenYuan(this.form.unitId);
-        //  请求首长
-        this.getShou(this.form.unitId);
         this.open = true;
+        // 临时来对
+        if (response.data.kinsfolk[0].peopleId != null) {
+          this.relatives = response.data.kinsfolk;
+        }
         // 查铺查询
         if (
           response.data.inspect[0].peopleName != null ||
@@ -1518,11 +1530,6 @@ export default {
         ) {
           this.checkShop = response.data.inspect;
         }
-        // 临时来对
-        if (response.data.kinsfolk[0].peopleId != null) {
-          this.relatives = response.data.kinsfolk;
-        }
-        this.title = "修改要事日记";
       });
     },
     //查看按钮操作
@@ -1531,7 +1538,7 @@ export default {
       this.opens = false;
       this.statusShen = false;
       const id = row.id || this.ids;
-      getBdgldiary(id).then(response => {
+      getBdgldiary(id).then((response) => {
         if (new Date(response.data.blogDate).getDay() == 0) {
           response.data.week = "星期日";
         } else if (new Date(response.data.blogDate).getDay() == 1) {
@@ -1558,7 +1565,7 @@ export default {
     /** 提交按钮 */
     submitForm(style) {
       this.style = style;
-      this.$refs["form"].validate(valid => {
+      this.$refs["form"].validate((valid) => {
         if (valid) {
           if (
             (this.relatives[0].name ||
@@ -1577,7 +1584,7 @@ export default {
             this.form.inspect = this.checkShop;
           }
           if (this.form.id != null) {
-            updateBdgldiary(this.form).then(response => {
+            updateBdgldiary(this.form).then((response) => {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.getList();
@@ -1599,7 +1606,7 @@ export default {
             }
             // 训练计划
             this.form.weekworkRegisters = this.xunlian;
-            addBdgldiary(this.form).then(response => {
+            addBdgldiary(this.form).then((response) => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               this.getList();
@@ -1625,7 +1632,7 @@ export default {
       this.$modal
         // .confirm('是否确认删除要事日记编号为"' + ids + '"的数据项?')
         .confirm("是否确认删除该数据?")
-        .then(function() {
+        .then(function () {
           return delBdgldiary(ids);
         })
         .then(() => {
@@ -1643,13 +1650,13 @@ export default {
           this.exportLoading = true;
           return exportBdgldiary(queryParams);
         })
-        .then(response => {
+        .then((response) => {
           this.$download.name(response.msg);
           this.exportLoading = false;
         })
         .catch(() => {});
-    }
-  }
+    },
+  },
 };
 </script>
 

+ 46 - 47
src/views/materialManagement/distribution/index.vue

@@ -219,9 +219,6 @@
         />
       </el-form-item> -->
       <el-form-item>
-        <el-button type="primary" size="btn" @click="handleQuery"
-          >搜索</el-button
-        >
         <el-button size="btr" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
@@ -287,22 +284,28 @@
       :header-cell-style="{ background: '#003C69', color: 'white' }"
     >
       <el-table-column type="selection" width="55" align="center" />
-      <!-- <el-table-column label="主键id" align="center" prop="id" /> -->
-      <el-table-column label="物品类别" align="center" prop="wuPinType">
+      <el-table-column label="序号" align="center">
+        <template scope="scope">
+          <span>{{
+            (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1
+          }}</span>
+        </template>
+      </el-table-column>
+      <!-- <el-table-column label="物品类别" align="center" prop="wuPinType">
         <template slot-scope="scope">
           <dict-tag
             :options="dict.type.category"
             :value="scope.row.wuPinType"
           />
         </template>
-      </el-table-column>
+      </el-table-column> -->
       <el-table-column label="物品名称" align="center" prop="name" />
       <el-table-column
-        label="物规格"
+        label="物规格"
         align="center"
         prop="materialSpecification"
       />
-      <el-table-column label="物型号" align="center" prop="materialXh" />
+      <el-table-column label="物型号" align="center" prop="materialXh" />
       <el-table-column label="营具类型" align="center" prop="yingJuType">
         <template slot-scope="scope">
           <dict-tag
@@ -316,32 +319,35 @@
         align="center"
         prop="responsibilityUnit"
       /> -->
-      <!-- <el-table-column label="责任人" align="center" prop="personLiable" /> -->
       <el-table-column label="出库数量" align="center" prop="putOut" />
-      <!-- <el-table-column label="创建人" align="center" prop="createName" /> -->
+      <el-table-column label="价值" align="center" prop="price" />
       <el-table-column
         label="发放时间"
         align="center"
         prop="putOutTime"
-        width="180"
+        width="120"
       >
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.putOutTime, "{y}-{m}-{d}") }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="存放位置" align="center" prop="storageLocation" />
-      <!-- <el-table-column
-        label="购买时间"
+      <el-table-column
+        label="发放单位"
         align="center"
-        prop="buyingTime"
-        width="180"
-      >
+        prop="responsibilityUnit"
+      />
+      <el-table-column label="发放对象" align="center" prop="outPeople">
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.buyingTime, "{y}-{m}-{d}") }}</span>
+          <dict-tag
+            :options="dict.type.distribution_object"
+            :value="scope.row.outPeople"
+          />
         </template>
-      </el-table-column> -->
-      <el-table-column label="价值" align="center" prop="price" />
-      <el-table-column label="备注" align="center" prop="remark" />
+      </el-table-column>
+      <el-table-column label="接收单位" align="center" prop="outUnit" />
+      <!-- <el-table-column label="接收人" align="center" prop="recipient" /> -->
+      <el-table-column label="存放位置" align="center" prop="storageLocation" />
+      <!-- <el-table-column label="备注" align="center" prop="remark" /> -->
       <el-table-column label="库房" align="center" prop="warehouse">
         <template slot-scope="scope">
           <dict-tag
@@ -350,19 +356,7 @@
           />
         </template>
       </el-table-column>
-      <!-- <el-table-column label="档案id" align="center" prop="archivesId" /> -->
       <el-table-column label="现有数量" align="center" prop="total" />
-      <el-table-column label="发放单位" align="center" prop="outUnit" />
-      <el-table-column label="发放对象" align="center" prop="outPeople">
-        <template slot-scope="scope">
-          <dict-tag
-            :options="dict.type.distribution_object"
-            :value="scope.row.outPeople"
-          />
-        </template>
-      </el-table-column>
-      <el-table-column label="接收人" align="center" prop="recipient" />
-      <!-- <el-table-column label="入库表id" align="center" prop="registrationId" /> -->
       <el-table-column
         label="操作"
         align="center"
@@ -425,7 +419,6 @@
         </el-form-item>
         <el-form-item label="物品名称" prop="name">
           <el-select v-model="form.name" placeholder="请选择物品名称">
-            <!-- <el-option label="请选择字典生成" value="" /> -->
             <el-option
               v-for="(item, i) in itemlist"
               :key="i"
@@ -437,13 +430,13 @@
             </el-option>
           </el-select>
         </el-form-item>
-        <el-form-item label="物规格" prop="materialSpecification">
+        <el-form-item label="物规格" prop="materialSpecification">
           <el-input
             v-model="form.materialSpecification"
-            placeholder="请输入物规格"
+            placeholder="请输入物规格"
           />
         </el-form-item>
-        <el-form-item label="物型号" prop="materialXh">
+        <el-form-item label="物型号" prop="materialXh">
           <el-input v-model="form.materialXh" placeholder="请输入物资型号" />
         </el-form-item>
         <el-form-item label="库房" prop="warehouse">
@@ -495,13 +488,7 @@
           <el-input v-model="form.price" placeholder="请输入价值" />
         </el-form-item>
         <el-form-item label="发放单位" prop="outUnit">
-          <!-- <el-select v-model="form.outUnit" placeholder="请选择发放单位"> -->
-          <treeselect
-            v-model="form.outUnit"
-            placeholder="请选择责任单位"
-            :options="deptOptions"
-            @select="shuxing"
-          ></treeselect>
+          <el-input v-model="form.outUnit" />
         </el-form-item>
         <el-form-item label="发放对象" prop="outPeople">
           <el-select v-model="form.outPeople" placeholder="请选择发放对象">
@@ -510,14 +497,22 @@
               :key="dict.value"
               :label="dict.label"
               :value="dict.value"
+              @click.native="dianJi(dict.value)"
             ></el-option>
           </el-select>
         </el-form-item>
-        <el-form-item label="接收人" prop="recipient">
-          <el-select v-model="form.recipient" placeholder="请选择接收人">
-            <!-- <el-option label="请选择字典生成" value="" /> -->
+        <el-form-item label="接收人" prop="recipientId">
+          <el-select v-model="form.recipientId" placeholder="请选择接收人">
           </el-select>
         </el-form-item>
+        <el-form-item label="接收单位" prop="outUnitId">
+          <treeselect
+            v-model="form.outUnitId"
+            placeholder="请选择接收单位"
+            :options="deptOptions"
+            @select="shuxing"
+          ></treeselect>
+        </el-form-item>
         <div class="jiben">备注</div>
         <el-form-item label="" prop="remark">
           <el-input
@@ -653,6 +648,10 @@ export default {
     this.getList();
   },
   methods: {
+    // 点击发放对象
+    dianJi(value) {
+      console.log(value);
+    },
     // 点击单位触发
     shuxing(data) {
       this.form.unitId = data.id;