Procházet zdrojové kódy

Merge branch 'dev' of http://10.87.10.227:4000/jzyd_yyds/soc_web into dev

luowei před 2 roky
rodič
revize
4402cdc188

+ 7 - 7
src/api/resumption/taskManger.js

@@ -1,9 +1,9 @@
 import request from "@/utils/request";
 
 // 查询【请填写功能名称】列表
-export function list(query) {
+export function page(query) {
   return request({
-    url: "/core/resumption/list",
+    url: "/core/resumption/record/page",
     method: "get",
     params: query,
   });
@@ -13,7 +13,7 @@ export function list(query) {
 export function getPlans(args) {
   return request({
     url: "/core/resumption/record/plan",
-    method: "post",
+    method: "get",
     params: args,
   });
 }
@@ -21,8 +21,8 @@ export function getPlans(args) {
 //获取执行岗位
 export function getRoles(args) {
   return request({
-    url: "/core/resumption/role",
-    method: "post",
+    url: "/core/resumption/record/role",
+    method: "get",
     params: args,
   });
 }
@@ -37,9 +37,9 @@ export function exportResumptionRecord(args) {
 /**
  * 查询
  */
-export function oneNew(args) {
+export function one(args) {
   return request({
-    url: "/core/resumption/" + args,
+    url: "/core/resumption/record/" + args,
     method: "get",
     params: query,
   });

+ 21 - 17
src/components/FileUpload/index.vue

@@ -13,12 +13,12 @@
       ref="fileUpload"
     >
       <!-- 上传按钮 -->
-      <el-button size="mini" type="primary">{{btnName}}</el-button>
+      <el-button size="mini" type="primary">{{ btnName }}</el-button>
       <!-- 上传提示 -->
       <div class="el-upload__tip" slot="tip" v-if="showTip">
         请上传
-        <template v-if="fileSize"> 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b> </template>
-        <template v-if="fileType"> 格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b> </template>
+        <template v-if="fileSize"> 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b></template>
+        <template v-if="fileType"> 格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b></template>
         的文件
       </div>
     </el-upload>
@@ -38,13 +38,13 @@
 </template>
 
 <script>
-import { getToken } from "@/utils/auth";
+import {getToken} from "@/utils/auth";
 import {upload} from "@/api/system/public";
 
 export default {
   name: "FileUpload",
   props: {
-    
+
     // 值
     value: [String, Object, Array],
     // 数量限制
@@ -60,14 +60,14 @@ export default {
     // 文件类型, 例如['png', 'jpg', 'jpeg']
     fileType: {
       type: Array,
-      default: () => ["doc", "xls", "ppt", "txt", "pdf","et","zip"],
+      default: () => ["doc", "xls", "ppt", "txt", "pdf", "et", "zip"],
     },
     // 是否显示提示
     isShowTip: {
       type: Boolean,
       default: true
     },
-    btnName:{
+    btnName: {
       type: String,
       default: "选取文件",
     },
@@ -93,7 +93,7 @@ export default {
           // 然后将数组转为对象数组
           this.fileList = list.map(item => {
             if (typeof item === "string") {
-              item = { name: item, url: item };
+              item = {name: item, url: item};
             }
             item.uid = item.uid || new Date().getTime() + temp++;
             return item;
@@ -150,7 +150,7 @@ export default {
     // 上传成功回调
     handleUploadSuccess(res, file) {
       if (res.code === 200) {
-        this.uploadList.push({ name: res.data.url, url: res.data.url });
+        this.uploadList.push({name: res.data.url, url: res.data.url});
         this.uploadedSuccessfully();
       } else {
         this.number--;
@@ -185,19 +185,19 @@ export default {
     },
 
     //自定义上传方式(自带的成功回调及失败回调会失效)
-    uploadFile(fileObj){
-      console.log(fileObj,'fileObj')
+    uploadFile(fileObj) {
+      console.log(fileObj, 'fileObj')
       let formData = new FormData();
-      formData.append('file',fileObj.file);
-      upload(formData,'image').then(res=>{
+      formData.append('file', fileObj.file);
+      upload(formData, 'image').then(res => {
         /*上传成功*/
         this.$modal.closeLoading();
-        let imgUrl = process.env.VUE_APP_BASE_API + res.data.url;
+        //let imgUrl = process.env.VUE_APP_BASE_API + res.data.url;
         let arr = [];
-        arr.push({ name: res.data.name, url: imgUrl})
+        arr.push({name: res.data.name, url: res.data.url})
         this.fileList = arr;
         this.$emit("input", this.listToString(this.fileList));
-      }).catch(err=>{
+      }).catch(err => {
         /*上传失败*/
         this.$modal.closeLoading();
         this.uploadedSuccessfully();
@@ -213,7 +213,8 @@ export default {
       for (let i in list) {
         strs += list[i].url + separator;
       }
-      return strs != '' ? strs.substr(0, strs.length - 1) : '';
+
+      return strs != '' ? strs.substring(0, strs.length - 1) : '';
     }
   }
 };
@@ -223,18 +224,21 @@ export default {
 .upload-file-uploader {
   margin-bottom: 5px;
 }
+
 .upload-file-list .el-upload-list__item {
   border: 1px solid #e4e7ed;
   line-height: 2;
   margin-bottom: 10px;
   position: relative;
 }
+
 .upload-file-list .ele-upload-list__item-content {
   display: flex;
   justify-content: space-between;
   align-items: center;
   color: inherit;
 }
+
 .ele-upload-list__item-content-action .el-link {
   margin-right: 10px;
 }

+ 35 - 15
src/views/core/materials/index.vue

@@ -4,7 +4,7 @@
       <!--机构数据-->
       <el-col :span="4" :xs="24">
         <k-org-tree v-model="queryParams.orgId" @defaultKey="getDefaultKey" @checkChange="checkChange"
-                  @click="clickTreeNode"></k-org-tree>
+                    @click="clickTreeNode"></k-org-tree>
       </el-col>
       <!--用户数据-->
       <el-col :span="20" :xs="24">
@@ -100,14 +100,14 @@
           </el-table-column>
           <el-table-column label="上传人" align="center" prop="createBy"/>
           <el-table-column label="上传时间" align="center" prop="createTime"/>
-          <el-table-column label="附件" align="center" prop="file"/>
+          <el-table-column label="附件" align="center" prop="fileList"/>
           <el-table-column label="备注" align="center" prop="remark"/>
 
           <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
             <template slot-scope="scope">
               <!-- 公开 按钮显示逻辑: 仅当前用户上传的学习资料且处于未公开状态-->
               <el-button
-                v-if="checkCanEditOpen(scope.row)&&scope.row.isOpen===0"
+                v-if="checkCanEditOpen(scope.row)&&scope.row.isOpen==0"
                 size="mini"
                 type="text"
                 icon="el-icon-edit"
@@ -176,8 +176,8 @@
         <el-form-item label="备注" prop="remark">
           <el-input v-model="form.remark" placeholder="请输入备注"/>
         </el-form-item>
-        <el-form-item label="附件" prop="file">
-          <file-upload v-model="form.file"/>
+        <el-form-item label="附件" prop="fileList">
+          <file-upload ref="upload" @input="getFileList" v-model="form.fileList"/>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -185,6 +185,7 @@
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
+    c
   </div>
 </template>
 
@@ -205,7 +206,7 @@ import kOrgTree from "@/components/k-orgTree/index.vue";
 
 export default {
   name: "Materials",
-  components: {OrgTree,kOrgTree},
+  components: {OrgTree, kOrgTree},
   data() {
     return {
       // 遮罩层
@@ -245,10 +246,10 @@ export default {
         content: null,
         orgId: null,
         isOpen: null,
-        file: null
       },
       // 表单参数
       form: {},
+
       // 表单校验
       rules: {},
       //默认选中节点
@@ -260,7 +261,8 @@ export default {
       }, {
         label: "未公开",
         value: 0
-      }]
+      }],
+      fileList: []
     };
   },
   watch: {
@@ -291,12 +293,19 @@ export default {
         this.deptOptions = response.data;
       });
     },
-
+    getFileList() {
+      //循环获取this.$refs.upload.fileList中的name和url,放到 this.form.fileList中去
+      let fileList = [];
+      for (let i = 0; i < this.$refs.upload.fileList.length; i++) {
+        fileList.push({name: this.$refs.upload.fileList[i].name, url: this.$refs.upload.fileList[i].url})
+      }
+      this.fileList = JSON.stringify(fileList);
+    },
     checkCanEditOrDel(row) {
-      return row.createBy === this.$store.getters.userId && row.isOpen === 0;
+      return row.createId == this.$store.getters.userId && row.isOpen == 0;
     },
     checkCanEditOpen(row) {
-      return row.createBy === this.$store.getters.userId;
+      return row.createId == this.$store.getters.userId;
     },
 
     // 节点单击事件
@@ -321,11 +330,9 @@ export default {
         knowledgeId: null,
         content: null,
         orgId: this.queryParams.orgId,
-        orgName: this.queryParams.orgName,
-        orgPath: this.queryParams.orgPath,
         isOpen: null,
-        file: null,
         remark: null,
+        fileList: null,
       };
       this.resetForm("form");
       this.initKnowledgeList();
@@ -417,6 +424,9 @@ export default {
       this.reset();
       const id = row.id || this.ids
       getMaterials(id).then(response => {
+        let fileList = response.data.fileList;
+        this.form.fileList = JSON.parse(fileList);
+        this.$emit("input", this.listToString(this.form.fileList));
         this.form = response.data;
         this.open = true;
         this.title = "修改学习资料";
@@ -424,9 +434,11 @@ export default {
     },
     /** 提交按钮 */
     submitForm() {
+
       this.$refs["form"].validate(valid => {
-        console.log("this.form",this.form)
         if (valid) {
+          this.form.fileList = this.fileList;
+          console.log('55555', this.form.fileList)
           if (this.form.id != null) {
             updateMaterials(this.form).then(response => {
               this.$modal.msgSuccess("修改成功");
@@ -443,6 +455,14 @@ export default {
         }
       });
     },
+    listToString(list, separator) {
+      let strs = "";
+      separator = separator || ",";
+      for (let i in list) {
+        strs += list[i].url + separator;
+      }
+      return strs != '' ? strs.substring(0, strs.length - 1) : '';
+    },
     /** 导出按钮操作 */
     handleExport() {
       this.download('core/materials/export', {

+ 1 - 0
src/views/resumption/plan/dialog.edit.vue

@@ -354,6 +354,7 @@ export default {
           pointName:selectList[i].pointName,
           areaName:selectList[i].areaName,
           itemId:selectList[i].itemId,
+          id:selectList[i].id,
         }
         if(this.tableData==null){
           this.tableData=[];

+ 1 - 0
src/views/resumption/plan/index.vue

@@ -168,6 +168,7 @@
             type="index"
             label="序号"
             v-if="columns[0].visible"
+            :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
           ></el-table-column>
           <el-table-column
             prop="planName"

+ 7 - 6
src/views/resumption/protection/index.vue

@@ -62,6 +62,7 @@
               icon="el-icon-search"
               size="mini"
               @click="getList"
+              v-hasPermi="['device:protection']"
               >搜索</el-button
             >
             <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
@@ -79,7 +80,7 @@
               icon="el-icon-plus"
               size="mini"
               @click="handleAdd()"
-              v-hasPermi="['core:protection:add']"
+              v-hasPermi="['device:protection:add']"
               >新增</el-button
             >
           </el-col>
@@ -166,7 +167,7 @@
                 type="text"
                 icon="el-icon-edit"
                 @click="updateStatus(r.row.id, 1)"
-                v-hasPermi="['core:protection:status']"
+                v-hasPermi="['device:protection:maintain']"
                 >布防</el-button
               >
               <el-button
@@ -174,7 +175,7 @@
                 type="text"
                 icon="el-icon-edit"
                 @click="updateStatus(r.row.id, 0)"
-                v-hasPermi="['core:protection:status']"
+                v-hasPermi="['device:protection:maintain']"
                 >撤防</el-button
               >
               <el-button
@@ -182,7 +183,7 @@
                 type="text"
                 icon="el-icon-edit"
                 @click="onEdit(r.row.id)"
-                v-hasPermi="['core:protection:edit']"
+                v-hasPermi="['device:protection:edit']"
                 >修改</el-button
               >
               <el-button
@@ -190,7 +191,7 @@
                 type="text"
                 icon="el-icon-edit"
                 @click="onHistory(r.row)"
-                v-hasPermi="['core:protection:edit']"
+                v-hasPermi="['device:protection']"
                 >布撤防历史</el-button
               >
               <el-popover
@@ -202,7 +203,7 @@
                   size="mini"
                   type="text"
                   icon="el-icon-delete"
-                  v-hasPermi="['core:protection:remove']"
+                  v-hasPermi="['device:protection:remove']"
                   slot="reference"
                   >删除</el-button
                 >

+ 4 - 3
src/views/resumption/rule/index.vue

@@ -69,6 +69,7 @@
               icon="el-icon-search"
               size="mini"
               @click="getList"
+              v-hasPermi="['resumption:rule:query']"
               >搜索</el-button
             >
             <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
@@ -86,7 +87,7 @@
               icon="el-icon-plus"
               size="mini"
               @click="handleAdd()"
-              v-hasPermi="['system:user:add']"
+              v-hasPermi="['resumption:rule:add']"
               >新增</el-button
             >
           </el-col>
@@ -177,14 +178,14 @@
                 type="text"
                 icon="el-icon-edit"
                 @click="onEdit(r.row.id)"
-                v-hasPermi="['system:user:edit']"
+                v-hasPermi="['resumption:rule:edit']"
               >修改</el-button>
               <el-button
                 size="mini"
                 type="text"
                 icon="el-icon-delete"
                 @click="onDel(r.row.id)"
-                v-hasPermi="['system:user:remove']"
+                v-hasPermi="['resumption:rule:remove']"
               >删除</el-button>              
             </template>
           </el-table-column>

+ 4 - 1
src/views/resumption/ruleManager/index.vue

@@ -57,6 +57,7 @@
               icon="el-icon-search"
               size="mini"
               @click="getList"
+              v-hasPermi="['resumption:ruleManager']"
               >搜索</el-button
             >
             <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
@@ -71,6 +72,7 @@
               type="primary"
               @click="onAddItem()"
               :disabled="rule ? false : true"
+              v-hasPermi="['resumption:ruleManager:add']"
               >新 增</el-button
             ><el-button
               type="primary"
@@ -172,6 +174,7 @@
                 size="small"
                 icon="el-icon-edit"
                 @click="onEditItem(scope.row.id)"
+                v-hasPermi="['resumption:ruleManager:edit']"
                 >编辑</el-button
               > 
                     
@@ -179,7 +182,7 @@
                 title="将删除履职项及其下所有履职内容,确定删除?"
                 @confirm="deldata(scope.row.id)"
               >
-                <el-button type="text" size="small" slot="reference" icon="el-icon-delete">删除</el-button>
+                <el-button type="text" size="small" slot="reference" icon="el-icon-delete" v-hasPermi="['resumption:ruleManager:remove']">删除</el-button>
               </el-popconfirm>
             </template>
           </el-table-column>

+ 141 - 106
src/views/resumption/taskManager/dialog.detail.vue

@@ -1,119 +1,154 @@
 <template>
-    <div>
-        <el-dialog :title="title + '详情'" :visible.sync="isShow" width="1200px" :destroy-on-close="true">
-            <el-table :data="tableData" row-key="itemId" height="441" style="max-height: 450px;overflow-y: auto;" default-expand-all>
-                <!-- align="left" -->
-                <el-table-column type="expand">
-                    <template slot-scope="props">
-                        <el-table v-if="props.row.dataInfoList" :data="props.row.dataInfoList">
-                            <el-table-column label="检查要点编号" align="center" :show-overflow-tooltip="true"
-                                prop="rulePointNum">
-                            </el-table-column>
-                            <el-table-column label="检查要点" align="center" :show-overflow-tooltip="true"
-                                prop="rulePointName">
-                            </el-table-column>
-                            <el-table-column label="安防类型" align="center" :show-overflow-tooltip="true" prop="safeType">
-                            </el-table-column>
-                            <el-table-column label="检查区域" align="center" :show-overflow-tooltip="true"
-                                prop="checkAreaName">
-                            </el-table-column>
-                            <el-table-column label="执行结果" align="center" :show-overflow-tooltip="true"
-                               >
-                                 <template slot-scope="scope">
-                                   <span style="color: green;" v-if="scope.row.executeFlag =='001' ">{{scope.row.executeResult}}</span>
-                                    <span style="color: red;" v-else-if="scope.row.executeFlag == '002' ">{{scope.row.executeResult}}</span>
-                                    </template>
-                     
-                            </el-table-column>
-                            <el-table-column label="执行时间" align="center" :show-overflow-tooltip="true"
-                                prop="executeTime">
-                                     </el-table-column>
-                            <el-table-column label="检查图片" align="center">
-                                <template slot-scope="scope">
-                                    <div class="block" v-for="img in scope.row.appResumptionDataImgList">
-                                        <el-image style="width: 50px; height: 50px;margin-right: 5px;" :src="img.imgPath" fit="fit"
-                                            :preview-src-list="imgPreviewSrcList(scope.row.appResumptionDataImgList)">
-                                        </el-image>
-                                    </div>
-                                </template>
-                            </el-table-column>
-                            <el-table-column label="描述" align="center" :show-overflow-tooltip="true" prop="resRemark">
-                            </el-table-column>
-
-                            <!-- 0 待履职,1 按时完成,3 未完成,5 补登完成 -->
-                            <!-- <el-table-column label="状态" align="center" :show-overflow-tooltip="true">
-                                <template slot-scope="scope">
-                                    <span style="color: blue;" v-if="scope.row.executeStatus == 0">待履职</span>
-                                    <span style="color: green;" v-else-if="scope.row.executeStatus == 1">按时完成</span>
-                                    <span style="color: red;" v-else-if="scope.row.executeStatus == 3">未完成</span>
-                                    <span style="color:orange;" v-else-if="scope.row.executeStatus == 5">补登完成</span>
-                                </template>
-                            </el-table-column> -->
-                        </el-table>
-                    </template>
-                </el-table-column>
-                 <el-table-column label="检查项编号" align="center" prop="itemNum" :show-overflow-tooltip="true" />
-                <el-table-column label="检查项" align="center" prop="itemName" :show-overflow-tooltip="true" />
-                <el-table-column label="标准及其要求" align="center" :show-overflow-tooltip="true" prop="itemDesc">
-                </el-table-column>
+  <div>
+    <el-dialog
+      :title="title + '详情'"
+      :visible.sync="isShow"
+      width="1200px"
+      :destroy-on-close="true"
+    >
+      <el-table
+        :data="tableData"
+        row-key="itemId"
+        height="441"
+        style="max-height: 450px; overflow-y: auto"
+        default-expand-all
+      >
+        <!-- align="left" -->
+        <el-table-column type="expand">
+          <template slot-scope="props">
+            <el-table
+              v-if="props.row.dataInfoList"
+              :data="props.row.dataInfoList"
+            >
+              <el-table-column
+                label="履职内容"
+                align="center"
+                :show-overflow-tooltip="true"
+                prop="pointName"
+              >
+              </el-table-column>
+              <el-table-column
+                label="履职区域"
+                align="center"
+                :show-overflow-tooltip="true"
+                prop="areaName"
+              >
+              </el-table-column>
+              <el-table-column
+                label="履职结果"
+                align="center"
+                :show-overflow-tooltip="true"
+              >
+                <template slot-scope="scope">
+                  <span
+                    style="color: green"
+                    v-if="scope.row.executeFlag == '001'"
+                    >{{ scope.row.executeResult }}</span
+                  >
+                  <span
+                    style="color: red"
+                    v-else-if="scope.row.executeFlag == '002'"
+                    >{{ scope.row.executeResult }}</span
+                  >
+                </template>
+              </el-table-column>
+              <el-table-column
+                label="履职时间"
+                align="center"
+                :show-overflow-tooltip="true"
+                prop="executeTime"
+              >
+              </el-table-column>
+              <el-table-column label="履职图片" align="center">
+                <template slot-scope="scope">
+                  <div
+                    class="block"
+                    v-for="img in scope.row.appResumptionDataImgList"
+                  >
+                    <el-image
+                      style="width: 50px; height: 50px; margin-right: 5px"
+                      :src="img.imgPath"
+                      fit="fit"
+                      :preview-src-list="
+                        imgPreviewSrcList(scope.row.appResumptionDataImgList)
+                      "
+                    >
+                    </el-image>
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column
+                label="问题描述"
+                align="center"
+                :show-overflow-tooltip="true"
+                prop="resRemark"
+              >
+              </el-table-column>
             </el-table>
-            <div slot="footer" class="dialog-footer">
-                <el-button @click="onHide">取消</el-button>
-            </div>
-        </el-dialog>
-    </div>
+          </template>
+        </el-table-column>
+        <el-table-column
+          label="履职项"
+          align="center"
+          prop="itemName"
+          :show-overflow-tooltip="true"
+        />
+      </el-table>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="onHide">取消</el-button>
+      </div>
+    </el-dialog>
+  </div>
 </template>
 <script>
 import * as api from "@/api/resumption/taskManger.js";
 export default {
-    data() {
-        return {
-            isShow: false,
-            title: "",
-            tableData: [],
-        }
+  data() {
+    return {
+      isShow: false,
+      title: "",
+      tableData: [],
+    };
+  },
+  methods: {
+    async refresh(id) {
+      let detail = await api.one(id);
+      if (detail && detail.length > 0) {
+        this.tableData = detail;
+      } else {
+        this.tableData = [];
+      }
     },
-    methods: {
-        async refresh(id) {
-            let detail = await api.one(id);
-            if (detail && detail.length > 0) {
-                this.tableData = detail;
-            }
-            else {
-                this.tableData = [];
-            }
-        },
-        async show(id, title) {
-            // console.log(id,title);
-            this.title = title;
-            await this.refresh(id);
-            this.isShow = true;
-        },
-        onHide() {
-            this.isShow = false;
-        },
-        reset() {
-            this.tableData = [];
-        },
-        imgPreviewSrcList(imgList)
-        {
-            let srcList=[];
-            imgList.forEach(element => {
-                srcList.push(element.imgPath)
-            });
-            return srcList;
-        }
+    async show(id, title) {
+      // console.log(id,title);
+      this.title = title;
+      await this.refresh(id);
+      this.isShow = true;
     },
-}
+    onHide() {
+      this.isShow = false;
+    },
+    reset() {
+      this.tableData = [];
+    },
+    imgPreviewSrcList(imgList) {
+      let srcList = [];
+      imgList.forEach((element) => {
+        srcList.push(element.imgPath);
+      });
+      return srcList;
+    },
+  },
+};
 </script>
 
 <style lang="scss">
 .block {
-    // padding: 10px 10px;
-    text-align: center;
-    // border-right: 1px solid #eff2f6;
-    display: inline-block;
-    // width: 20%;
-    // vertical-align: top;    
+  // padding: 10px 10px;
+  text-align: center;
+  // border-right: 1px solid #eff2f6;
+  display: inline-block;
+  // width: 20%;
+  // vertical-align: top;
 }
-</style>
+</style>

+ 12 - 3
src/views/resumption/taskManager/dialog.scanrecord.vue

@@ -21,7 +21,7 @@
           prop="collectionAreaName"
         >
         </el-table-column>
-        
+
         <el-table-column
           label="扫描时间"
           align="center"
@@ -33,15 +33,24 @@
           label="扫描方式"
           align="center"
           :show-overflow-tooltip="true"
-          prop="excuteMode"
+          prop="scanMethod"
         >
         </el-table-column>
         <el-table-column
           label="扫描方式"
           align="center"
           :show-overflow-tooltip="true"
-          prop="detail"
+          prop="img"
         >
+          <template slot-scope="r">
+            <label v-if="r.row.scanMethod == 0">-</label>
+            <el-image
+              v-else
+              style="width: 50px; height: 50px"
+              :src="r.row.img"
+              :preview-src-list="[r.row.img]"
+            ></el-image>
+          </template>
         </el-table-column>
       </el-table>
       <div slot="footer" class="dialog-footer">

+ 130 - 115
src/views/resumption/taskManager/index.vue

@@ -51,7 +51,7 @@
           </el-form-item>
           <el-form-item label="履职周期">
             <el-select
-              v-model="queryParams.planCycle"
+              v-model="queryParams.executeCycle"
               placeHolder="请选择履职周期"
               clearable
               @change="changeType($event)"
@@ -82,7 +82,7 @@
             class="searchTitle"
             label="计划时间"
             v-if="
-              queryParams.executeCycle == 1 || queryParams.executeCycle == 0
+              queryParams.executeCycle == 1 || queryParams.executeCycle == 2 || queryParams.executeCycle == null
             "
           >
             <DataRangePicker
@@ -95,7 +95,7 @@
           <el-form-item
             class="searchTitle"
             label="计划时间"
-            v-if="queryParams.executeCycle == 2"
+            v-if="queryParams.executeCycle == 3"
           >
             <!-- :format='weekStart+" 到 "+weekEnd+ 第WW周'  format=" yyyy 第 WW 周"-->
             <el-date-picker
@@ -114,7 +114,7 @@
           <el-form-item
             class="searchTitle"
             label="计划时间"
-            v-if="queryParams.executeCycle == 3"
+            v-if="queryParams.executeCycle == 4"
           >
             <el-date-picker
               v-model="monthRange"
@@ -133,7 +133,7 @@
           <el-form-item
             class="searchTitle"
             label="计划时间"
-            v-if="queryParams.executeCycle == 4"
+            v-if="queryParams.executeCycle == 5"
           >
             <el-date-picker
               :clearable="timeClearable"
@@ -177,7 +177,7 @@
             </el-select>
           </el-form-item>
 
-          <el-form-item label="计划时间" v-if="queryParams.executeCycle == 5">
+          <el-form-item label="计划时间" v-if="queryParams.executeCycle == 6">
             <el-date-picker
               :clearable="timeClearable"
               type="year"
@@ -223,7 +223,7 @@
           <el-form-item
             class="searchTitle"
             label="计划时间"
-            v-if="queryParams.executeCycle == 6"
+            v-if="queryParams.executeCycle == 7"
           >
             <el-date-picker
               :clearable="timeClearable"
@@ -280,8 +280,7 @@
         </el-row>
         <el-table v-loading="loading" :data="pageData">
           <el-table-column
-            prop="order"
-            label="序号"
+          type="index"
             min-width="4%"
             v-if="columns[0].visible"
           >
@@ -368,7 +367,9 @@
             v-if="columns[9].visible"
           >
             <template slot-scope="r">
-              {{ getLabel(dict.type.resumtipn_status, r.row.status) }}
+              <label :style="statusStyle(r.row.status)">
+                {{ getLabel(dict.type.resumption_status, r.row.status) }}</label
+              >
             </template>
           </el-table-column>
           <el-table-column label="操作" min-width="13%">
@@ -419,43 +420,43 @@ export default {
   dicts: ["plan_cycle", "resumption_status"],
   components: { DialogDetail, DialogScanRecord, DataRangePicker, OrgTree },
   data() {
-    const { params, query } = this.$route;
+    // const { params, query } = this.$route;
     let sDate = new Date();
     let eDate = new Date();
-    if (query.startDate != undefined) {
-      sDate = new Date(query.startDate);
-    }
-    if (query.endDate != undefined) {
-      eDate = new Date(query.endDate);
-    }
-    let tempType = 0;
-    let tempOrgId = 1;
-    let tempRole = null;
-    let tempstatus = null;
-    if (query.executeCycle != undefined) tempType = query.executeCycle;
-    if (query.orgId != undefined) tempOrgId = parseInt(query.orgId);
-    else {
-      if (
-        this.loginUser != undefined &&
-        this.loginUser.org != undefined &&
-        this.loginUser.org.id != undefined
-      )
-        tempOrgId = parseInt(this.loginUser.org.id);
-    }
-    if (query.executeRole != undefined && query.executeRole != "all")
-      tempRole = query.executeRole;
-    if (query.status != undefined && query.status != "all")
-      tempstatus = query.status;
+    // if (query.startDate != undefined) {
+    //   sDate = new Date(query.startDate);
+    // }
+    // if (query.endDate != undefined) {
+    //   eDate = new Date(query.endDate);
+    // }
+    // let tempType = 1;
+    // let tempOrgId = 1;
+    // let tempRole = null;
+    // let tempstatus = null;
+    // if (query.executeCycle != undefined) tempType = query.executeCycle;
+    // if (query.orgId != undefined) tempOrgId = parseInt(query.orgId);
+    // else {
+    //   if (
+    //     this.loginUser != undefined &&
+    //     this.loginUser.org != undefined &&
+    //     this.loginUser.org.id != undefined
+    //   )
+    //     tempOrgId = parseInt(this.loginUser.org.id);
+    // }
+    // if (query.executeRole != undefined && query.executeRole != "all")
+    //   tempRole = query.executeRole;
+    // if (query.status != undefined && query.status != "all")
+    //   tempstatus = query.status;
 
     let temphalfyearE = 1;
     let temphalfyearS = 1;
     let tempquarterE = 1;
     let tempquarterS = 1;
 
-    if (query.halfyearE != undefined) temphalfyearE = parseInt(query.halfyearE);
-    if (query.halfyearS != undefined) temphalfyearS = parseInt(query.halfyearS);
-    if (query.quarterE != undefined) tempquarterE = parseInt(query.quarterE);
-    if (query.quarterS != undefined) tempquarterS = parseInt(query.quarterS);
+    // if (query.halfyearE != undefined) temphalfyearE = parseInt(query.halfyearE);
+    // if (query.halfyearS != undefined) temphalfyearS = parseInt(query.halfyearS);
+    // if (query.quarterE != undefined) tempquarterE = parseInt(query.quarterE);
+    // if (query.quarterS != undefined) tempquarterS = parseInt(query.quarterS);
     return {
       loading: false,
       showSearch: true,
@@ -464,8 +465,6 @@ export default {
       options: [],
       roleList: [],
       planList: [],
-      roleVal: tempRole == null ? "all" : tempRole,
-      statusVal: tempstatus == null ? "all" : tempstatus,
       yearS: sDate,
       yearE: eDate,
       halfyearE: temphalfyearE,
@@ -497,12 +496,12 @@ export default {
         { key: "4", value: 4, text: "第四季度" },
       ],
       queryParams: {
-        executeCycle: tempType,
+        executeCycle: "1",
         checkSub: false,
-        orgId: tempOrgId,
+        orgId: null,
         range: [sDate, eDate],
-        executeRole: tempRole,
-        status: tempstatus,
+        executeRole: null,
+        status: null,
         planId: null,
         pageNum: 1,
         pageSize: 10,
@@ -525,30 +524,25 @@ export default {
   },
   props: {},
   watch: {
-    org: {
-      deep: true,
-      immediate: true,
-      handler(nOrg) {
-        if (nOrg.id) {
-          this.queryParams.orgId = nOrg.id;
-        } else {
-          this.queryParams.orgId = this.loginUser.org.id;
-        }
-        this.roleVal = "all";
-        this.planVal = -1;
-        this.loadRoles(this.queryParams.orgId);
-      },
-    },
+    // org: {
+    //   deep: true,
+    //   immediate: true,
+    //   handler(nOrg) {
+    //     if (nOrg.id) {
+    //       this.queryParams.orgId = nOrg.id;
+    //     } else {
+    //       this.queryParams.orgId = this.loginUser.org.id;
+    //     }
+    //     this.roleVal = "all";
+    //     this.planVal = -1;
+    //     this.loadRoles(this.queryParams.orgId);
+    //   },
+    // },
     statusVal(value) {
       if (value == undefined) return;
       if (value == "all") this.queryParams.status = null;
       else this.queryParams.status = value;
     },
-    roleVal(value) {
-      if (value == undefined) return;
-      if (value == "all") this.queryParams.executeRole = null;
-      else this.queryParams.executeRole = value;
-    },
     planVal(value) {
       if (value == undefined) return;
       if (value == -1) this.queryParams.planId = null;
@@ -624,7 +618,7 @@ export default {
     getLabel,
     toName(row) {
       // const ymd = row.ymd;
-      const ymd = this.$moment(row.ymdDate);
+      const ymd = new Date(row.ymdDate);
       switch (row.executeCycle) {
         case 0:
           return `${ymd.year}年${ymd.month}月${ymd.day}日-${row.formTypeText}`;
@@ -666,15 +660,20 @@ export default {
     getDefaultKey(key) {
       this.queryParams.orgId = key;
       this.getList();
+      this.loadRoles(key);
+      this.loadPlanList();
     },
     //单选框状态改变
     checkChange(state) {
       this.queryParams.checkSub = state;
+      
       this.getList();
     },
     // 节点单击事件
     clickTreeNode(data) {
       this.queryParams.orgId = data.id;
+      this.loadPlanList();
+      this.loadRoles();
       this.getList();
     },
     resetQuery() {
@@ -688,7 +687,7 @@ export default {
       this.loading = true;
       console.log("this.queryParams", this.queryParams);
       api
-        .list(this.queryParams)
+        .page(this.queryParams)
         .then((r) => {
           this.pageData = r.rows;
           this.total = r.total;
@@ -698,11 +697,29 @@ export default {
           this.loading = false;
         });
     },
+    loadRoles() {
+      api
+        .getRoles({
+          orgId: this.queryParams.orgId,
+          planCycle: Number(this.queryParams.executeCycle),
+        })
+        .then((r) => (this.roleList = r.data));
+    },
+
+    loadPlanList() {
+      api
+        .getPlans({
+          orgId: this.queryParams.orgId,
+          // checkSub: this.queryParams.checkSub,
+        })
+        .then((r) => {
+          this.planList = r.data;
+        });
+    },
     async changeType(selectValue) {
       // console.log("selectValue",selectValue.target.value)
-      this.roleVal = "all";
-      this.planVal = -1;
-      this.queryParams.executeCycle = Number(selectValue.target.value);
+      // this.planVal = -1;
+      this.queryParams.executeCycle = selectValue;
 
       let nowDate = new Date();
       let nowMonth = nowDate.getMonth();
@@ -727,40 +744,24 @@ export default {
         this.halfyearS = 2;
         this.halfyearE = 2;
       }
-      // 0每日;1每周;2每月;3每季度;4每半年;5每年
-      if (this.queryParams.executeCycle == 1) {
-        if (!this.week) this.week = this.$moment();
-        var date = this.$moment(this.week).isoWeekday(1);
-        this.weekStart = date.weekday(1).format("YYYY-MM-DD");
-        this.weekEnd = date.weekday(7).format("YYYY-MM-DD");
+      // 1每小时;2每天.......;3每月;4每季度;4每半年;5每年
+      if (this.queryParams.executeCycle == 3) {
+        if (!this.week) this.week = new Date();
+        
+        let oneDayLong = 24*60*60*1000
+        let c_day = this.week.getDay()
+        let monday=this.week-(c_day==0?6:(c_day-1))*oneDayLong;
+        let sunday=this.week+(c_day==0?0:(7-c_day))*oneDayLong;
+
+        this.weekStart =`${monday.getYear()}-${monday.getMonth()}-${monday.getDate()}`;
+        this.weekEnd = `${sunday.getYear()}-${sunday.getMonth()}-${sunday.getDate()}`;
         // this.weekChanged();
       }
       this.resetRangeParam();
     },
 
-    loadRoles(orgId) {
-      let tempOrgId = orgId ? orgId : this.loginUser.org.id;
-      api
-        .getRoles({
-          orgId: tempOrgId,
-          type: Number(this.queryParams.executeCycle),
-        })
-        .then((r) => (this.roleList = r.data));
-    },
-
-    loadPlanList() {
-      api
-        .getPlans({
-          orgId: this.queryParams.orgId,
-          checkSub: this.queryParams.checkSub,
-        })
-        .then((r) => {
-          this.planList = r.data;
-        });
-
-      this.planList = planresult;
-    },
     weekChanged() {
+
       var date = this.$moment(this.week).isoWeekday(1);
       this.weekStart = date.weekday(1).format("YYYY-MM-DD");
       this.weekEnd = date.weekday(7).format("YYYY-MM-DD");
@@ -769,7 +770,7 @@ export default {
     monthChanged() {
       this.resetRangeParam();
     },
-    async resetRangeParam() {
+    async resetRangeParam() {      
       if (this.queryParams.executeCycle == 3) {
         let yearSval = this.yearS.getFullYear();
         let yearEval = this.yearE.getFullYear();
@@ -806,7 +807,7 @@ export default {
             break;
         }
 
-        this.queryParams.range = [this.$moment(sQDate), this.$moment(eQData)];
+        this.queryParams.range = [new Date(sQDate), new Date(eQData)];
       } else if (this.queryParams.executeCycle == 4) {
         let yearSval = this.yearS.getFullYear();
         let yearEval = this.yearE.getFullYear();
@@ -830,14 +831,14 @@ export default {
             eHData += "12-31";
             break;
         }
-        this.queryParams.range = [this.$moment(sHDate), this.$moment(eHData)];
+        this.queryParams.range = [new Date(sHDate), new Date(eHData)];
       } else if (this.queryParams.executeCycle == 5) {
         let yearSval = this.yearS.getFullYear();
         let yearEval = this.yearE.getFullYear();
         let sYDate = yearSval + "-01-01";
         let eYData = yearEval + "-12-31";
 
-        this.queryParams.range = [this.$moment(sYDate), this.$moment(eYData)];
+        this.queryParams.range = [new Date(sYDate), new Date(eYData)];
       } else if (this.queryParams.executeCycle == 2) {
         if (!this.monthRange || this.monthRange.length != 2) {
           this.queryParams.range = null;
@@ -949,12 +950,12 @@ export default {
                 break;
             }
           }
-          this.queryParams.range = [this.$moment(sMDate), this.$moment(eMData)];
+          this.queryParams.range = [new Date(sMDate), new Date(eMData)];
         }
       } else if (this.queryParams.executeCycle == 1) {
         this.queryParams.range = [
-          this.$moment(this.weekStart),
-          this.$moment(this.weekEnd),
+          new Date(this.weekStart),
+          new Date(this.weekEnd),
         ];
       } else if (
         this.queryParams.executeCycle === 0 ||
@@ -963,19 +964,33 @@ export default {
         this.queryParams.range = this.$dateRange.before(0);
       }
     },
-  },
-  async mounted() {
-    const { params, query } = this.$route;
-    if (this.loginUser && this.loginUser.org && this.loginUser.org.id) {
-      if (query == undefined || query.orgId == undefined) {
-        this.queryParams.orgId = this.loginUser.org.id;
+    statusStyle(status) {
+      let color = "";
+      switch (status) {
+        case "1":
+          color = "#BFBFBF";
+        case "2":
+          color = "1890FF";
+        case "3":
+          color = "52C41A";
+        case "4":
+          color = "F5222D";
       }
-    }
-    this.loadRoles(this.queryParams.orgId);
-    await this.loadtypes();
-    this.loadPlanList();
 
-    await this.refresh();
+      return "list-style-type:disc;color:" + color;
+    },
+  },
+  async mounted() {
+    // const { params, query } = this.$route;
+    // if (this.loginUser && this.loginUser.org && this.loginUser.org.id) {
+    //   if (query == undefined || query.orgId == undefined) {
+    //     this.queryParams.orgId = this.loginUser.org.id;
+    //   }
+    // }
+    // this.loadRoles(this.queryParams.orgId);
+    // await this.loadtypes();
+    // this.loadPlanList();
+    // await this.refresh();
   },
 };
 </script>

+ 1 - 1
src/views/system/dept/index.vue

@@ -175,7 +175,7 @@
           </el-col>
         </el-row>
         <el-row>
-          <el-col :span="12">
+          <el-col :span="12" v-if="false">
             <el-form-item label="邮箱" prop="email">
               <el-input v-model="form.email" placeholder="请输入邮箱" maxlength="50" />
             </el-form-item>