Bläddra i källkod

服务工单,服务申请单管理bug修复

qymljy 3 månader sedan
förälder
incheckning
e65b30b990

+ 25 - 9
src/HDrpManagement/serveBillMag/components/serviceApplication.vue

@@ -1,14 +1,14 @@
 <template>
   <div>
     <el-tabs type="border-card" v-model="activeName" @tab-click="handleClick">
-      <el-tab-pane label="服务商品" name="服务商品" v-if="mainData.servicetype != '售前' && mainData.servicetype != '历史售后'">
-        <productTable ref="product">
-          <addProduct v-if="tool.checkAuth($route.name,'serveProduct') && mainData.status == '新建'" slot="addProduct" :data="mainData" @onSuccess="$refs.product.listData()" />
+      <el-tab-pane label="服务商品" name="服务商品" v-if="internalData.servicetype != '售前' && internalData.servicetype != '历史售后'">
+        <productTable ref="product" :data="mainData" :newQuery="newQuery">
+          <addProduct v-if="tool.checkAuth($route.name,'serveProduct') && internalData.status == '新建'" slot="addProduct" :data="mainData" @onSuccess="$refs.product.listData()" />
           <template v-slot:editProduct="scope">
-            <el-button class="inline-16" v-if="tool.checkAuth($route.name,'serveProduct') && mainData.status == '新建'" type="text" size="mini" @click="$refs.product.currentProduct=scope.data">{{$t('编 辑')}}</el-button>
+            <el-button class="inline-16" v-if="tool.checkAuth($route.name,'serveProduct') && internalData.status == '新建'" type="text" size="mini" @click="$refs.product.currentProduct=scope.data">{{$t('编 辑')}}</el-button>
           </template>
           <template v-slot:delProduct="scope">
-            <delete-btn nameId="20230206162003" v-if="tool.checkAuth($route.name,'serveProduct') && mainData.status == '新建'" nameKey="sa_serviceorderitemsids" :id="scope.data.sa_serviceorderitemsid" @deleteSuccess="$refs.product.listData()"></delete-btn>
+            <delete-btn nameId="20230206162003" v-if="tool.checkAuth($route.name,'serveProduct') && internalData.status == '新建'" nameKey="sa_serviceorderitemsids" :id="scope.data.sa_serviceorderitemsid" @deleteSuccess="$refs.product.listData()"></delete-btn>
           </template>
         </productTable>
       </el-tab-pane>
@@ -30,16 +30,27 @@ import infoDetail from '@/components/InfoDetail/index'
 export default {
   name: "serviceApplication",
   components:{detailInfo,productTable,addProduct,infoDetail},
-  props:["mainData"],
+  props:["mainData","newQuery"],
   data(){
     return {
       detailInfo:{},
       detailInfo2:{},
       activeName:'',
-      internalData:{ ...this.mainData }
+      internalData:{ ...this.mainData },
+      mainDataN:{}
     }
   },
   methods:{
+    async queryMain(){
+      const res = await this.$api.requested({
+        "id":20230206091603,
+        "content": {
+          "sa_serviceorderid": this.mainData.sa_serviceorderid
+        }
+      })
+      this.mainDataN = res.data
+      this.changeDataStructure(res.data)
+    },
     changeDataStructure(newData){
 
       if (newData){
@@ -47,7 +58,7 @@ export default {
       }else {
         this.internalData = { ...this.mainData }
       }
-      console.log(this.internalData,'internalData')
+
       this.activeName = this.internalData.servicetype == '售前' || this.internalData.servicetype == '历史售后'?'申请信息':'服务商品'
       let that = this;
       this.detailInfo = [
@@ -132,7 +143,12 @@ export default {
     handleClick(){}
   },
   mounted() {
-    this.changeDataStructure()
+    if (this.newQuery){
+      this.queryMain()
+    }else {
+      this.changeDataStructure()
+    }
+
   }
 }
 </script>

+ 8 - 5
src/HDrpManagement/serveBillMag/modules/detail.vue

@@ -138,11 +138,14 @@ export default {
           "isproxy":1
         }
       })
-      res.data.forEach(item => {
-        if (item.userid == this.nowUserid && item.editable){
-          this.submitDis = false
-        }
-      })
+      if (res.data){
+        res.data.forEach(item => {
+          if (item.userid == this.nowUserid && item.editable){
+            this.submitDis = false
+          }
+        })
+      }
+
     },
     async queryMainData(id) {
       const res = await this.$api.requested({

+ 3 - 5
src/HDrpManagement/serveBillMag/modules/product/index.vue

@@ -62,7 +62,7 @@
 
 <script>
 export default {
-  props:["data"],
+  props:["data","newQuery"],
   data () {
     return {
       tableHieght:"calc(100vh - 530px)",
@@ -71,7 +71,6 @@ export default {
       total:0,
       params:{
         "id": 20230206161903,
-        "version":1,
         "content": {
             "sa_serviceorderid":'',
             "pageNumber":1,
@@ -92,9 +91,8 @@ export default {
     async save (data) {
       let res = await this.$api.requested({
         "id": "20230206161803",
-        "version":1,
         "content": {
-            "sa_serviceorderid":this.$route.query.id,
+            "sa_serviceorderid":this.data.sa_serviceorderid,
             "iteminfos":[
                 {
                   "sa_serviceorderitemsid": data.sa_serviceorderitemsid,
@@ -113,7 +111,7 @@ export default {
       })
     },
     async listData(){
-      this.params.content.sa_serviceorderid = this.$route.query.id
+      this.params.content.sa_serviceorderid = this.newQuery?this.data.sa_serviceorderid:this.$route.query.id
       const res = await this.$api.requested(this.params)
       this.list = res.data
       this.total = res.total

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

@@ -56,34 +56,46 @@
         </tableDetailLayout>
       </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">
         <div style="display: flex;justify-content: space-between">
           <div style="display: flex;justify-content: left">
-            <div style="color: #999;font-size: 14px;margin-right: 10px">反应速度:</div>
+            <div style="color: #999;font-size: 14px;margin-right: 10px">{{$t(`反应速度`)}}:</div>
             <el-rate v-model="mainData.responsescore"></el-rate>
           </div>
           <div style="display: flex;justify-content: left">
-            <div style="color: #999;font-size: 14px;margin-right: 10px">配合态度:</div>
+            <div style="color: #999;font-size: 14px;margin-right: 10px">{{$t(`配合态度`)}}:</div>
             <el-rate v-model="mainData.attitudescore"></el-rate>
           </div>
           <div style="display: flex;justify-content: left">
-            <div style="color: #999;font-size: 14px;margin-right: 10px">满意态度:</div>
+            <div style="color: #999;font-size: 14px;margin-right: 10px">{{$t(`满意态度`)}}:</div>
             <el-rate v-model="mainData.satisfaction"></el-rate>
           </div>
         </div>
       </div>
       <div style="height: 10px;background: #f5f5f5"></div>
-      <div style="margin: 10px;font-weight: bold;font-size: 16px">客户签字</div>
-      <div class="drawer__panel" style="margin-bottom: -10px"></div>
+      <div style="margin: 10px;font-weight: bold;font-size: 16px">{{$t(`客户签字`)}}</div>
+      <div class="drawer__panel" style="margin-bottom: -10px">
+        <signature></signature>
+      </div>
+      <div class="fixed__btn__panel">
+        <el-button
+            size="small"
+            type="primary"
+            class="normal-btn-width"
+        >{{ $t("提交") }}</el-button
+        >
+      </div>
     </el-drawer>
   </div>
 </template>
 
 <script>
+import signature from '@/HDrpManagement/serveWorkBill/modules/signature/index'
 export default {
   name: "add",
   props:["mainData",'id'],
+  components:{signature},
   data(){
     return {
       drawerVisible:false,

+ 1 - 1
src/HDrpManagement/serveWorkBill/modules/checkBill/index.vue

@@ -14,7 +14,7 @@
         clearable
       >
       </el-input>
-      <add v-if="mainData.status != '待接单' && mainData.status != '待开始'" :mainData="mainData" @onSuccess="listData"></add>
+      <add v-if="mainData.status == '进行中'" :mainData="mainData" @onSuccess="listData"></add>
     </div>
     <div style="margin-top: 15px">
       <tableLayout

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

@@ -128,7 +128,7 @@
 <!--        />-->
       </div>
       <div slot="slot0">
-        <serviceApplication  ref="serviceApplicationRef" v-if="mainData" :mainData="mainData"></serviceApplication>
+        <serviceApplication  ref="serviceApplicationRef" v-if="mainData" :mainData="mainData" :newQuery="true"></serviceApplication>
       </div>
       <div slot="slot1">
         <serviceWorkOrder ref="serviceWorkOrderRef" v-if="mainData" :mainData="mainData" :nodes="nodes"

+ 2 - 4
src/HDrpManagement/serveWorkBill/modules/serviceWorkOrder/index.vue

@@ -21,7 +21,6 @@
         <checkBill ref="checkBillRef" :mainData="mainData">
           <template v-slot:download="scope">
             <el-button
-                v-if="tool.checkAuth($route.name, 'checkBillDetail')"
                 type="text"
                 size="mini"
                 @click="downLoadBill(scope.data)"
@@ -38,7 +37,7 @@
         >
           <selectTeam ref="team" @teamChange="teamChange" slot="add">
             <el-button
-                v-if="(mainData.isServerMag || mainData.isleader) && mainData.status !== '已完成'"
+                v-if="(mainData.isServerMag || mainData.isleader) && mainData.status == '进行中'"
                 class="button-new-tag"
                 size="small"
                 type="primary"
@@ -60,7 +59,6 @@
         <checkBill ref="checkBillRef" :mainData="mainData">
           <template v-slot:download="scope">
             <el-button
-                v-if="tool.checkAuth($route.name, 'checkBillDetail')"
                 type="text"
                 size="mini"
                 @click="downLoadBill(scope.data)"
@@ -77,7 +75,7 @@
         >
           <selectTeam ref="team" @teamChange="teamChange" slot="add">
             <el-button
-                v-if="(mainData.isServerMag || mainData.isleader) && mainData.status !== '已完成'"
+                v-if="(mainData.isServerMag || mainData.isleader) && mainData.status == '进行中'"
                 class="button-new-tag"
                 size="small"
                 type="primary"

+ 162 - 0
src/HDrpManagement/serveWorkBill/modules/signature/index.vue

@@ -0,0 +1,162 @@
+<template>
+  <div class="signature-container">
+    <!-- 签字按钮 -->
+    <button @click="showSignature = true" class="sign-btn">点击签字</button>
+
+    <!-- 签名弹窗 -->
+    <div v-if="showSignature" class="modal">
+      <div class="modal-content">
+        <h3>请在此处签字</h3>
+        <div class="canvas-container">
+          <canvas
+              ref="canvas"
+              width="400"
+              height="200"
+              @touchstart.prevent="startDrawing"
+              @touchmove.prevent="draw"
+              @touchend="stopDrawing"
+              @mousedown="startDrawing"
+              @mousemove="draw"
+              @mouseup="stopDrawing"
+              @mouseleave="stopDrawing"
+          ></canvas>
+        </div>
+        <div class="controls">
+          <button @click="clearCanvas">清空</button>
+          <button @click="saveSignature">确认签字</button>
+          <button @click="showSignature = false">取消</button>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "index",
+  data() {
+    return {
+      showSignature: false,
+      isDrawing: false,
+      ctx: null,
+      canvas: null,
+      signatureData: null // 保存 base64 图片
+    };
+  },
+  mounted() {
+    this.initCanvas();
+  },
+  methods: {
+    initCanvas() {
+      this.canvas = this.$refs.canvas;
+      this.ctx = this.canvas.getContext('2d');
+      this.ctx.lineCap = 'round';
+      this.ctx.lineJoin = 'round';
+      this.ctx.lineWidth = 3;
+      this.ctx.strokeStyle = '#000';
+    },
+    startDrawing(e) {
+      this.isDrawing = true;
+      const rect = this.canvas.getBoundingClientRect();
+      const x = (e.clientX || e.touches[0].clientX) - rect.left;
+      const y = (e.clientY || e.touches[0].clientY) - rect.top;
+      this.ctx.moveTo(x, y);
+    },
+    draw(e) {
+      if (!this.isDrawing) return;
+      const rect = this.canvas.getBoundingClientRect();
+      const x = (e.clientX || e.touches[0].clientX) - rect.left;
+      const y = (e.clientY || e.touches[0].clientY) - rect.top;
+      this.ctx.lineTo(x, y);
+      this.ctx.stroke();
+    },
+    stopDrawing() {
+      if (this.isDrawing) {
+        this.isDrawing = false;
+        this.ctx.closePath();
+      }
+    },
+    clearCanvas() {
+      this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);
+    },
+    saveSignature() {
+      this.signatureData = this.canvas.toDataURL('image/png');
+      this.showSignature = false;
+      // 将签名数据传递给父组件或其他处理逻辑
+      this.$emit('signature-complete', this.signatureData);
+    }
+  }
+}
+</script>
+
+<style scoped>
+.signature-container {
+  padding: 20px;
+}
+
+.sign-btn {
+  background-color: #007bff;
+  color: white;
+  border: none;
+  padding: 10px 20px;
+  font-size: 16px;
+  cursor: pointer;
+  border-radius: 4px;
+}
+
+.modal {
+  position: fixed;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100%;
+  background-color: rgba(0, 0, 0, 0.5);
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  z-index: 999;
+}
+
+.modal-content {
+  background: white;
+  padding: 20px;
+  border-radius: 8px;
+  width: 500px;
+  max-width: 90%;
+}
+
+.canvas-container {
+  margin: 20px 0;
+  border: 1px solid #ccc;
+  border-radius: 4px;
+  overflow: hidden;
+}
+
+.controls {
+  display: flex;
+  gap: 10px;
+  justify-content: center;
+}
+
+.controls button {
+  padding: 8px 16px;
+  border: none;
+  border-radius: 4px;
+  cursor: pointer;
+}
+
+.controls button:nth-child(1) {
+  background-color: #dc3545;
+  color: white;
+}
+
+.controls button:nth-child(2) {
+  background-color: #28a745;
+  color: white;
+}
+
+.controls button:nth-child(3) {
+  background-color: #6c757d;
+  color: white;
+}
+</style>

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

@@ -44,7 +44,7 @@
         <el-table-column :label="$t('操作')">
           <template slot-scope="scope">
             <el-button
-              :disabled="!tool.checkAuth($route.name, 'teamHandle') || mainData.status == '已完成'"
+              :disabled="mainData.status != '进行中'"
               class="inline-16"
               size="mini"
               type="text"
@@ -53,7 +53,7 @@
             >
             <el-button
               :disabled="
-                !mainData.isServerMag || scope.row.isleader || mainData.status == '已完成'
+                !mainData.isServerMag || scope.row.isleader || mainData.status != '进行中'
               "
               size="mini"
               type="text"

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

@@ -15,7 +15,7 @@
         @pageChange="pageChange"
         @onEditSuccess="queryMainData($route.query.id)">
       <div slot="slot0" >
-        <serviceApplication  ref="serviceApplicationRef" v-if="mainData" :mainData="mainData"></serviceApplication>
+        <serviceApplication  ref="serviceApplicationRef" v-if="mainData" :mainData="mainData" :new-query="true"></serviceApplication>
       </div>
       <div slot="slot1">
       </div>