qymljy 3 месяцев назад
Родитель
Сommit
45e3021be1

+ 9 - 2
src/HDrpManagement/serveBill/modules/detail.vue

@@ -88,6 +88,8 @@
         <serviceApplication  ref="serviceApplicationRef" v-if="mainData" :mainData="mainData"></serviceApplication>
       </div>
       <div slot="slot1">
+        <serviceWorkOrder ref="serviceWorkOrderRef" v-if="mainData" :mainData="mainData" :nodes="nodes"
+                          :team_name="team_name" :team_phone_number="team_phone_number" :new-query="true"></serviceWorkOrder>
       </div>
       <div slot="slot2">
       </div>
@@ -104,6 +106,7 @@ import workBill from "./workBill/index";
 import productTable from "./product/index";
 import addProduct from "./product/add";
 import serviceApplication from "@/HDrpManagement/serveBillMag/components/serviceApplication";
+import serviceWorkOrder from '@/HDrpManagement/serveWorkBill/modules/serviceWorkOrder/index'
 export default {
   name: "detail",
   data() {
@@ -117,7 +120,10 @@ export default {
       nowUserid:JSON.parse(sessionStorage.getItem('active_account')).userid,
       usertype:JSON.parse(sessionStorage.getItem('active_account')).usertype,
       submitDis:true,
-      hrData:''
+      hrData:'',
+      nodes: [],
+      team_name:'',
+      team_phone_number:'',
     };
   },
   components: {
@@ -127,7 +133,8 @@ export default {
     workBill,
     productTable,
     addProduct,
-    serviceApplication
+    serviceApplication,
+    serviceWorkOrder
   },
   methods: {
     hrMain(data){

+ 2 - 2
src/HDrpManagement/serveBillMag/modules/detail.vue

@@ -71,8 +71,8 @@
         <serviceApplication  ref="serviceApplicationRef" v-if="mainData" :mainData="mainData"></serviceApplication>
       </div>
       <div slot="slot1">
-<!--        <serviceWorkOrder ref="serviceWorkOrderRef" v-if="mainData" :mainData="mainData" :nodes="nodes"-->
-<!--                          :team_name="team_name" :team_phone_number="team_phone_number"></serviceWorkOrder>-->
+        <serviceWorkOrder ref="serviceWorkOrderRef" v-if="mainData" :mainData="mainData" :nodes="nodes"
+                          :team_name="team_name" :team_phone_number="team_phone_number" :new-query="true"></serviceWorkOrder>
       </div>
       <div slot="slot2" >
       </div>

+ 62 - 2
src/HDrpManagement/serveWorkBill/components/generalTemplate.vue

@@ -99,10 +99,24 @@
       <signature></signature>
     </div>
     <div class="fixed__btn__panel">
+      <el-button
+          size="small"
+          class="normal-btn-width"
+          @click="downLoadBill(dataInfo)"
+      >{{ $t("单据预览") }}</el-button
+      >
+      <el-button
+          size="small"
+          type="warning"
+          class="normal-btn-width"
+          @click="delClick"
+      >{{ $t("删除") }}</el-button
+      >
       <el-button
           size="small"
           type="primary"
           class="normal-btn-width"
+          @click="submitClick"
       >{{ $t("提交") }}</el-button
       >
     </div>
@@ -125,11 +139,15 @@ export default {
       treatment:'',
       explain:'',
       nextRebackTime:'',
-      text:''
+      text:'',
+      sa_workorder_confirmationid:'',
+      active_accoun:JSON.parse(sessionStorage.getItem('active_account')),
+      folderid:JSON.parse(sessionStorage.getItem('folderid')),
     }
   },
   methods:{
     async queryInfo(id){
+      this.sa_workorder_confirmationid = id
       const res = await this.$api.requested({
         "id": "20230211105803",
         "content": {
@@ -240,7 +258,49 @@ export default {
     },
     onClose(){
       this.$emit('onClose')
-    }
+    },
+    async delClick(){
+      const res = await this.$api.requested({
+        "id": "20230211110103",
+        "content": {
+          "sa_workorder_confirmationids": [this.sa_workorder_confirmationid]
+        }
+      })
+      if (res.code == 0){
+        this.tool.showMessage(res,()=>{})
+      }else {
+        this.drawerVisible = false
+      }
+
+    },
+    async submitClick(){
+      const res = await this.$api.requested({
+        "id": "20230211110003",
+        "content": {
+          "sa_workorder_confirmationid": this.sa_workorder_confirmationid
+        }
+      })
+      if (res.code == 0){
+        this.tool.showMessage(res,()=>{})
+      }else {
+        this.drawerVisible = false
+      }
+    },
+    downLoadBill(data) {
+      let result = data.attinfos.filter(
+          (item) => item.usetype == "comfirmbill"
+      );
+      let http = location.href.substring(0,5) == 'https'?'https://oms.idcgroup.com.cn:8079/yosweb/#/printTable?':'http://61.164.207.46:8000/yosweb/#/printTable?'
+      let token = 'token=' + this.active_accoun.token
+      let parentid = '&parentid=' + this.folderid.appfolderid
+      let ownerid = '&ownerid=' + data.sa_workorder_confirmationid
+      let action = '&action=1'
+      let urlNew = http + token + parentid + ownerid + action
+      if (result.length == 0)
+        window.open(urlNew);
+      window.open(result[result.length - 1].url, "_self");
+      // this.$refs.checkBillRef.listData()
+    },
   },
   mounted() {
     this.tablecols = this.tool.tabelCol(this.$route.name).serviceProductBillTable.tablecols

+ 61 - 3
src/HDrpManagement/serveWorkBill/components/installationCommissioning.vue

@@ -28,7 +28,7 @@
         </el-descriptions>
       </div>
       <div style="height: 10px;background: #f5f5f5"></div>
-      <div style="margin: 10px;font-weight: bold;font-size: 16px">产品</div>
+      <div style="margin: 10px;font-weight: bold;font-size: 16px">{{$t(`产品`)}}</div>
       <div class="drawer__panel" style="margin-bottom: -10px" v-if="dataInfo.trainertitems">
         <tableDetailLayout
             :layout="tablecols"
@@ -124,10 +124,24 @@
         <signature :sa_workorder_confirmationid="sa_workorder_confirmationid"></signature>
       </div>
       <div class="fixed__btn__panel">
+        <el-button
+            size="small"
+            class="normal-btn-width"
+            @click="downLoadBill(dataInfo)"
+        >{{ $t("单据预览") }}</el-button
+        >
+        <el-button
+            size="small"
+            type="warning"
+            class="normal-btn-width"
+            @click="delClick"
+        >{{ $t("删除") }}</el-button
+        >
         <el-button
             size="small"
             type="primary"
             class="normal-btn-width"
+            @click="submitClick"
         >{{ $t("提交") }}</el-button
         >
       </div>
@@ -152,7 +166,9 @@ export default {
       node2:'',
       node3:'',
       node4:'',
-      node5:''
+      node5:'',
+      active_accoun:JSON.parse(sessionStorage.getItem('active_account')),
+      folderid:JSON.parse(sessionStorage.getItem('folderid')),
     }
   },
   methods:{
@@ -225,7 +241,49 @@ export default {
     },
     onClose(){
       this.$emit('onClose')
-    }
+    },
+    async delClick(){
+      const res = await this.$api.requested({
+        "id": "20230211110103",
+        "content": {
+          "sa_workorder_confirmationids": [this.sa_workorder_confirmationid]
+        }
+      })
+      if (res.code == 0){
+        this.tool.showMessage(res,()=>{})
+      }else {
+        this.drawerVisible = false
+      }
+
+    },
+    async submitClick(){
+      const res = await this.$api.requested({
+        "id": "20230211110003",
+        "content": {
+          "sa_workorder_confirmationid": this.sa_workorder_confirmationid
+        }
+      })
+      if (res.code == 0){
+        this.tool.showMessage(res,()=>{})
+      }else {
+        this.drawerVisible = false
+      }
+    },
+    downLoadBill(data) {
+      let result = data.attinfos.filter(
+          (item) => item.usetype == "comfirmbill"
+      );
+      let http = location.href.substring(0,5) == 'https'?'https://oms.idcgroup.com.cn:8079/yosweb/#/printTable?':'http://61.164.207.46:8000/yosweb/#/printTable?'
+      let token = 'token=' + this.active_accoun.token
+      let parentid = '&parentid=' + this.folderid.appfolderid
+      let ownerid = '&ownerid=' + data.sa_workorder_confirmationid
+      let action = '&action=1'
+      let urlNew = http + token + parentid + ownerid + action
+      if (result.length == 0)
+        window.open(urlNew);
+      window.open(result[result.length - 1].url, "_self");
+      // this.$refs.checkBillRef.listData()
+    },
   },
   mounted() {
     this.tablecols = this.tool.tabelCol(this.$route.name).serviceProductBillTable.tablecols

+ 60 - 2
src/HDrpManagement/serveWorkBill/components/installationTraining.vue

@@ -71,10 +71,24 @@
         <signature :sa_workorder_confirmationid="sa_workorder_confirmationid"></signature>
       </div>
       <div class="fixed__btn__panel">
+        <el-button
+            size="small"
+            class="normal-btn-width"
+            @click="downLoadBill(dataInfo)"
+        >{{ $t("单据预览") }}</el-button
+        >
+        <el-button
+            size="small"
+            type="warning"
+            class="normal-btn-width"
+            @click="delClick"
+        >{{ $t("删除") }}</el-button
+        >
         <el-button
             size="small"
             type="primary"
             class="normal-btn-width"
+            @click="submitClick"
         >{{ $t("提交") }}</el-button
         >
       </div>
@@ -96,7 +110,9 @@ export default {
       tablecols:[],
       sa_workorder_confirmationid:'',
       trainerContent:'',
-      trainerResult:''
+      trainerResult:'',
+      active_accoun:JSON.parse(sessionStorage.getItem('active_account')),
+      folderid:JSON.parse(sessionStorage.getItem('folderid')),
     }
   },
   methods:{
@@ -151,7 +167,49 @@ export default {
     },
     onClose(){
       this.$emit('onClose')
-    }
+    },
+    async submitClick(){
+      const res = await this.$api.requested({
+        "id": "20230211110003",
+        "content": {
+          "sa_workorder_confirmationid": this.sa_workorder_confirmationid
+        }
+      })
+      if (res.code == 0){
+        this.tool.showMessage(res,()=>{})
+      }else {
+        this.drawerVisible = false
+      }
+    },
+    async delClick(){
+      const res = await this.$api.requested({
+        "id": "20230211110103",
+        "content": {
+          "sa_workorder_confirmationids": [this.sa_workorder_confirmationid]
+        }
+      })
+      if (res.code == 0){
+        this.tool.showMessage(res,()=>{})
+      }else {
+        this.drawerVisible = false
+      }
+
+    },
+    downLoadBill(data) {
+      let result = data.attinfos.filter(
+          (item) => item.usetype == "comfirmbill"
+      );
+      let http = location.href.substring(0,5) == 'https'?'https://oms.idcgroup.com.cn:8079/yosweb/#/printTable?':'http://61.164.207.46:8000/yosweb/#/printTable?'
+      let token = 'token=' + this.active_accoun.token
+      let parentid = '&parentid=' + this.folderid.appfolderid
+      let ownerid = '&ownerid=' + data.sa_workorder_confirmationid
+      let action = '&action=1'
+      let urlNew = http + token + parentid + ownerid + action
+      if (result.length == 0)
+        window.open(urlNew);
+      window.open(result[result.length - 1].url, "_self");
+      // this.$refs.checkBillRef.listData()
+    },
   },
   mounted() {
     this.tablecols = this.tool.tabelCol(this.$route.name).serviceProductBillTable.tablecols

+ 59 - 2
src/HDrpManagement/serveWorkBill/components/nonProcessTemplate.vue

@@ -74,10 +74,24 @@
       </div>
       <div style="height: 25px;background: #f5f5f5"></div>
       <div class="fixed__btn__panel">
+        <el-button
+            size="small"
+            class="normal-btn-width"
+            @click="downLoadBill(dataInfo)"
+        >{{ $t("单据预览") }}</el-button
+        >
+        <el-button
+            size="small"
+            type="warning"
+            class="normal-btn-width"
+            @click="delClick"
+        >{{ $t("删除") }}</el-button
+        >
         <el-button
             size="small"
             type="primary"
             class="normal-btn-width"
+            @click="submitClick"
         >{{ $t("提交") }}</el-button
         >
       </div>
@@ -97,7 +111,9 @@ export default {
       inqualityguaranteeperiod:'',
       drawerVisible:false,
       tablecols:[],
-      sa_workorder_confirmationid:''
+      sa_workorder_confirmationid:'',
+      active_accoun:JSON.parse(sessionStorage.getItem('active_account')),
+      folderid:JSON.parse(sessionStorage.getItem('folderid')),
     }
   },
   methods:{
@@ -207,7 +223,48 @@ export default {
       this.$refs.signatureRef.signatureData = null
       this.$refs.signatureRef.signatureStarted = false
       this.$emit('onClose')
-    }
+    },
+    async submitClick(){
+      const res = await this.$api.requested({
+        "id": "20230211110003",
+        "content": {
+          "sa_workorder_confirmationid": this.sa_workorder_confirmationid
+        }
+      })
+      if (res.code == 0){
+        this.tool.showMessage(res,()=>{})
+      }else {
+        this.drawerVisible = false
+      }
+    },
+    async delClick(){
+      const res = await this.$api.requested({
+        "id": "20230211110103",
+        "content": {
+          "sa_workorder_confirmationids": [this.sa_workorder_confirmationid]
+        }
+      })
+      if (res.code == 0){
+        this.tool.showMessage(res,()=>{})
+      }else {
+        this.drawerVisible = false
+      }
+    },
+    downLoadBill(data) {
+      let result = data.attinfos.filter(
+          (item) => item.usetype == "comfirmbill"
+      );
+      let http = location.href.substring(0,5) == 'https'?'https://oms.idcgroup.com.cn:8079/yosweb/#/printTable?':'http://61.164.207.46:8000/yosweb/#/printTable?'
+      let token = 'token=' + this.active_accoun.token
+      let parentid = '&parentid=' + this.folderid.appfolderid
+      let ownerid = '&ownerid=' + data.sa_workorder_confirmationid
+      let action = '&action=1'
+      let urlNew = http + token + parentid + ownerid + action
+      if (result.length == 0)
+        window.open(urlNew);
+      window.open(result[result.length - 1].url, "_self");
+      // this.$refs.checkBillRef.listData()
+    },
   },
   mounted() {
     this.tablecols = this.tool.tabelCol(this.$route.name).serviceProductBillTable.tablecols

+ 3 - 1
src/HDrpManagement/serveWorkBill/modules/Materials/index.vue

@@ -69,7 +69,7 @@ export default {
       params:{
         "id": 2026012813264502,
         "content": {
-          "sa_workorderid": this.$route.query.id,
+          "sa_workorderid": '',
           "pageNumber": 1,
           "pageSize": 50,
           "where": {
@@ -87,6 +87,8 @@ export default {
   },
   methods: {
     async listData(){
+      console.log(this.data.sa_workorderid)
+      this.params.content.sa_workorderid = this.data.sa_workorderid
       const res = await this.$api.requested(this.params)
       this.list = res.data
       this.total = res.total

+ 6 - 6
src/HDrpManagement/serveWorkBill/modules/checkBill/add.vue

@@ -2,18 +2,18 @@
   <div>
     <el-button
         size="small"
-        type="primary"
+        :type="btnType?btnType:'primary'"
         @click="addBtn"
-    >{{ $t("新 建") }}</el-button
+    >{{ $t(btnTitle) }}</el-button
     >
     <!-- 非工序模板   -->
     <nonProcessTemplate ref="nonProcessRef" @onClose="onClose"></nonProcessTemplate>
     <!-- 安装调试   -->
-    <installationCommissioning ref="commissioningRef"></installationCommissioning>
+    <installationCommissioning ref="commissioningRef" @onClose="onClose"></installationCommissioning>
     <!-- 安装培训   -->
-    <installationTraining ref="trainingRef"></installationTraining>
+    <installationTraining ref="trainingRef" @onClose="onClose"></installationTraining>
     <!-- 通用模板   -->
-    <generalTemplate ref="generalRef"></generalTemplate>
+    <generalTemplate ref="generalRef" @onClose="onClose"></generalTemplate>
   </div>
 </template>
 
@@ -25,7 +25,7 @@ import installationCommissioning from "@/HDrpManagement/serveWorkBill/components
 import installationTraining from "@/HDrpManagement/serveWorkBill/components/installationTraining";
 export default {
   name: "add",
-  props:["mainData",'id','list'],
+  props:["mainData",'id','list','btnTitle','btnType'],
   components:{signature,nonProcessTemplate,generalTemplate,installationCommissioning,installationTraining},
   data(){
     return {

+ 20 - 11
src/HDrpManagement/serveWorkBill/modules/checkBill/index.vue

@@ -14,7 +14,7 @@
         clearable
       >
       </el-input>
-      <add v-if="mainData.status == '进行中'" :mainData="mainData" @onSuccess="listData" :list="list"></add>
+      <add v-if="mainData.status == '进行中'" :mainData="mainData" @onSuccess="listData" :list="list" btnTitle="新 建" btnType="primary"></add>
     </div>
     <div style="margin-top: 15px">
       <tableLayout
@@ -46,6 +46,8 @@
         </template>
         <template v-slot:opreation="scope">
           <slot name="download" :data="scope.data"></slot>
+          <edit class="inline-16" btnTitle="编辑" btnType="text" v-if="mainData.status == '进行中' && scope.data.status == '新建'" :mainData="mainData" @onSuccess="listData" :list="list"></edit>
+          <el-button type="text" size="mini" style="color: #67C23A" v-if="mainData.status == '进行中' &&  scope.data.status == '新建'">提交</el-button>
           <!-- <printTable :data="scope.data">
 
           </printTable> -->
@@ -71,9 +73,10 @@
 <script>
 import printTable from "./printTable";
 import add from "./add"
+import edit from "./add"
 export default {
-  props: ["data","mainData"],
-  components: { printTable,add },
+  props: ["data","mainData","sa_workorderid"],
+  components: { printTable,add,edit },
   data() {
     return {
       tableHieght: "calc(100vh - 380px)",
@@ -86,7 +89,7 @@ export default {
           pageNumber: 1,
           pageSize: 20,
           where: {
-            sa_workorderid: "",
+            sa_workorderid: this.sa_workorderid,
             condition: "",
           },
         },
@@ -98,12 +101,16 @@ export default {
     };
   },
   methods: {
-    async listData() {
-      this.params.content.where.sa_workorderid = this.$route.query.id;
-      const res = await this.$api.requested(this.params);
-      this.list = res.data;
-      this.total = res.total;
-      console.log(this.list);
+    async listData(id) {
+      if (id == -1) {
+        this.list = []
+      }else {
+        this.params.content.where.sa_workorderid = this.sa_workorderid;
+        const res = await this.$api.requested(this.params);
+        this.list = res.data;
+        this.total = res.total;
+        console.log(this.list);
+      }
     },
     async compile(data) {
       this.visible = true;
@@ -133,8 +140,10 @@ export default {
       this.listData();
     },
   },
+  mounted() {
+    // this.listData()
+  },
   created() {
-    this.listData();
     this.tablecols = this.tool.tabelCol(
       this.$route.name
     ).checkBillTable.tablecols;

+ 2 - 2
src/HDrpManagement/serveWorkBill/modules/items/index.vue

@@ -61,7 +61,7 @@
 
 <script>
 export default {
-  props: ["data"],
+  props: ["data","sa_workorderid"],
   data() {
     return {
       options: [],
@@ -69,7 +69,7 @@ export default {
       param:{
         "id": 2026012813264502,
         "content": {
-          "sa_workorderid": this.$route.query.id,
+          "sa_workorderid": this.sa_workorderid,
           "pageNumber": 1,
           "pageSize": 999,
           "where": {

+ 127 - 19
src/HDrpManagement/serveWorkBill/modules/serviceWorkOrder/index.vue

@@ -1,8 +1,8 @@
 <template>
   <div>
-    <el-tabs type="border-card" v-model="activeName" v-if="mainData.actiontype == '工序模板'">
+    <el-tabs type="border-card" v-model="activeName" v-if="internalData.actiontype == '工序模板'" @tab-click="handleClick">
       <el-tab-pane label="工序详情" name="工序详情">
-        <taskDetail :data="nodes">
+        <taskDetail :data="nodes" :nodesData="internalData" :newQuery="newQuery">
           <template v-slot:detail="scope">
             <taskListDetail
                 class="inline-16"
@@ -18,11 +18,12 @@
         <materials :data="mainData"></materials>
       </el-tab-pane>
       <el-tab-pane label="服务确认单" name="服务确认单">
-        <checkBill ref="checkBillRef" :mainData="mainData">
+        <checkBill ref="checkBillRef" :mainData="internalData" :sa_workorderid="mainData.sa_workorderid">
           <template v-slot:download="scope">
             <el-button
                 type="text"
                 size="mini"
+                class="inline-16"
                 @click="downLoadBill(scope.data)"
             >{{ $t("单 据 下 载") }}</el-button
             >
@@ -31,13 +32,13 @@
       </el-tab-pane>
       <el-tab-pane label="服务团队" name="服务团队">
         <teamList
-            v-if="tool.checkAuth($route.name, 'teamList')"
             ref="teamList"
-            :data="mainData.team"
+            :data="internalData.team"
+            :mainData="internalData"
         >
           <selectTeam ref="team" @teamChange="teamChange" slot="add">
             <el-button
-                v-if="(mainData.isServerMag || mainData.isleader) && mainData.status == '进行中'"
+                v-if="(internalData.isServerMag || internalData.isleader) && internalData.status == '进行中'"
                 class="button-new-tag"
                 size="small"
                 type="primary"
@@ -51,18 +52,19 @@
         <detailInfo :more="true"  :data="detailInfo"></detailInfo>
       </el-tab-pane>
     </el-tabs>
-    <el-tabs type="border-card" v-model="activeName" v-else>
+    <el-tabs type="border-card" v-model="activeName" v-else @tab-click="handleClick">
       <el-tab-pane label="服务商品" name="服务商品">
-        <Items :data="mainData"></Items>
+        <Items :data="internalData" :sa_workorderid="newQuery?mainData.sa_workorderid:$route.query.id"></Items>
       </el-tab-pane>
       <el-tab-pane label="服务确认单" name="服务确认单">
-        <checkBill ref="checkBillRef" :mainData="mainData">
+        <checkBill ref="checkBillRef" :mainData="internalData" :sa_workorderid="mainData.sa_workorderid">
           <template v-slot:download="scope">
             <el-button
                 type="text"
                 size="mini"
+                class="inline-16"
                 @click="downLoadBill(scope.data)"
-            >{{ $t("单   载") }}</el-button
+            >{{ $t("单据下载") }}</el-button
             >
           </template>
         </checkBill>
@@ -70,12 +72,12 @@
       <el-tab-pane label="服务团队" name="服务团队">
         <teamList
             ref="teamList"
-            :data="mainData.team"
-            :mainData="mainData"
+            :data="internalData.team"
+            :mainData="internalData"
         >
           <selectTeam ref="team" @teamChange="teamChange" slot="add">
             <el-button
-                v-if="(mainData.isServerMag || mainData.isleader) && mainData.status == '进行中'"
+                v-if="(internalData.isServerMag || internalData.isleader) && internalData.status == '进行中'"
                 class="button-new-tag"
                 size="small"
                 type="primary"
@@ -104,22 +106,66 @@ import selectTeam from "../../components/teamSelect";
 import materials from '../Materials/index'
 export default {
   name: "index",
-  props:['mainData','nodes','team_name','team_phone_number'],
+  props:['mainData','nodes','team_name','team_phone_number','newQuery'],
   components:{detailInfo,taskDetail,taskListDetail,taskListEdit,Items,checkBill,teamList,selectTeam,materials},
   data(){
     return {
       activeName:'服务商品',
       active_accoun:JSON.parse(sessionStorage.getItem('active_account')),
       folderid:JSON.parse(sessionStorage.getItem('folderid')),
-      internalData:{ ...this.mainData },
-      detailInfo:{}
+      internalData:{ isServerMag:false,isleader:false },
+      detailInfo:{},
+      nodesNow:[]
     }
   },
   methods:{
+    async queryMainData(id) {
+      console.log('输出mainData')
+      this.internalData.isServerMag = false
+      this.internalData.isleader = false
+      if (this.hrid !== 0){
+        const res_hrid = await this.$api.requested({
+          id:2025062416033402,
+          content: {
+            userid: this.userid,
+            sa_workorderid:this.mainData.sa_workorderid
+          },
+        })
+        if (res_hrid.data.isworkleader){
+          this.internalData.isServerMag = true
+        }
+      }
+      const res = await this.$api.requested({
+        id: 20230208140103,
+        content: {
+          sa_workorderid: this.mainData.sa_workorderid,
+        },
+      });
+      this.internalData = Object.assign({}, this.internalData, res.data);
+      console.log(this.internalData,'internalData3434')
+
+      if (res.data.length > 0){
+        res.data.team.forEach(item => {
+          if (item.isleader){
+            this.team_name = item.name
+            this.team_phone_number = item.phonenumber
+            this.team_userid = item.userid
+            if (item.userid == this.userid){
+              this.internalData.isleader = true
+            }
+          }
+        })
+        // this.nodes = this.createTreeData(res.data.nodes);
+        console.log(this.nodes,'nodes的数据1222')
+      }
+      this.changeDataStructure(this.internalData)
+    },
     changeDataStructure(newData){
       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 = '服务商品'
@@ -151,7 +197,7 @@ export default {
             { label: "项目名称", value: this.internalData.projectname},
             {
               label: "省市县",
-              value: `${this.internalData.province}-${this.internalData.city}-${this.internalData.county}`,
+              value: this.internalData.province?`${this.internalData.province}-${this.internalData.city}-${this.internalData.county}`:'--',
             },
             { label:'详细地址',value:this.internalData.address ? this.internalData.address : ''},
             { label: "现场联系人", value: this.internalData.scenecontact },
@@ -203,6 +249,53 @@ export default {
         }
       ];
     },
+    createTreeData(array) {
+      var that = this;
+      let arr = [];
+      function convertToElementTree(node) {
+        // 新节点
+        var elNode = {
+          amount: node["amount"],
+          attinfos: node["attinfos"],
+          changeby: node["changeby"],
+          changedate: node["changedate"],
+          changeuserid: node["changeuserid"],
+          confirm_value: node["confirm_value"],
+          finishby: node["finishby"],
+          parentid: node["parentid"],
+          sa_workorder_nodeid: node["sa_workorder_nodeid"],
+          sa_workorderid: node["sa_workorderid"],
+          sequence: node["sequence"],
+          status: node["status"],
+          textcontent: node["textcontent"],
+          workname: node["workpresetjson"].workname,
+          additem: node["workpresetjson"].additem,
+          addperson: node["workpresetjson"].amountpay,
+          confirm_options: node["workpresetjson"].confirm_options,
+          confirm: node["workpresetjson"].confirm,
+          contractupload: node["workpresetjson"].contractupload,
+          fileupload: node["workpresetjson"].fileupload,
+          itemtype: node["workpresetjson"].itemtype,
+          remarks: node["workpresetjson"].remarks,
+          required: node["workpresetjson"].required,
+          textedit: node["workpresetjson"].textedit,
+          children: [],
+        };
+
+        if (node.child && node.child.length > 0) {
+          // 如果存在子节点
+          for (var index = 0; index < node.child.length; index++) {
+            // 遍历子节点, 把每个子节点看做一颗独立的树, 传入递归构造子树, 并把结果放回到新node的children中
+            elNode.children.push(convertToElementTree(node.child[index]));
+          }
+        }
+        return elNode;
+      }
+      array.forEach((element) => {
+        arr.push(convertToElementTree(element));
+      });
+      return arr;
+    },
     downLoadBill(data) {
       let result = data.attinfos.filter(
           (item) => item.usetype == "comfirmbill"
@@ -216,7 +309,7 @@ export default {
       if (result.length == 0)
         window.open(urlNew);
       window.open(result[result.length - 1].url, "_self");
-      this.$refs.checkBillRef.listData()
+      // this.$refs.checkBillRef.listData()
     },
     async teamChange(data) {
       let result = data.map((item) => {
@@ -236,9 +329,24 @@ export default {
         this.$refs.teamList.listData();
       });
     },
+    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)
+      }else if (this.activeName == '服务团队'){
+        let id = this.internalData.sa_workorderid ? this.internalData.sa_workorderid : -1
+        this.$refs.teamList.listData(id)
+      }
+    }
   },
   mounted() {
-    this.changeDataStructure()
+    if (this.newQuery){
+      this.queryMainData()
+    }else {
+
+      this.changeDataStructure()
+    }
   }
 
 }

+ 56 - 3
src/HDrpManagement/serveWorkBill/modules/taskDetail/index.vue

@@ -14,7 +14,7 @@
       </el-input>
     </div> -->
     <el-table
-      :data="data"
+      :data="tableData"
       stripe
       border
       row-key="sa_workorder_nodeid"
@@ -178,7 +178,7 @@
 
 <script>
 export default {
-  props: ["data"],
+  props: ["data","nodesData","newQuery"],
   components: {},
   data() {
     return {
@@ -187,6 +187,53 @@ export default {
   },
   created() {},
   methods: {
+    createTreeData(array) {
+      var that = this;
+      let arr = [];
+      function convertToElementTree(node) {
+        // 新节点
+        var elNode = {
+          amount: node["amount"],
+          attinfos: node["attinfos"],
+          changeby: node["changeby"],
+          changedate: node["changedate"],
+          changeuserid: node["changeuserid"],
+          confirm_value: node["confirm_value"],
+          finishby: node["finishby"],
+          parentid: node["parentid"],
+          sa_workorder_nodeid: node["sa_workorder_nodeid"],
+          sa_workorderid: node["sa_workorderid"],
+          sequence: node["sequence"],
+          status: node["status"],
+          textcontent: node["textcontent"],
+          workname: node["workpresetjson"].workname,
+          additem: node["workpresetjson"].additem,
+          addperson: node["workpresetjson"].amountpay,
+          confirm_options: node["workpresetjson"].confirm_options,
+          confirm: node["workpresetjson"].confirm,
+          contractupload: node["workpresetjson"].contractupload,
+          fileupload: node["workpresetjson"].fileupload,
+          itemtype: node["workpresetjson"].itemtype,
+          remarks: node["workpresetjson"].remarks,
+          required: node["workpresetjson"].required,
+          textedit: node["workpresetjson"].textedit,
+          children: [],
+        };
+
+        if (node.child && node.child.length > 0) {
+          // 如果存在子节点
+          for (var index = 0; index < node.child.length; index++) {
+            // 遍历子节点, 把每个子节点看做一颗独立的树, 传入递归构造子树, 并把结果放回到新node的children中
+            elNode.children.push(convertToElementTree(node.child[index]));
+          }
+        }
+        return elNode;
+      }
+      array.forEach((element) => {
+        arr.push(convertToElementTree(element));
+      });
+      return arr;
+    },
     handleSizeChange(val) {
       // console.log(`每页 ${val} 条`);
       this.params.content.pageSize = val;
@@ -198,7 +245,13 @@ export default {
       this.department();
     },
   },
-  mounted() {},
+  mounted() {
+    if (this.newQuery){
+      this.tableData = this.createTreeData(this.nodesData.nodes)
+    }else {
+      this.tableData = this.data
+    }
+  },
 };
 </script>
 

+ 22 - 15
src/HDrpManagement/serveWorkBill/modules/teamList/index.vue

@@ -44,7 +44,7 @@
         <el-table-column :label="$t('操作')">
           <template slot-scope="scope">
             <el-button
-              :disabled="mainData.status != '进行中' || scope.row.isleader"
+              :disabled="mainData.status != '进行中' || scope.row.isleader ||  !mainData.isServerMag"
               class="inline-16"
               size="mini"
               type="text"
@@ -76,24 +76,31 @@ export default {
     };
   },
   methods: {
-    async listData() {
-      const res = await this.$api.requested({
-        id: 20220930103501,
-        content: {
-          ownertable: "sa_workorder",
-          ownerid: this.$route.query.id,
-        },
-      });
-      res.data[0].team.unshift(...res.data[0].teamleader);
-      this.teamList = res.data[0].team;
-      console.log(this.teamList, "团队数据");
+    async listData(id) {
+      if (id == -1){
+        this.teamList = []
+      }else {
+        const res = await this.$api.requested({
+          id: 20220930103501,
+          content: {
+            ownertable: "sa_workorder",
+            ownerid: id?id:this.mainData.sa_workorderid,
+          },
+        });
+        if (res.data.length > 0){
+          res.data[0].team.unshift(...res.data[0].teamleader);
+          this.teamList = res.data[0].team;
+          console.log(this.teamList, "团队数据");
+        }
+      }
+
     },
     async delPeople(data) {
       const res = await this.$api.requested({
         id: 20220930103803,
         content: {
           ownertable: "sa_workorder",
-          ownerid: this.$route.query.id,
+          ownerid: this.mainData.sa_workorderid,
           userids: [data.userid],
         },
       });
@@ -106,7 +113,7 @@ export default {
         id: 20220930103703,
         content: {
           ownertable: "sa_workorder",
-          ownerid: this.$route.query.id,
+          ownerid: this.mainData.sa_workorderid,
           userid: data.userid,
         },
       });
@@ -116,7 +123,7 @@ export default {
     },
   },
   created() {
-    this.listData();
+    // this.listData();
   },
 };
 </script>

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

@@ -18,6 +18,8 @@
         <serviceApplication  ref="serviceApplicationRef" v-if="mainData" :mainData="mainData" :new-query="true"></serviceApplication>
       </div>
       <div slot="slot1">
+        <serviceWorkOrder ref="serviceWorkOrderRef" v-if="mainData" :mainData="mainData" :nodes="nodes"
+                          :team_name="team_name" :team_phone_number="team_phone_number" :new-query="true"></serviceWorkOrder>
       </div>
       <div slot="slot2" >
       </div>
@@ -27,15 +29,20 @@
 
 <script>
 import serviceApplication from "@/HDrpManagement/serveBillMag/components/serviceApplication";
+import serviceWorkOrder from '@/HDrpManagement/serveWorkBill/modules/serviceWorkOrder/index'
 export default {
   name: "detail",
   components:{
-    serviceApplication
+    serviceApplication,
+    serviceWorkOrder
   },
   data(){
     return {
       mainData:{},
       mainAreaData:{},
+      nodes: [],
+      team_name:'',
+      team_phone_number:'',
     }
   },
   methods:{