Просмотр исходного кода

Merge branch 'master' of https://git.agilestar.cn/spfm-group/spfm-market-front

daiqisheng 3 лет назад
Родитель
Сommit
751f26832e

+ 25 - 5
src/pages/main/gridDivision/approvalExamination.vue

@@ -1,5 +1,4 @@
 <template>
-  <div>
     <div class="approvalExamination-container">
       <simple-form
         :form="table_form"
@@ -46,6 +45,12 @@
             ></el-input>
           </el-form-item>
         </el-form>
+        <template v-slot:footer>
+          <div>
+            <el-button @click="handleVisible('opinion')" type="default">退回修改</el-button>
+            <el-button @click="handleOpinion" type="primary">同意</el-button>
+          </div>
+        </template>
       </simple-dialog>
       <simple-dialog
         title="审批轨迹"
@@ -59,9 +64,14 @@
           :config="table_config_track"
           :loading="table_loading_track"
         ></simple-table>
+        <template v-slot:footer>
+          <div>
+            <el-button @click="handleVisible('track')" type="default">退回修改</el-button>
+            <el-button @click="handleConsent" type="primary">同意</el-button>
+          </div>
+        </template>
       </simple-dialog>
     </div>
-  </div>
 </template>
 
 <script>
@@ -215,6 +225,9 @@ export default {
         case "track":
           this.track_visible = !this.track_visible;
           break;
+        case "batch":
+          this.opinion_visible = !this.opinion_visible;
+          break;
       }
     },
     handleaaa(val) {
@@ -223,8 +236,12 @@ export default {
     handleApprove() {
       this.handleVisible("opinion");
     },
-    handleOpinion() {},
-    handleConsent() {},
+    handleOpinion() {
+      this.handleVisible('opinion')
+    },
+    handleConsent() {
+      this.handleVisible('track')
+    },
   },
 };
 </script>
@@ -232,8 +249,8 @@ export default {
 <style lang="scss" scoped>
 .approvalExamination-container {
   background: #ffffff;
+  padding: 0 20px;
   padding-top: 20px;
-  padding-left: 20px;
   margin: 15px;
   overflow: auto;
   width: calc(100% - 30px);
@@ -241,4 +258,7 @@ export default {
   height: 100%;
   overflow-x: hidden;
 }
+::v-deep .el-row {
+  padding-bottom: 12px;
+}
 </style>

+ 262 - 172
src/pages/main/gridDivision/workersList.vue

@@ -1,133 +1,138 @@
 <template>
-  <div>
-    <div class="workersList-container">
-      <simple-form
-        :form="table_form"
-        :handle="table_handle"
-        @search="handleSearch"
-        @summary="handleVisible('summary')"
-        @add="handleVisible('add')"
+  <div class="workersList-container">
+    <simple-form
+      :form="table_form"
+      :handle="table_handle"
+      @search="handleSearch"
+      @summary="handleVisible('summary')"
+      @add="handleVisible('add')"
+    >
+    </simple-form>
+    <simple-table
+      :list="table_list"
+      :config="table_config"
+      :loading="table_loading"
+      :multiple="true"
+      :handle-row="table_handle_row"
+      @selection="handleaaa"
+      @check="handleCheck"
+      @edit="handleEdit"
+    ></simple-table>
+    <simple-pagination
+      :page="page"
+      :total="total"
+      @change="handleChange"
+    ></simple-pagination>
+    <simple-dialog
+      :title="title"
+      :fullscreen="true"
+      @cancel="handleVisible('add')"
+      :visible="add_visible"
+    >
+      <el-form
+        label-width="120px"
+        :model="add_form"
+        ref="add_ref"
       >
-      </simple-form>
-      <simple-table
-        :list="table_list"
-        :config="table_config"
-        :loading="table_loading"
-        :multiple="true"
-        :handle-row="table_handle_row"
-        @selection="handleaaa"
-        @check="handleCheck"
-        @edit="handleEdit"
-      ></simple-table>
-      <simple-pagination
-        :page="page"
-        :total="total"
-        @change="handleChange"
-      ></simple-pagination>
-      <simple-dialog
-        title="新建"
-        :fullscreen="true"
-        @cancel="handleVisible('add')"
-        @confirm="handleSubmit"
-        :visible="add_visible"
-      >
-        <el-form
-          label-width="120px"
-          :model="add_form"
-          ref="add_ref"
-        >
-          <el-form-item
-            label="提出人"
-            prop="proposer"
-            :rules="{
+        <el-form-item
+          label="提出人"
+          prop="proposer"
+          :rules="{
                         required: true,
                         message: '提出人不能为空',
                         trigger: 'blur',
                     }"
-          >
-            <el-input v-model="add_form.proposer"></el-input>
-          </el-form-item>
-          <el-form-item
-            label="联系电话"
-            prop="telephone"
-            :rules="{
+        >
+          <el-input v-model="add_form.proposer"></el-input>
+        </el-form-item>
+        <el-form-item
+          label="联系电话"
+          prop="telephone"
+          :rules="{
                         required: true,
                         message: '联系电话不能为空',
                         trigger: 'blur',
                     }"
-          >
-            <el-input v-model="add_form.telephone"></el-input>
-          </el-form-item>
-          <el-form-item
-            label="网格划分需求"
-            prop="wanggeText"
-            :rules="{
+        >
+          <el-input v-model="add_form.telephone"></el-input>
+        </el-form-item>
+        <el-form-item
+          label="网格划分需求"
+          prop="wanggeText"
+          :rules="{
                         required: true,
                         message: '网格划分需求不能为空',
                         trigger: 'blur',
                     }"
-          >
-            <el-input
-              type="textarea"
-              v-model="add_form.wanggeText"
-            ></el-input>
-          </el-form-item>
-          <el-form-item
-            label="附件上传"
-            prop=""
-          >
-            <el-upload
-              class="upload-demo"
-              drag
-              action="https://jsonplaceholder.typicode.com/posts/"
-              multiple
-            >
-              <i class="el-icon-upload"></i>
-              <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
-            </el-upload>
-          </el-form-item>
-          <el-form-item
-            label="审批轨迹"
-            prop=""
-            v-if="edit_visible"
-          >
-            <simple-table
-              :list="table_list_approve"
-              :config="table_config_approve"
-              :loading="table_loading_approve"
-            ></simple-table>
-          </el-form-item>
-          <el-form-item
-            label="审批意见"
-            prop=""
-            v-if="edit_visible"
-            :rules="{
-                        required: true,
-                        message: '审批意见不能为空',
-                        trigger: 'blur',
-                    }"
-          >
-            <el-input type="textarea" v-model="add_form.precautions"></el-input>
-          </el-form-item>
-        </el-form>
-      </simple-dialog>
-      <simple-dialog
-        title="工单汇总"
-        width="40%"
-        @cancel="handleVisible('summary')"
-        @confirm="handleSummary"
-        :visible="summary_visible"
-      >
-        <div class="summary">
-          <p>是否要对所选工单进行汇总?</p>
-          <p class="summary-tip">可对未审批的区县网格划分审批工单合并为同一条工单,由相关审批人员进行审批,减少审批工作量</p>
+        >
+          <el-input
+            type="textarea"
+            v-model="add_form.wanggeText"
+          ></el-input>
+        </el-form-item>
+        <el-form-item
+          label="附件上传"
+          prop="file"
+        >
+          <myUpload
+            @uploadBack="uploadBack"
+            :fileInfo="fileInfo"
+            :fileList="fileInfo.fileList"
+          ></myUpload>
+        </el-form-item>
+        <el-form-item
+          label="审批轨迹"
+          prop=""
+          v-if="edit_visible"
+        >
+          <simple-table
+            :list="table_list_approve"
+            :config="table_config_approve"
+            :loading="table_loading_approve"
+          ></simple-table>
+        </el-form-item>
+        <el-form-item
+          label="审批意见"
+          prop="desc"
+          v-if="edit_visible"
+        >
+          <el-input
+            type="textarea"
+            v-model="add_form.desc"
+          ></el-input>
+        </el-form-item>
+      </el-form>
+      <template v-slot:footer>
+        <div v-if="!isCheck">
+          <el-button
+            @click="handleSubmit"
+            type="primary"
+          >保存</el-button>
+          <el-button
+            @click="handleVisible('add')"
+            type="default"
+          >取消</el-button>
         </div>
-      </simple-dialog>
-    </div>
+        <div v-else></div>
+      </template>
+    </simple-dialog>
+    <simple-dialog
+      title="工单汇总"
+      width="40%"
+      @cancel="handleVisible('summary')"
+      @confirm="handleSummary"
+      :visible="summary_visible"
+    >
+      <div class="summary">
+        <p>是否要对所选工单进行汇总?</p>
+        <p class="summary-tip">可对未审批的区县网格划分审批工单合并为同一条工单,由相关审批人员进行审批,减少审批工作量</p>
+      </div>
+    </simple-dialog>
   </div>
 </template>
 
 <script>
+import myUpload from "../../../components/upload";
 import simpleForm from "./components/form.vue";
 import simpleTable from "./components/table.vue";
 import simpleDialog from "./components/dialog.vue";
@@ -137,15 +142,26 @@ export default {
   components: {
     simpleForm,
     simpleDialog,
+    myUpload,
     simpleTable,
     simplePagination,
   },
   data() {
     return {
-      page:1,
-      rows:10,
-      total:0,
-      table_search:{},
+      fileInfo: {
+        limit: 3,
+        url: "mkWangge/upload",
+        fileList: [],
+      },
+      attList: [],
+      page: 1,
+      rows: 10,
+      total: 0,
+      // 模态框标题
+      title: "",
+      // 是否为查看状态
+      isCheck: false,
+      table_search: {},
       // 新建模态框
       add_visible: false,
       summary_visible: false,
@@ -153,7 +169,7 @@ export default {
       add_form: {},
       table_handle: [
         {
-          label: "工汇总",
+          label: "工汇总",
           props: "summary",
         },
         {
@@ -186,20 +202,20 @@ export default {
       ],
       // 列表数据
       table_list: [
-        // {
-        //   number: 1,
-        //   cpmName: "xq",
-        //   person: "mll",
-        //   createTime: 1654563154824,
-        //   status: 0,
-        // },
-        // {
-        //   number: 2,
-        //   cpmName: "xq",
-        //   person: "mll",
-        //   createTime: 1654963568455,
-        //   status: 1,
-        // },
+        {
+          id: 1,
+          companyName: "xq",
+          proposer: "mll",
+          createTime: 1654563154824,
+          status: 0,
+        },
+        {
+          id: 2,
+          companyName: "xq",
+          proposer: "mll",
+          createTime: 1654963568455,
+          status: 1,
+        },
       ],
       table_loading: false,
       //   表格里的操作按钮
@@ -211,16 +227,16 @@ export default {
         {
           label: "处理",
           props: "edit",
-          visible: {
-            status: [0],
-          },
+          // visible: {
+          //   status: [1],
+          // },
         },
       ],
       //  表头配置
       table_config: [
         {
           label: "序号",
-          props: "createId",
+          props: "id",
         },
         {
           label: "公司名称",
@@ -277,86 +293,157 @@ export default {
       ],
     };
   },
-  mounted(){
+  mounted() {
     this.handleInit({
       ...this.table_search,
+      type: "0",
       page: this.page,
       pageSize: this.rows,
-    })
-    this.handleInit()
+    });
   },
   methods: {
     // 表格数据初始化
-    handleInit(data){
-      this.table_loading = true
+    handleInit(data) {
+      // this.table_loading = true;
       // console.log(data);
       this.$http({
-        url:'/mkWangge/queryPage',
-        method:'post',
-        headers:{
+        url: "/mkWangge/queryPage",
+        method: "post",
+        headers: {
           "Content-Type": "application/json",
         },
-        data:data
-      }).then(({data:{count,data}}) => {
-         this.table_loading = false
-         this.total = count
-         this.table_list = data || []
+        data: data,
+      }).then(({ data: { count, data } }) => {
+        this.table_loading = false;
+        this.total = count;
+        this.table_list = data || [];
         console.log(data);
-      })
+      });
     },
     // 搜索事件
     handleSearch(data) {
       this.table_search = data;
       this.page = 1;
-      this.handleInit({ ...data, page: this.page, pageSize: this.rows });
+      this.handleInit({
+        ...data,
+        type: "0",
+        page: this.page,
+        pageSize: this.rows,
+      });
     },
     handleVisible(props) {
       switch (props) {
         case "add":
           this.add_visible = !this.add_visible;
-          this.edit_visible = false
+          this.edit_visible = false;
+          this.title = "新建";
+          this.isCheck = false;
+          this.add_form = {};
           break;
         case "summary":
-          this.summary_visible = !this.summary_visible
-          break
-        
-        case 'edit':
-          this.edit_visible = !this.edit_visible
-          this.add_visible = !this.add_visible
-          break
-        case 'check':
-          this.edit_visible = !this.edit_visible
-          this.add_visible = !this.add_visible
-          break
+          this.summary_visible = !this.summary_visible;
+          break;
+
+        case "edit":
+          this.edit_visible = !this.edit_visible;
+          this.add_visible = !this.add_visible;
+          this.title = "发起人处理";
+          this.isCheck = false;
+          break;
+        case "check":
+          this.edit_visible = !this.edit_visible;
+          this.add_visible = !this.add_visible;
+          this.title = "查看";
+          this.isCheck = true;
+          break;
       }
     },
     handleaaa(val) {
       console.log(val);
     },
+    //文件返回值
+    uploadBack(v) {
+      console.log(v);
+      this.attList = v;
+    },
     // 查看按钮
     handleCheck(row) {
-      console.log(row, "row");
+      let id = row.id;
       this.handleVisible('check')
-      // this.visible = true;
-      // this.edit_visible = false;
-      // this.edit_form = row;
-      // this.edit_visible = !this.edit_visible
-      // this.add_visible = !this.add_visible
+      this.$http({
+        url: "/mkWangge/getMkWanggeById",
+        method: "get",
+        headers: {
+          "Content-Type": "application/json",
+        },
+        params:{
+          id
+        }
+      }).then(({data})=>{
+        console.log(data);
+        this.add_form = {
+          id: data.id,
+          proposer: data.proposer,
+          telephone: data.telephone,
+          wanggeText: data.wanggeText,
+        }
+      })
     },
     // 编辑按钮
-    handleEdit() {
+    handleEdit(row) {
+      let id = row.id;
       this.handleVisible('edit')
+      this.$http({
+        url: "/mkWangge/getMkWanggeById",
+        method: "get",
+        headers: {
+          "Content-Type": "application/json",
+        },
+        params:{
+          id
+        }
+      }).then(({data})=>{
+        console.log(data);
+        this.add_form = {
+          id: data.id,
+          proposer: data.proposer,
+          telephone: data.telephone,
+          wanggeText: data.wanggeText,
+        }
+      })
     },
     handleSubmit() {
-      this.edit_visible = false
-      this.add_visible = false
       console.log(this.add_form);
+      // let _this = this;
+      this.$refs.add_ref.validate((valid) => {
+        if (valid) {
+          let reqdata = [{ ...this.add_form, processId: "729294602773110788" }];
+          this.$http({
+            url: "/mkWangge/saveOrUpdateList",
+            method: "post",
+            headers: {
+              "Content-Type": "application/json",
+            },
+            data: reqdata,
+          }).then((res) => {
+            console.log(res);
+          });
+          this.handleInit({
+            ...this.table_search,
+            page: this.page,
+            pageSize: this.rows,
+          });
+          this.edit_visible = false;
+          this.add_visible = false;
+        }
+      });
     },
-    handleSummary(){},
+    handleSummary() {},
     handleChange(page) {
       this.page = page;
       this.handleInit({
         ...this.table_search,
+        type: "0",
         page: this.page,
         pageSize: this.rows,
       });
@@ -368,7 +455,6 @@ export default {
 <style lang="scss" scoped>
 .workersList-container {
   background: #ffffff;
-  padding-top: 20px;
   padding: 0 20px;
   margin: 15px;
   overflow: auto;
@@ -388,4 +474,8 @@ export default {
     padding-top: 30px;
   }
 }
+::v-deep .el-row {
+  padding-top: 12px;
+  padding-bottom: 12px;
+}
 </style>

+ 2 - 1
src/pages/main/performance/components/table.vue

@@ -2,7 +2,7 @@
  * @Author       : yuanrunwei
  * @Date         : 2021-11-01 18:02:58
  * @LastEditors: Please set LastEditors
- * @LastEditTime: 2022-01-07 19:02:35
+ * @LastEditTime: 2022-01-07 19:41:48
  * @FilePath     : \spfm-market-front\src\pages\main\performance\components\table.vue
 -->
 <template>
@@ -76,6 +76,7 @@
     <el-table-column
       v-if="handleRow.length"
       label="操作"
+      :align="'center'"
       :width="handleRow.length * 50"
     >
       <template slot-scope="scope">