Explorar el Código

改善单服务工单 字段新增

qymljy hace 2 meses
padre
commit
b6f75b1265

+ 8 - 1
src/HDrpManagement/serveWorkBill/modules/detail.vue

@@ -396,7 +396,14 @@ export default {
         },
         {
           label: "操作类型",
-          value: this.mainData.actiontype,
+          value:
+              this.mainData.actiontype == "非工序模板"
+                  ? this.$t("通用模板")
+                  : this.mainData.actiontype,
+        },
+        {
+          label: "历史服务次数",
+          value: this.tool.qtyShow(this.mainData.historicalservicesqty),
         },
         { label:'备注',  value: this.mainData.remarks}
       ];

+ 65 - 3
src/HDrpManagement/serveWorkBill/modules/items/index.vue

@@ -13,6 +13,8 @@
           @clear="listData(param.content.pageNumber = 1)"
           clearable>
       </el-input>
+       <add class="inline-16" v-if="isServer" btn-title="自服务申请单添加" drawer-title="自服务申请单添加" :param="serverAdd" :tablecols="tablecolsAdd" @addSuccess="addSuccess" :sa_workorderid="sa_workorderid"></add>
+       <add class="inline-16" btn-title="自产品档案添加" drawer-title="自产品档案添加" :param="productAdd" :tablecols="tablecolsAdd" @addSuccess="addSuccess" :sa_workorderid="sa_workorderid"></add>
     </div>
     <div style="margin-top: 15px">
       <tableDetail :layout="tablecols" :data="list" :opwidth="200" :custom="true" fixed-name="operation" height="calc(100vh - 460px)">
@@ -60,8 +62,10 @@
 </template>
 
 <script>
+import add from '@/components/addTable/btnAdd'
 export default {
   props: ["data","sa_workorderid"],
+  components:{add},
   data() {
     return {
       options: [],
@@ -82,15 +86,47 @@ export default {
       total:0,
       currentPage:0,
       nowRow:-1,
-      isEdit:false
+      isEdit:false,
+      isServer:false,
+      serverAdd:{
+        "content": {
+          "sa_workorderid": this.sa_workorderid,
+          "type":2,//1档案,2:申请单
+          "pageNumber": 1,
+          "pageSize": 50,
+          "where": {
+            "condition": ""
+          }
+        },
+        "id": "2026022710102502"
+      },
+      productAdd:{
+        "content": {
+          "sa_workorderid": this.sa_workorderid,
+          "type":1,//1档案,2:申请单
+          "pageNumber": 1,
+          "pageSize": 50,
+          "where": {
+            "condition": ""
+          }
+        },
+        "id": "2026022710102502"
+      },
+      tablecolsAdd:[]
     };
   },
   methods: {
-    async listData(){
+    async listData(isPr){
       const res = await this.$api.requested(this.param)
       this.list = res.data
       this.total = res.total
       this.currentPage = res.pageNumber
+      this.$nextTick(()=>{
+        /*判断工单是否有服务商品*/
+        if (isPr){
+          this.isProduct()
+        }
+      })
     },
     editClick(data){
       this.isEdit = true
@@ -128,12 +164,38 @@ export default {
       this.param.content.pageNumber = val
       this.listData()
     },
+    async isProduct(){
+      const res = await this.$api.requested({
+        id:20230206161903,
+        content:{
+          sa_serviceorderid:this.data.sa_serviceorderid,
+          pageNumber:1,
+          pageSize:20
+        }
+      })
+      if (res.code == 0){
+        this.tool.showMessage(res,()=>{})
+      }else {
+        if (res.data.length > 0){
+          this.isServer = true
+        }else {
+          this.isServer = false
+        }
+      }
+      console.log(this.isServer,'是否可以从申请单中添加数据')
+    },
+    addSuccess(){
+      this.param.content.pageNumber = 1
+      this.listData()
+    }
   },
   mounted() {
-    this.listData(this.param.content.pageNumber = 1)
+    this.param.content.pageNumber = 1
+    this.listData(true)
   },
   created() {
     this.tablecols = this.tool.tabelCol(this.$route.name).serviceProductTable.tablecols
+    this.tablecolsAdd = this.tool.tabelCol(this.$route.name).productAddTable.tablecols
   },
 };
 </script>

+ 8 - 10
src/HDrpManagement/serveWorkBill/modules/serviceWorkOrder/index.vue

@@ -53,7 +53,7 @@
       </el-tab-pane>
     </el-tabs>
     <el-tabs type="border-card" v-model="activeName" v-else @tab-click="handleClick">
-      <el-tab-pane label="服务商品" name="服务商品">
+      <el-tab-pane label="工单服务商品" name="工单服务商品">
         <Items :data="internalData" :sa_workorderid="newQuery?mainData.sa_workorderid:$route.query.id"></Items>
       </el-tab-pane>
       <el-tab-pane label="服务确认单" name="服务确认单">
@@ -110,7 +110,7 @@ export default {
   components:{detailInfo,taskDetail,taskListDetail,taskListEdit,Items,checkBill,teamList,selectTeam,materials},
   data(){
     return {
-      activeName:'服务商品',
+      activeName:'工单服务商品',
       active_accoun:JSON.parse(sessionStorage.getItem('active_account')),
       folderid:JSON.parse(sessionStorage.getItem('folderid')),
       internalData:{ isServerMag:false,isleader:false },
@@ -122,7 +122,6 @@ export default {
   },
   methods:{
     async queryMainData(id) {
-      console.log('输出mainData')
       this.internalData.isServerMag = false
       this.internalData.isleader = false
       if (this.hrid !== 0){
@@ -144,7 +143,6 @@ export default {
         },
       });
       this.internalData = Object.assign({}, this.internalData, res.data);
-      console.log(this.internalData,'internalData3434')
 
       if (res.data.length > 0){
         res.data.team.forEach(item => {
@@ -158,22 +156,19 @@ export default {
           }
         })
         // this.nodes = this.createTreeData(res.data.nodes);
-        console.log(this.nodes,'nodes的数据1222')
       }
       this.changeDataStructure(this.internalData)
     },
     changeDataStructure(newData){
-      console.log(this.team_name,this.team_phone_number)
       if (newData){
         this.internalData = { ...newData }
       }else {
-        console.log(this.nodes,'nodes的数据')
         this.nodes = this.nodes
         this.internalData = { ...this.mainData }
       }
-      this.internalData.actiontype == '工序模板'?this.activeName = '工序详情' : this.activeName = '服务商品'
+      this.internalData.actiontype == '工序模板'?this.activeName = '工序详情' : this.activeName = '工单服务商品'
       let that = this;
-      if (this.internalData.team.length > 0){
+      if (this.internalData.team && this.internalData.team.length > 0){
         this.internalData.team.forEach(item => {
           if (item.isleader){
             this.team_name = item.name
@@ -241,6 +236,10 @@ export default {
                       ? this.$t("通用模板")
                       : this.internalData.actiontype,
             },
+            {
+              label: "历史服务次数",
+              value: this.tool.qtyShow(this.internalData.historicalservicesqty),
+            },
             { label:'备注',  value: this.internalData.remarks},
           ],
         },
@@ -341,7 +340,6 @@ export default {
       });
     },
     handleClick(){
-      console.log(this.internalData,'输出internalData')
       if (this.activeName == '服务确认单'){
         let id = this.internalData.sa_workorderid ? this.internalData.sa_workorderid : -1
         this.$refs.checkBillRef.listData(id)

+ 58 - 1
src/HDrpManagement/serviceImprovement/components/serviceImprovement/index.vue

@@ -32,7 +32,9 @@ export default {
     return {
       activeName:'真因分析',
       detailInfo:{},
-      internalData:{}
+      internalData:{},
+      team_name:'',
+      team_phone_number:''
     }
   },
   methods:{
@@ -44,6 +46,14 @@ export default {
     changeDataStructure(){
       let that = this
       this.internalData = { ...this.mainData }
+      if (this.internalData.workorderinfo.team && this.internalData.workorderinfo.team.length > 0){
+        this.internalData.workorderinfo.team.forEach(item => {
+          if (item.isleader){
+            this.team_name = item.name
+            this.team_phone_number = item.phonenumber
+          }
+        })
+      }
       this.detailInfo = [
         {
           title:'基本信息',
@@ -59,6 +69,53 @@ export default {
             { label: "工单号", value: this.internalData.billno_workorder },
             { label: "申请单号", value: this.internalData.billno_serviceorder },
             {label:'客诉大类',value:this.internalData.class2},
+
+            {
+              label: "问题描述",
+              value: this.internalData.workorderinfo.reason,
+            },
+            {
+              label: "企业名称",
+              value: this.internalData.workorderinfo.enterprisename,
+            },
+            {
+              label: "省市县",
+              value:
+                  this.internalData.workorderinfo.province + this.internalData.workorderinfo.city + this.internalData.workorderinfo.county,
+            },
+            {
+              label: "详细地址",
+              value: this.internalData.workorderinfo.address,
+            },
+            {
+              label: "应用系统",
+              value: this.internalData.workorderinfo.class1,
+            },
+            {
+              label: "工单类型",
+              value: this.internalData.workorderinfo.type,
+            },
+            {
+              label: "服务负责人",
+              value: this.team_name,
+            },
+            {
+              label: "业务员",
+              value: this.internalData.workorderinfo.saler_name,
+            },
+            {
+              label: "业务员手机号",
+              value: this.internalData.workorderinfo.saler_phonenumber,
+            },
+            {
+              label: "项目名称",
+              value: this.internalData.workorderinfo.projectname,
+            },
+            {
+              label: "历史服务次数",
+              value: this.tool.qtyShow(this.internalData.workorderinfo.historicalservicesqty),
+            },
+
             {label:'分析负责人',value:this.internalData.name_analysis},
             {label:'方案编辑人',value:this.internalData.name_charge},
             {label:'责任部门',value:this.internalData.depname_charge},

+ 53 - 0
src/HDrpManagement/serviceImprovement/modules/detail.vue

@@ -146,6 +146,14 @@ export default {
     },
     changeDataStructure(){
       let that = this
+      if (this.mainData.workorderinfo.team && this.mainData.workorderinfo.team.length > 0){
+        this.mainData.workorderinfo.team.forEach(item => {
+          if (item.isleader){
+            this.team_name = item.name
+            this.team_phone_number = item.phonenumber
+          }
+        })
+      }
       this.mainAreaData = [
         {label:'改善单号',value:this.mainData.billno},
         {label:'改善类别',value:this.mainData.type},
@@ -158,6 +166,51 @@ export default {
         {label:'工单号',value:this.mainData.billno_workorder},
         {label:'申请单号',value:this.mainData.billno_serviceorder},
         {label:'客诉大类',value:this.mainData.class2},
+        {
+          label: "问题描述",
+          value: this.mainData.workorderinfo.reason,
+        },
+        {
+          label: "企业名称",
+          value: this.mainData.workorderinfo.enterprisename,
+        },
+        {
+          label: "省市县",
+          value:
+              this.mainData.workorderinfo.province + this.mainData.workorderinfo.city + this.mainData.workorderinfo.county,
+        },
+        {
+          label: "详细地址",
+          value: this.mainData.workorderinfo.address,
+        },
+        {
+          label: "应用系统",
+          value: this.mainData.workorderinfo.class1,
+        },
+        {
+          label: "工单类型",
+          value: this.mainData.workorderinfo.type,
+        },
+        {
+          label: "服务负责人",
+          value: this.team_name,
+        },
+        {
+          label: "业务员",
+          value: this.mainData.workorderinfo.saler_name,
+        },
+        {
+          label: "业务员手机号",
+          value: this.mainData.workorderinfo.saler_phonenumber,
+        },
+        {
+          label: "项目名称",
+          value: this.mainData.workorderinfo.projectname,
+        },
+        {
+          label: "历史服务次数",
+          value: this.tool.qtyShow(this.mainData.workorderinfo.historicalservicesqty),
+        },
         {label:'分析负责人',value:this.mainData.name_analysis},
         {label:'真因分析时间',value:this.mainData.submitdate},
         {label:'方案编辑人',value:this.mainData.name_charge},

+ 144 - 0
src/components/addTable/btnAdd.vue

@@ -0,0 +1,144 @@
+<template>
+  <div>
+    <el-button
+        size="small"
+        type="primary"
+        @click="addBtn((drawerVisible = true))"
+    >{{ $t(btnTitle)}}</el-button
+    >
+    <el-drawer
+        :title="$t(drawerTitle)"
+        :visible.sync="drawerVisible"
+        size="80%"
+        direction="rtl"
+        append-to-body
+        :show-close="false"
+        @close="onClose">
+      <div class="drawer__panel" style="margin-bottom: 0 !important;">
+        <el-input  style="width:200px;" :placeholder="$t('搜索')" :suffix-icon="param.content.where.condition?param.content.where.condition.length > 0?'':'':'el-icon-search'"
+                   v-model="param.content.where.condition" @keyup.native.enter="listData(param.content.pageNumber = 1)" @clear="listData(param.content.pageNumber = 1)"
+                   size="small" class="input-with-select inline-16 layout_search__panel" clearable>
+        </el-input>
+        <table-detail :layout="tablecols" :checkbox="true" :data="list" :custom="true" :width="true" :height="tableHieght" minHeight="200px" fixedName="operation"
+                      @selectionChange="selectionChange" style="margin-top: 10px">
+          <template v-slot:customcol="scope">
+            <div v-if="scope.column.columnname == 'nominalpressure'">
+              {{tool.nominalPressureSet(scope.column.data[[scope.column.columnname]])}}
+            </div>
+            <div v-else>
+              {{scope.column.data[[scope.column.columnname]] || scope.column.columnname === 'operation'?scope.column.data[[scope.column.columnname]]:'--'}}
+            </div>
+          </template>
+        </table-detail>
+        <div  class="container normal-panel" style="text-align:right;padding-bottom: 0!important;">
+          <el-pagination
+              background
+              @size-change="handleSizeChange"
+              @current-change="handleCurrentChange"
+              :current-page="currentPage"
+              :page-sizes="[50, 100, 150, 200]"
+              :page-size="50"
+              layout="total,sizes, prev, pager, next, jumper"
+              :total="total">
+          </el-pagination>
+        </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"
+            :loading="loading"
+            @click="onSubmit"
+            class="normal-btn-width"
+            :disabled="selectList.length == 0"
+        >{{ $t("确 定") }}</el-button
+        >
+      </div>
+    </el-drawer>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "btnAdd",
+  props:['btnTitle','drawerTitle','param','tablecols','sa_workorderid'],
+  data(){
+    return {
+      drawerVisible:false,
+      tableHieght:'calc(100vh - 240px)',
+      list:[],
+      currentPage:0,
+      total:0,
+      loading:false,
+      selectList:[]
+    }
+  },
+  methods:{
+    addBtn(){
+      this.drawerVisible = true
+      this.selectList = []
+      this.listData(this.param.content.pageNumber = 1)
+    },
+    async listData(){
+      const res = await this.$api.requested(this.param)
+      console.log(res.data,'data')
+      this.list = res.data
+      this.currentPage = res.pageNumber
+      this.total = res.total
+    },
+    handleSizeChange(val) {
+      // console.log(`每页 ${val} 条`);
+      this.param.content.pageSize = val
+      this.listData()
+    },
+    handleCurrentChange(val) {
+      // console.log(`当前页: ${val}`);
+      this.param.content.pageNumber = val
+      this.listData()
+    },
+    selectionChange(select){
+      console.log(select)
+      this.selectList = select
+    },
+    async onSubmit(){
+      let iteminfos = this.selectList.map(item =>{
+        return {
+          "sa_workorder_node_itemsid":0,
+          "problem_description":item.problem_description,
+          "processing":item.processing,
+          "result":item.result,
+          "reason":item.reason,
+          "qty":item.qty,
+          "itemid":item.itemid
+        }
+      })
+      const res = await this.$api.requested({
+        id:20230215201903,
+        content:{
+          sa_workorder_nodeid:0,
+          sa_workorderid:this.sa_workorderid,
+          iteminfos:iteminfos
+        }
+      })
+      if (res.code == 0){
+        this.tool.showMessage(res,()=>{})
+      }else {
+        this.drawerVisible = false
+        this.$emit('addSuccess')
+      }
+    },
+    onClose(){}
+  },
+
+}
+</script>
+
+<style scoped>
+
+</style>