guarantee-lsq 1 tahun lalu
induk
melakukan
d632082850

+ 10 - 0
src/api/upms/dept.js

@@ -19,6 +19,16 @@ export function getDeptTree (parameter) {
   })
 }
 
+export function getDeptTreePreparation (parameter) {
+  return axios({
+    url: `/upms/depts/preparation/tree?${stringify(parameter)}`,
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
+
 /**
  * user page func
  * parameter: {

+ 10 - 0
src/api/upms/user.js

@@ -229,3 +229,13 @@ export function checkBxr () {
     }
   })
 }
+
+export function queryUserByRoleName (parameter) {
+  return axios({
+    url: `/upms/users/query/roleName/${parameter.roleName}`,
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}

+ 2 - 1
src/router/generator-platform-routers.js

@@ -403,7 +403,8 @@ const constantRouterComponents = {
   // 筹建管理
   'PreparationAll': () => import('@/views/preparation/preparation/PreparationAll'),
   'PreparationMine': () => import('@/views/preparation/preparation/PreparationMine'),
-  'PreparationDispatch': () => import('@/views/preparation/preparation/PreparationDispatch'),
+  'PreparationVerify': () => import('@/views/preparation/preparation/PreparationVerify'),
+  'PreparationReceive': () => import('@/views/preparation/preparation/PreparationReceive'),
   'PreparationReport': () => import('@/views/preparation/report/PreparationReport'),
   'PreparationReportPie': () => import('@/views/preparation/report/PreparationReportPie'),
   // 防雷检测

+ 6 - 4
src/utils/dict.js

@@ -940,10 +940,12 @@ DictCache.VALUE = {
     CALLER_REPAIR_VERIFY_SUCCESS_THREE: 22 // 计划维修报修成功
   },
   REPAIR_PREPARATION_STATUS: {
-    NOT_ALLOCATED: 1, // 待分配
-    PROCESSING: 2, // 处理中
-    FINISHED: 3, // 已完成
-    CANCEL: 4 // 已取消
+    NOT_ALLOCATED: 1, // 待审核
+    VERIFY_SUCCESS: 2, // 待接单
+    VERIFY_FAIL: 3, // 审核被拒
+    WAIT_DISPATCH: 4, // 待分配
+    PROCESSING: 5, // 执行中
+    FINISHED: 6 // 已完成
   },
   /**
    * 维修状态

+ 1 - 1
src/views/preparation/preparation/PreparationMine.vue

@@ -1,5 +1,5 @@
 <template>
-  <Preparation :search-type="1"/>
+  <Preparation :search-type="3"/>
 </template>
 
 <script>

+ 17 - 0
src/views/preparation/preparation/PreparationReceive.vue

@@ -0,0 +1,17 @@
+<template>
+  <Preparation :search-type="1"/>
+</template>
+
+<script>
+import Preparation from './Preparation'
+export default {
+  name: 'PreparationReceive',
+  components: {
+    Preparation
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 1 - 1
src/views/preparation/preparation/PreparationDispatch.vue → src/views/preparation/preparation/PreparationVerify.vue

@@ -5,7 +5,7 @@
 <script>
 import Preparation from './Preparation'
 export default {
-  name: 'PreparationDispatch',
+  name: 'PreparationVerify',
   components: {
     Preparation
   }

+ 53 - 111
src/views/preparation/preparation/modules/BaseForm.vue

@@ -78,12 +78,36 @@
         </row-item>
         <row-item>
           <a-form-item
-            label="备注"
+            label="审批主管"
             :labelCol="BaseTool.Constant.labelCol"
             :wrapperCol="BaseTool.Constant.wrapperCol"
           >
-            <a-input
-              v-decorator="['remark', {rules: [{required: true, message: '备注不能为空'}]}]" />
+            <a-select v-decorator="['applyVerifyUserId', { rules: [{required: true, message: '审批主管不能为空'}]}]" placeholder="请选择">
+              <a-select-option
+                v-for="({realName,userId}) in verifyUserList"
+                :key="userId"
+                :label="realName"
+                :value="userId">{{ realName }}
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+        </row-item>
+        <row-item>
+          <a-form-item
+            label="执行部门"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-tree-select
+              style="width: 100%"
+              :dropdownStyle="{ maxHeight: '400px', overflow: 'auto' }"
+              :treeData="executeDeptList"
+              v-decorator="['executeDept', {initValue: '09', rules: [{required: true, message: '申请部门不能为空'}]}]"
+              :treeNodeFilterProp="'title'"
+              :showSearch="true"
+              placeholder="请选择"
+            >
+            </a-tree-select>
           </a-form-item>
         </row-item>
       </row-list>
@@ -99,106 +123,19 @@
               v-decorator="['content', {rules: [{required: true, message: '委托内容描述不能为空'}]}]"/>
           </a-form-item>
         </row-item>
-        <!--        <row-item>
-
-          <a-form-item
-            label="报修状态"
-            :labelCol="BaseTool.Constant.labelCol"
-            :wrapperCol="BaseTool.Constant.wrapperCol"
-          >
-          </a-form-item>
-        </row-item>-->
-        <!--        <row-item>
-
-          <a-form-item
-            label="维修开始时间"
-            :labelCol="BaseTool.Constant.labelCol"
-            :wrapperCol="BaseTool.Constant.wrapperCol"
-          >
-            <a-date-picker
-              showTime
-              style="width: 100%"
-              :format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
-              v-decorator="['repairStartTime', {rules: [{required: true, message: '维修开始时间不能为空'}]}]" />
-          </a-form-item>
-        </row-item>
+      </row-list>
+      <row-list :col="1">
         <row-item>
-
           <a-form-item
-            label="维修结束时间"
-            :labelCol="BaseTool.Constant.labelCol"
-            :wrapperCol="BaseTool.Constant.wrapperCol"
+            label="申请备注"
+            :labelCol="BaseTool.Constant.labelCol2"
+            :wrapperCol="BaseTool.Constant.wrapperCol2"
           >
-            <a-date-picker
-              showTime
-              style="width: 100%"
-              :format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
-              v-decorator="['repairEndTime', {rules: [{required: true, message: '维修结束时间不能为空'}]}]" />
+            <a-textarea
+              :rows="4"
+              v-decorator="['remark']"/>
           </a-form-item>
         </row-item>
-        <row-item>
-
-          <a-form-item
-            label="维修耗时"
-            :labelCol="BaseTool.Constant.labelCol"
-            :wrapperCol="BaseTool.Constant.wrapperCol"
-          >
-            <a-input-number
-              style="width: 100%"
-              :min="0"
-              :formatter="BaseTool.Amount.formatter"
-              :parser="BaseTool.Amount.parser"
-              v-decorator="['repairMinutes', {rules: [{required: true, message: '维修耗时不能为空'}]}]" />
-          </a-form-item>
-        </row-item>-->
-        <!--        <row-item>
-
-          <a-form-item
-            label="维修人员id"
-            :labelCol="BaseTool.Constant.labelCol"
-            :wrapperCol="BaseTool.Constant.wrapperCol"
-          >
-            <a-input
-              v-decorator="['repairUserId', {rules: [{required: true, message: '维修人员id不能为空'}]}]" />
-          </a-form-item>
-        </row-item>-->
-        <!--        <row-item>
-
-          <a-form-item
-            label="维修描述"
-            :labelCol="BaseTool.Constant.labelCol"
-            :wrapperCol="BaseTool.Constant.wrapperCol"
-          >
-            <a-input
-              v-decorator="['repairContent', {rules: [{required: true, message: '维修描述不能为空'}]}]" />
-          </a-form-item>
-        </row-item>-->
-        <!--        <row-item>
-
-          <a-form-item
-            label="费用预算"
-            :labelCol="BaseTool.Constant.labelCol"
-            :wrapperCol="BaseTool.Constant.wrapperCol"
-          >
-            <a-input-number
-              style="width: 100%"
-              :min="0"
-              :formatter="BaseTool.Amount.formatter"
-              :parser="BaseTool.Amount.parser"
-              v-decorator="['fee', {rules: [{required: true, message: '费用预算不能为空'}]}]" />
-          </a-form-item>
-        </row-item>-->
-        <!--        <row-item>
-
-          <a-form-item
-            label="预算明细表"
-            :labelCol="BaseTool.Constant.labelCol"
-            :wrapperCol="BaseTool.Constant.wrapperCol"
-          >
-            <a-input
-              v-decorator="['feeFile', {rules: [{required: true, message: '预算明细表不能为空'}]}]" />
-          </a-form-item>
-        </row-item>-->
       </row-list>
     </a-form>
     <template slot="footer">
@@ -211,6 +148,8 @@
 import pick from 'lodash.pick'
 import { addPreparation, updatePreparation } from '@/api/preparation/preparation'
 import { getSbPositions2 } from '@/api/repair/application-form'
+import { queryUserByRoleName } from '@/api/upms/user'
+import { getDeptTreePreparation } from '@/api/upms/dept'
 
 export default {
   name: 'BasePreparation',
@@ -220,7 +159,9 @@ export default {
       modalTitle: null,
       form: this.$form.createForm(this),
       visible: false,
-      sbPositionList: []
+      sbPositionList: [],
+      verifyUserList: [],
+      executeDeptList: {}
       // 下拉框map
     }
   },
@@ -228,9 +169,22 @@ export default {
   created () {
     // 下拉框map
     this.getSbPositions()
+    this.getUserAndDept()
     this.preparationMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PREPARATION_PARENT)
   },
   methods: {
+    getUserAndDept () {
+      // 获取部门主管
+      queryUserByRoleName({ roleName: 'DEPT_MANAGER' }).then(res => {
+        this.verifyUserList = res.data
+      })
+      // 获取执行部门
+      const parameter = {
+      }
+      getDeptTreePreparation(parameter).then(res => {
+        this.executeDeptList = res.data
+      })
+    },
     base (record) {
       this.visible = true
       // 如果是空标识添加
@@ -276,17 +230,6 @@ export default {
       console.log(selectedOptions)
       const targetOption = selectedOptions[selectedOptions.length - 1]
       targetOption.loading = true
-      getSbPositions({ parentId: targetOption.id }).then(res => {
-        targetOption.loading = false
-        targetOption.children = res.data.map(item => {
-          item = {
-            label: item.name,
-            value: item.id
-          }
-          return item
-        })
-        this.sbPositionList = [...this.sbPositionList]
-      })
     },
 
     save () {
@@ -300,7 +243,6 @@ export default {
         // 日期处理
         values.applyTime = this.BaseTool.Date.formatter(values.applyTime, this.BaseTool.Date.PICKER_NORM_DATETIME_PATTERN)
         values.limitHours = this.BaseTool.Date.formatter(values.limitHours, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
-
         if (this.BaseTool.String.isBlank(values.id)) {
           addPreparation(values)
             .then(() => {

+ 22 - 15
src/views/preparation/preparation/modules/Detail.vue

@@ -9,23 +9,25 @@
     </a-row>
     <a-descriptions :column="3" bordered>
       <a-descriptions-item label="单据号">{{ model.no }}</a-descriptions-item>
-      <a-descriptions-item label="申请人">{{ model.createdUserName }}</a-descriptions-item>
       <a-descriptions-item label="公司">{{ BaseTool.Object.getField(preparationMap,model.parentPositionId) }}</a-descriptions-item>
+      <a-descriptions-item label="申请人">{{ model.createdUserName }}</a-descriptions-item>
       <a-descriptions-item label="申请部门">{{ model.deptName }}</a-descriptions-item>
+      <a-descriptions-item label="审批主管">{{ model.applyVerifyUser }}</a-descriptions-item>
+      <a-descriptions-item label="工单状态"><badge :text="BaseTool.Object.getField(statusMap,model.status)" :status="DictCache.COLOR.REPAIR_FORM_STATUS[model.status]"/></a-descriptions-item>
       <a-descriptions-item label="建筑物">{{ model.positionName }}</a-descriptions-item>
-      <a-descriptions-item label="报修时间">{{ model.applyTime }}</a-descriptions-item>
-      <a-descriptions-item label="问题描述" :span="3"> <span v-html="model.content "></span></a-descriptions-item>
+      <a-descriptions-item label="申请时间">{{ model.applyTime }}</a-descriptions-item>
       <a-descriptions-item label="要求完成日期">{{ model.limitHours }}</a-descriptions-item>
-      <a-descriptions-item label="单据状态"><badge :text="BaseTool.Object.getField(statusMap,model.status)" :status="DictCache.COLOR.REPAIR_FORM_STATUS[model.status]"/></a-descriptions-item>
-      <a-descriptions-item label="维修人">{{ model.repairUserName }}</a-descriptions-item>
-      <a-descriptions-item label="维修开始时间">{{ model.repairStartTime }}</a-descriptions-item>
-      <a-descriptions-item label="维修结束时间">{{ model.repairEndTime }}</a-descriptions-item>
-      <a-descriptions-item label="维修时长">{{ model.repairMinutes }}</a-descriptions-item>
-      <a-descriptions-item label="维修描述" :span="3"> <span v-html="model.repairContent "></span></a-descriptions-item>
+      <a-descriptions-item label="问题描述" :span="3"> <span v-html="model.content "></span></a-descriptions-item>
+      <a-descriptions-item label="执行部门">{{ model.executeDeptName }}</a-descriptions-item>
+      <a-descriptions-item v-if='model.status == DictCache.VALUE.REPAIR_PREPARATION_STATUS.VERIFY_SUCCESS || model.status == DictCache.VALUE.REPAIR_PREPARATION_STATUS.VERIFY_FAIL || model.status == DictCache.VALUE.REPAIR_PREPARATION_STATUS.NOT_ALLOCATED' label="可接单执行主管">{{ model.executeMangers }}</a-descriptions-item>
+      <a-descriptions-item v-if='model.status == DictCache.VALUE.REPAIR_PREPARATION_STATUS.WAIT_DISPATCH || model.status == DictCache.VALUE.REPAIR_PREPARATION_STATUS.FINISHED || model.status == DictCache.VALUE.REPAIR_PREPARATION_STATUS.PROCESSING' label="执行主管">{{ model.executeMangers }}</a-descriptions-item>
+      <a-descriptions-item label="执行人">{{ model.repairUserName }}</a-descriptions-item>
+      <a-descriptions-item label="执行开始时间">{{ model.repairStartTime }}</a-descriptions-item>
+      <a-descriptions-item label="执行结束时间">{{ model.repairEndTime }}</a-descriptions-item>
+      <a-descriptions-item label="执行时长">{{ model.repairMinutes }}</a-descriptions-item>
       <a-descriptions-item label="费用预算">{{ model.fee }}</a-descriptions-item>
-      <a-descriptions-item label="筹建主管" >{{ model.dispatchUserName }}</a-descriptions-item>
-      <a-descriptions-item label="创建人" >{{ model.createdUserName }}</a-descriptions-item>
-      <a-descriptions-item label="图片" :span="3">
+      <a-descriptions-item label="执行描述" :span="3"> <span v-html="model.repairContent "></span></a-descriptions-item>
+      <a-descriptions-item label="费用图片" :span="3">
         <div v-if="model.imageList != null && model.imageList.length > 0">
           <viewer :images="model.imageList" @inited="inited" ref="viewer" :index="1" >
             <img
@@ -38,13 +40,15 @@
           </viewer></div>
         <div v-if="model.imageList == null || model.imageList.length === 0"> 暂无</div>
       </a-descriptions-item>
-      <a-descriptions-item label="文件">
+      <a-descriptions-item label="费用文件">
         <a v-for="item in model.fileList" :key="item.id" :href="item.url" target="downloadFile" :download="item.name">{{ item.name }}</a>
       </a-descriptions-item>
     </a-descriptions>
     <div class="btn">
       <a-button style="margin-left: 8px" type="primary" @click="handleCancel">返回</a-button>
-      <a-button v-if="DictCache.VALUE.REPAIR_PREPARATION_STATUS.NOT_ALLOCATED === model.status " style="margin-left: 16px" type="default" @click="handleAssign">派单</a-button>
+      <a-button v-if="DictCache.VALUE.REPAIR_PREPARATION_STATUS.NOT_ALLOCATED === model.status " style="margin-left: 16px" type="default" @click="handleAssign">审核</a-button>
+      <a-button v-if="DictCache.VALUE.REPAIR_PREPARATION_STATUS.VERIFY_SUCCESS === model.status " style="margin-left: 16px" type="default" @click="handleAssign">接单</a-button>
+      <a-button v-if="DictCache.VALUE.REPAIR_PREPARATION_STATUS.WAIT_DISPATCH === model.status " style="margin-left: 16px" type="default" @click="handleAssign">派单</a-button>
       <a-button v-if="DictCache.VALUE.REPAIR_PREPARATION_STATUS.PROCESSING === model.status" style="margin-left: 8px" type="default" @click="handleFinish()">完成维修</a-button>
     </div>
     <assign-form ref="assignForm" @ok="handleCancel" />
@@ -98,7 +102,10 @@ export default {
         'fee': null,
         'imageList': null,
         'fileList': null,
-        'dispatchUserName': null
+        'dispatchUserName': null,
+        'executeDeptName': null,
+        'applyVerifyUser': null,
+        'executeMangers': null
       }
     }
   },

+ 1 - 0
src/views/sb/info/SbInfo.vue

@@ -950,6 +950,7 @@ export default {
       this.$refs.importModalUpdate.base(null, 2)
     },
     handleChange (value, label, extra) {
+      alert(value)
       const data = this.treeData.find(item => item.id === value)
       if (data && data.children && data.children.length > 0) {
         this.typeList = data.children.map(item => item.id)

+ 1 - 0
src/views/store/outstoreform/modules/BaseFormYY.vue

@@ -274,6 +274,7 @@ import { queryUsersByParentDeptNatureAll } from '@/api/upms/user'
 import { fetchStoreTree } from '@/api/store/store'
 import { getSbPositions } from '@/api/repair/application-form'
 import { fetchSbTypeTree } from '@/api/project/project'
+import { stringify } from 'qs'
 export default {
   name: 'BaseOutStoreFormYY',
   components: {