Browse Source

服务改善

qymljy 2 months ago
parent
commit
a75fbb79d6

+ 51 - 0
src/HDrpManagement/serviceImprovement/components/actionImplementation/index.vue

@@ -0,0 +1,51 @@
+<template>
+  <div>
+    <div style="display:flex;justify-content: space-between">
+      <table-detail :layout="tablecols" :data="list" :opwidth="200" :custom="true" style="margin-top: 10px">
+        <template v-slot:customcol="scope">
+          <div v-if="scope.column.columnname == 'status'">
+            <div :style="tool.getStatusColor(scope.column.data[scope.column.columnname])">{{scope.column.data[scope.column.columnname]}}</div>
+          </div>
+          <div v-else>{{scope.column.data[scope.column.columnname]}}</div>
+        </template>
+      </table-detail>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "index",
+  data(){
+    return {
+      param:{
+        "id": 2026020210235502,
+        "content": {
+          "sa_service_improvementid": this.$route.query.id,
+          "pageNumber": 1,
+          "pageSize": 99
+        },
+      },
+      tablecols:[],
+      list:[],
+      total:0,
+      currentPage:0,
+      userid:JSON.parse(sessionStorage.getItem('active_account')).userid
+    }
+  },
+  methods:{
+    async listData(){
+      const res = await this.$api.requested(this.param)
+      this.list = res.data
+      console.log(res.data,'方案列表')
+    }
+  },
+  created() {
+    this.tablecols = this.tool.tabelCol(this.$route.name).improvementActionTable.tablecols
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 205 - 4
src/HDrpManagement/serviceImprovement/components/improvementPlan/edit.vue

@@ -13,13 +13,14 @@
       <div class="drawer__panel" style="margin-bottom: 0">
       <div class="drawer__panel" style="margin-bottom: 0">
         <div style="display: flex;justify-content: space-between">
         <div style="display: flex;justify-content: space-between">
           <div>{{$t(`方案编制`)}}</div>
           <div>{{$t(`方案编制`)}}</div>
-          <el-button type="primary" size="small" @click="addRow">{{$t(`添加行`)}}</el-button>
+          <el-button type="primary" size="small" @click="addRow" v-if="!isAdd">{{$t(`添加行`)}}</el-button>
         </div>
         </div>
         <table-detail :layout="tablecols" :data="list" :opwidth="200" :custom="true" style="margin-top: 10px">
         <table-detail :layout="tablecols" :data="list" :opwidth="200" :custom="true" style="margin-top: 10px">
           <template v-slot:customcol="scope">
           <template v-slot:customcol="scope">
             <div v-if="scope.column.columnname == 'title'">
             <div v-if="scope.column.columnname == 'title'">
               <div v-if="nowRow == scope.column.data.rowindex">
               <div v-if="nowRow == scope.column.data.rowindex">
-                <el-input size="small" v-model="scope.column.data[scope.column.columnname]" placeholder="请输入任务名称"></el-input>
+                <el-input size="small" v-model="scope.column.data[scope.column.columnname]" placeholder="请输入任务名称" @blur="setError(scope.column.data)"></el-input>
+                <div style="color: #e13333;font-size: 12px" v-if="titleError">{{titleError}}</div>
               </div>
               </div>
               <div v-else>{{scope.column.data[scope.column.columnname]}}</div>
               <div v-else>{{scope.column.data[scope.column.columnname]}}</div>
             </div>
             </div>
@@ -27,18 +28,77 @@
               <div v-if="nowRow == scope.column.data.rowindex">
               <div v-if="nowRow == scope.column.data.rowindex">
                 <el-date-picker
                 <el-date-picker
                     v-model="scope.column.data[scope.column.columnname]"
                     v-model="scope.column.data[scope.column.columnname]"
+                    @change="setError(scope.column.data)"
                     value-format="yyyy-MM-dd"
                     value-format="yyyy-MM-dd"
+                    style="width: 100%"
                     size="small"
                     size="small"
                     type="date"
                     type="date"
                     placeholder="选择日期">
                     placeholder="选择日期">
                 </el-date-picker>
                 </el-date-picker>
+                <div style="color: #e13333;font-size: 12px" v-if="begdateError">{{begdateError}}</div>
+              </div>
+              <div v-else>{{scope.column.data[scope.column.columnname]}}</div>
+            </div>
+            <div v-else-if="scope.column.columnname == 'enddate'">
+              <div v-if="nowRow == scope.column.data.rowindex">
+                <el-date-picker
+                    v-model="scope.column.data[scope.column.columnname]"
+                    @change="setError(scope.column.data)"
+                    value-format="yyyy-MM-dd"
+                    style="width: 100%"
+                    size="small"
+                    type="date"
+                    placeholder="选择日期">
+                </el-date-picker>
+                <div style="color: #e13333;font-size: 12px" v-if="enddateError">{{enddateError}}</div>
+              </div>
+              <div v-else>{{scope.column.data[scope.column.columnname]}}</div>
+            </div>
+            <div v-else-if="scope.column.columnname == 'measure'">
+              <div v-if="nowRow == scope.column.data.rowindex">
+                <el-input size="small" v-model="scope.column.data[scope.column.columnname]" placeholder="请输入措施" @blur="setError(scope.column.data)"></el-input>
+                <div style="color: #e13333;font-size: 12px" v-if="measureError">{{measureError}}</div>
+              </div>
+              <div v-else>{{scope.column.data[scope.column.columnname]}}</div>
+            </div>
+            <div v-else-if="scope.column.columnname == 'name'">
+              <div v-if="nowRow == scope.column.data.rowindex">
+                <el-select v-model="scope.column.data[scope.column.columnname]" filterable  size="small" placeholder="请选择" @change="changeName(scope.column.data)">
+                  <el-option
+                      v-for="item in personOpt"
+                      :key="item.userid"
+                      :label="item.name"
+                      :value="item.userid">
+                  </el-option>
+                </el-select>
+                <div style="color: #e13333;font-size: 12px" v-if="useridError">{{useridError}}</div>
               </div>
               </div>
               <div v-else>{{scope.column.data[scope.column.columnname]}}</div>
               <div v-else>{{scope.column.data[scope.column.columnname]}}</div>
             </div>
             </div>
             <div v-else>{{scope.column.data[scope.column.columnname]}}</div>
             <div v-else>{{scope.column.data[scope.column.columnname]}}</div>
           </template>
           </template>
+          <template v-slot:opreation="scope">
+            <el-button type="text" size="mini" class="inline-16" v-if="nowRow != scope.data.rowindex" @click="editClick(scope.data)">{{$t(`编辑`)}}</el-button>
+            <el-button type="text" size="mini" class="inline-16" v-if="isSave && nowRow == scope.data.rowindex" style="color: #e6a23c" @click="onSave(scope.data)">{{$t(`保存`)}}</el-button>
+            <el-button type="text" size="mini" class="inline-16" @click="delClick(scope.data)">{{$t(`删除`)}}</el-button>
+          </template>
         </table-detail>
         </table-detail>
       </div>
       </div>
+      <div class="fixed__btn__panel">
+        <el-button
+            size="small"
+            @click="drawerVisible = false"
+            class="normal-btn-width inline-16"
+        >{{ $t("取 消") }}</el-button
+        >
+        <el-button
+            size="small"
+            type="primary"
+            @click="drawerVisible = false"
+            class="normal-btn-width"
+        >{{ $t("确 定") }}</el-button
+        >
+      </div>
     </el-drawer>
     </el-drawer>
   </div>
   </div>
 </template>
 </template>
@@ -46,6 +106,7 @@
 <script>
 <script>
 export default {
 export default {
   name: "edit",
   name: "edit",
+  props:['data'],
   data(){
   data(){
     return {
     return {
       drawerVisible:false,
       drawerVisible:false,
@@ -61,14 +122,24 @@ export default {
       list:[],
       list:[],
       total:0,
       total:0,
       currentPage:0,
       currentPage:0,
-      nowRow:-1
+      nowRow:-1,
+      personOpt:[],
+      isAdd:false,
+      isSave:true,
+      titleError:'',
+      begdateError:'',
+      enddateError:'',
+      useridError:'',
+      measureError:''
     }
     }
   },
   },
   methods:{
   methods:{
     editBtn(){
     editBtn(){
+      console.log(this.data,'输出data的数据')
       this.drawerVisible = true
       this.drawerVisible = true
       this.param.content.pageNumber = 1
       this.param.content.pageNumber = 1
       this.listData()
       this.listData()
+      this.personList()
     },
     },
     async listData(){
     async listData(){
       const res = await this.$api.requested(this.param)
       const res = await this.$api.requested(this.param)
@@ -76,16 +147,146 @@ export default {
       console.log(res.data,'方案列表')
       console.log(res.data,'方案列表')
     },
     },
     addRow(){
     addRow(){
+      this.isAdd = true
+      this.isSave = true
       this.nowRow = this.list.length + 1
       this.nowRow = this.list.length + 1
       this.list.push({
       this.list.push({
+        sa_service_improvementid:this.$route.query.id,
+        sa_service_improvement_planid:0,
         rowindex:this.list.length + 1,
         rowindex:this.list.length + 1,
         title:'',
         title:'',
         begdate:'',
         begdate:'',
         enddate:'',
         enddate:'',
         measure:'',
         measure:'',
-        name:''
+        name:'',
+        userid_charge:''
       })
       })
     },
     },
+    async personList(){
+      const res = await this.$api.requested({
+        id:20221102090303,
+        content:{
+          containssub:1,
+          departmentids:[this.data.departmentid],
+          isExport:'',
+          pageNumber:1,
+          pageSize:999999
+        }
+      })
+      if (res.code == 0){
+        this.tool.showMessage(res,()=>{})
+      }else {
+        this.personOpt = res.data
+      }
+    },
+    async delClick(data){
+      console.log(data,'输出data')
+      if (data.sa_service_improvement_planid == 0){
+        this.param.content.pageNumber = 1
+        this.listData()
+      }else {
+        const res = await this.$api.requested({
+          "id": 2026020210234702,
+          "content": {
+            "sa_service_improvement_planid": data.sa_service_improvement_planid
+          },
+        })
+        if (res.code == 0){
+          this.tool.showMessage(res,()=>{})
+        }else {
+          this.param.content.pageNumber = 1
+          this.listData()
+        }
+      }
+      this.isAdd = false
+    },
+    async onSave(data){
+      if (data.title == ''){
+        this.titleError = '任务名称不可为空'
+      }else {
+        this.titleError = ''
+      }
+      if (data.begdate == ''){
+        this.begdateError = '开始日期不能为空'
+      }else {
+        this.begdateError = ''
+      }
+      if (data.enddate == ''){
+        this.enddateError = '结束日期不可为空'
+      }else {
+        this.enddateError = ''
+      }
+      if (data.userid_charge == ''){
+        this.useridError = '责任人不能为空'
+      }else {
+        this.useridError = ''
+      }
+      if (data.measure == ''){
+        this.measureError = '措施不能为空'
+      }else {
+        this.measureError = ''
+      }
+      if (data.title && data.begdate && data.enddate && data.measure && data.userid_charge){
+        const res = await this.$api.requested({
+          "id": 2026020210233202,
+          "content": {
+            "sa_service_improvementid": this.$route.query.id,
+            "sa_service_improvement_planid": data.sa_service_improvement_planid,
+            "title": data.title, //主要原因
+            "begdate": data.begdate, //改善建议
+            "enddate": data.enddate, //责任部门
+            "userid_charge": data.userid_charge, //责任人
+            "measure": data.measure //措施
+          },
+        })
+        if (res.code == 0){
+          this.tool.showMessage(res,()=>{})
+        }else {
+          this.isAdd = false
+          this.isSave = false
+          this.nowRow = -1
+          this.param.content.pageNumber = 1
+          this.listData()
+        }
+      }
+    },
+    changeName(val,data){
+      if (val) {
+        this.useridError = ''
+      }
+      this.list[val.rowindex -1].userid_charge = val.name
+    },
+    editClick(data){
+      this.isSave = true
+      this.nowRow = data.rowindex
+    },
+    setError(data){
+      if (data.title == ''){
+        this.titleError = '任务名称不可为空'
+      }else {
+        this.titleError = ''
+      }
+      if (data.begdate == ''){
+        this.begdateError = '开始日期不能为空'
+      }else {
+        this.begdateError = ''
+      }
+      if (data.enddate == ''){
+        this.enddateError = '结束日期不可为空'
+      }else {
+        this.enddateError = ''
+      }
+      if (data.userid_charge == ''){
+        this.useridError = '责任人不能为空'
+      }else {
+        this.useridError = ''
+      }
+      if (data.measure == ''){
+        this.measureError = '措施不能为空'
+      }else {
+        this.measureError = ''
+      }
+    },
     onClose(){}
     onClose(){}
   },
   },
   created() {
   created() {

+ 3 - 4
src/HDrpManagement/serviceImprovement/components/improvementPlan/index.vue

@@ -1,6 +1,6 @@
 <template>
 <template>
   <div>
   <div>
-    <edit></edit>
+    <edit :data="data" v-if="data.status == '分析已提交' && userid == data.userid_charge" ></edit>
     <table-detail :layout="tablecols" :data="list" :opwidth="200" :custom="true" style="margin-top: 10px">
     <table-detail :layout="tablecols" :data="list" :opwidth="200" :custom="true" style="margin-top: 10px">
       <template v-slot:customcol="scope">
       <template v-slot:customcol="scope">
         <div>{{scope.column.data[scope.column.columnname]}}</div>
         <div>{{scope.column.data[scope.column.columnname]}}</div>
@@ -16,6 +16,7 @@ import ganttChart from './ganttChart'
 export default {
 export default {
   name: "index",
   name: "index",
   components:{edit,ganttChart},
   components:{edit,ganttChart},
+  props:['data'],
   data(){
   data(){
     return {
     return {
       param:{
       param:{
@@ -30,12 +31,10 @@ export default {
       list:[],
       list:[],
       total:0,
       total:0,
       currentPage:0,
       currentPage:0,
+      userid:JSON.parse(sessionStorage.getItem('active_account')).userid
     }
     }
   },
   },
   computed: {
   computed: {
-    formattedDate() {
-      return this.originalDateTime.split(' ')[0];
-    }
   },
   },
   methods:{
   methods:{
     async listData(){
     async listData(){

+ 9 - 3
src/HDrpManagement/serviceImprovement/components/serviceImprovement/index.vue

@@ -5,9 +5,11 @@
         <causeAnalysis :mainData="mainData" @editSuccess="editSuccess"></causeAnalysis>
         <causeAnalysis :mainData="mainData" @editSuccess="editSuccess"></causeAnalysis>
       </el-tab-pane>
       </el-tab-pane>
       <el-tab-pane label="改善方案" name="改善方案">
       <el-tab-pane label="改善方案" name="改善方案">
-        <improvementPlan ref="planRef"></improvementPlan>
+        <improvementPlan ref="planRef" :data="mainData"></improvementPlan>
+      </el-tab-pane>
+      <el-tab-pane label="方案执行" name="方案执行">
+        <actionImplementation ref="planActionRef"></actionImplementation>
       </el-tab-pane>
       </el-tab-pane>
-      <el-tab-pane label="方案执行" name="方案执行">{{$t(`方案执行`)}}</el-tab-pane>
       <el-tab-pane label="影响产品范围" name="影响产品范围">
       <el-tab-pane label="影响产品范围" name="影响产品范围">
         <affectedProductScope :data="mainData" :someUserid="someUserid"></affectedProductScope>
         <affectedProductScope :data="mainData" :someUserid="someUserid"></affectedProductScope>
       </el-tab-pane>
       </el-tab-pane>
@@ -27,10 +29,11 @@ import associatedImprovementOrder from '../associatedImprovementOrder/index'
 import affectedProductScope from '../affectedProductScope/index'
 import affectedProductScope from '../affectedProductScope/index'
 import causeAnalysis from '../causeAnalysis/index'
 import causeAnalysis from '../causeAnalysis/index'
 import improvementPlan from '../improvementPlan/index'
 import improvementPlan from '../improvementPlan/index'
+import actionImplementation from '../actionImplementation/index'
 export default {
 export default {
   name: "index",
   name: "index",
   props:['mainData','someUserid'],
   props:['mainData','someUserid'],
-  components:{detailInfo,associatedImprovementOrder,affectedProductScope,causeAnalysis,improvementPlan},
+  components:{detailInfo,associatedImprovementOrder,affectedProductScope,causeAnalysis,improvementPlan,actionImplementation},
   data(){
   data(){
     return {
     return {
       activeName:'真因分析',
       activeName:'真因分析',
@@ -47,6 +50,9 @@ export default {
       }else if (this.activeName == '改善方案'){
       }else if (this.activeName == '改善方案'){
         this.$refs.planRef.param.content.pageNumber = 1
         this.$refs.planRef.param.content.pageNumber = 1
         this.$refs.planRef.listData()
         this.$refs.planRef.listData()
+      }else if (this.activeName == '方案执行'){
+        this.$refs.planActionRef.param.content.pageNumber = 1
+        this.$refs.planActionRef.listData()
       }
       }
     },
     },
     changeDataStructure(){
     changeDataStructure(){

+ 4 - 0
src/HManagement/siteManage/securityConfig/modules/serviceImprovementRule.vue

@@ -327,4 +327,8 @@ export default {
 .dialog-footer {
 .dialog-footer {
   text-align: right;
   text-align: right;
 }
 }
+/* 强制所有单元格换行 */
+/deep/ .el-table .cell {
+  white-space: normal !important;
+}
 </style>
 </style>

+ 0 - 1
src/utils/tool.js

@@ -259,7 +259,6 @@ export default {
   },
   },
   /*日期转化*/
   /*日期转化*/
   getDataChange(data){
   getDataChange(data){
-    console.log(data,'333')
     const newData = new Date(data)
     const newData = new Date(data)
     const year = newData.getFullYear()
     const year = newData.getFullYear()
     const month = String(newData.getMonth() + 1).padStart(2,'0')
     const month = String(newData.getMonth() + 1).padStart(2,'0')