Browse Source

Merge branch 'table' into xiaoqin

codeMan 2 years ago
parent
commit
b3e3fdc76c

+ 5 - 0
package-lock.json

@@ -5258,6 +5258,11 @@
         "entities": "^2.0.0"
       }
     },
+    "dom-to-image": {
+      "version": "2.6.0",
+      "resolved": "https://registry.npmmirror.com/dom-to-image/-/dom-to-image-2.6.0.tgz",
+      "integrity": "sha512-Dt0QdaHmLpjURjU7Tnu3AgYSF2LuOmksSGsUcE6ItvJoCWTBEmiMXcqBdNSAm9+QbbwD7JMoVsuuKX6ZVQv1qA=="
+    },
     "dom7": {
       "version": "3.0.0",
       "resolved": "https://registry.npmmirror.com/dom7/-/dom7-3.0.0.tgz",

+ 1 - 0
package.json

@@ -19,6 +19,7 @@
     "core-js": "^3.8.3",
     "countup.js": "^2.0.8",
     "cross-env": "^7.0.3",
+    "dom-to-image": "^2.6.0",
     "element-ui": "^2.15.6",
     "file-saver": "^2.0.5",
     "increase-memory-limit": "^1.0.7",

+ 3 - 2
public/index.html

@@ -3,8 +3,9 @@
   <head>
     <meta charset="utf-8">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta name="viewport" content="width=device-width,initial-scale=1.0">
-    <link href="//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
+    <meta name="viewport" content="width=device-width, user-scalable=yes">
+    <!-- <meta name="viewport" content="width=device-width,initial-scale=1.0"> -->
+    <!-- <link href="//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"> -->
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
     <title><%= htmlWebpackPlugin.options.title %></title>
   </head>

+ 5 - 0
src/HDrpManagement/serveWorkBill/modules/checkBill/index.vue

@@ -22,6 +22,9 @@
         </template>
         <template v-slot:opreation="scope">
           <slot name="download" :data="scope.data"></slot>
+          <printTable :data="scope.data">
+
+          </printTable>
         </template>
       </tableLayout>
     </div>
@@ -41,8 +44,10 @@
 </template>
 
 <script>
+import printTable from './printTable'
 export default {
   props:["data"],
+  components:{printTable},
   data () {
     return {
       tableHieght:"calc(100vh - 380px)",

+ 471 - 0
src/HDrpManagement/serveWorkBill/modules/checkBill/printTable.vue

@@ -0,0 +1,471 @@
+
+<template>
+  <div>
+    <el-button type="text" size="mini" @click="compile">单 据 下 载</el-button>
+    <el-dialog :visible.sync="visible" append-to-body width="1000px">
+      <!--安装培训确认单-->
+      <div ref="container" style="background:#ffffff" v-if="detail.workorder.type == '安装培训'">
+        <div slot="title" style="text-align: center;width: 100%;">
+            <h2 style="margin:0">浙江班尼戈智慧管网股份有限公司</h2>
+            <h3 style="padding:10px;text-align:center">BZ/Q(EO)P38-02系统《E服务确认单》 </h3>
+            <div class="flex">
+                <p>日期:{{detail.createdate}}</p>
+                  <p> 编号:{{detail.confirmationno}}</p>
+            </div>
+        </div>
+        <table id="header__table" border="1" style="border-collapse: collapse;border:1px solid #EBEBED;">
+          <tr>
+            <td class="td__title">服务分类</td>
+            <td>{{ detail.workorder.servicetype || '--' }}</td>
+            <td class="td__title">应用系统</td>
+            <td>{{ detail.workorder.class1 || '--' }}</td>
+            <td class="td__title">工单负责人</td>
+            <td>{{ detail.workorder.projectleader || '--' }}</td>
+          </tr>
+          <tr>
+            <td class="td__title">项目名称</td>
+            <td>{{ detail.workorder.projectname || '--' }}</td>
+            <td class="td__title">业务员负责人</td>
+            <td>{{ detail.workorder.saler_name || '--' }}</td>
+            <td class="td__title">服务经销商</td>
+            <td>{{ detail.workorder.enterprisename || '--' }}</td>
+          </tr>
+          <tr>
+            <td class="td__title">联系人</td>
+            <td>{{ detail.workorder.scenecontact || '--' }}</td>
+            <td class="td__title">联系方式</td>
+            <td>{{ detail.workorder.scenecontactphonenumber || '--' }}</td>
+            <td class="td__title">地址</td>
+            <td>{{ detail.workorder.province + detail.workorder.city + detail.workorder.county + detail.workorder.address }}</td>
+          </tr>
+          <tr>
+            <td colspan="6" style="padding:0">
+              <el-table :data="detail.trainers" :header-cell-style="{background:'#F2F3F5',color:'#000000'}" size="mini">
+              <el-table-column width="260" prop="name" label="培训人员姓名">
+                <template slot-scope="scope">
+                    {{ scope.row.name ? scope.row.name : '--' }}
+                </template>
+              </el-table-column>
+              <el-table-column prop="position"  label="职务">
+                <template slot-scope="scope">
+                    {{ scope.row.position ? scope.row.position : '--' }}
+                </template>
+              </el-table-column>
+              <el-table-column width="200" prop="phonenumber"  label="电话">
+                <template slot-scope="scope">
+                    {{ scope.row.phonenumber ? scope.row.phonenumber : '--' }}
+                </template>
+              </el-table-column>
+              <el-table-column width="200" prop="enterprisename"  label="所属经销商">
+                <template slot-scope="scope">
+                    {{ scope.row.enterprisename ? scope.row.enterprisename : '--' }}
+                </template>
+              </el-table-column>
+            </el-table>
+            </td>
+          </tr>
+          <tr>
+            <td colspan="6" style="padding:0">
+              <el-table :data="detail.trainertitems" :header-cell-style="{background:'#F2F3F5',color:'#000000'}" size="mini">
+              <el-table-column width="260" prop="itemname" label="培训产品名">
+                <template slot-scope="scope">
+                    {{ scope.row.itemname ? scope.row.itemname : '--' }}
+                </template>
+              </el-table-column>
+              <el-table-column prop="itemno"  label="编号">
+                <template slot-scope="scope">
+                    {{ scope.row.itemno ? scope.row.itemno : '--' }}
+                </template>
+              </el-table-column>
+              <el-table-column width="200" prop="qty"  label="数量">
+                <template slot-scope="scope">
+                    {{ scope.row.qty ? scope.row.qty : '--' }}
+                </template>
+              </el-table-column>
+              <el-table-column width="200" prop="model"  label="型号">
+                <template slot-scope="scope">
+                    {{ scope.row.model ? scope.row.model : '--' }}
+                </template>
+              </el-table-column>
+              <el-table-column width="200" prop="spec"  label="规格">
+                <template slot-scope="scope">
+                    {{ scope.row.spec ? scope.row.spec : '--' }}
+                </template>
+              </el-table-column>
+            </el-table>
+            </td>
+          </tr>
+          <tr>
+            <td style="background:#FAFAFA">现场培训内容</td>
+            <td colspan="5">{{ text.descriptions1 }}</td>
+          </tr>
+          <tr>
+            <td style="background:#FAFAFA">现场互动及测试培训效果</td>
+            <td colspan="5">{{ text.descriptions2 }}</td>
+          </tr>
+          <tr>
+            <td style="background:#FAFAFA">客户意见及签字确认:</td>
+            <td colspan="5"><img ref="nameImage" style="width:200px" v-if="signatureName.length" :src="signatureName[0].url" alt=""></td>
+          </tr>
+          <tr>
+            <td style="background:#FAFAFA">反应速度</td>
+            <td colspan="2">{{ detail.responsescore }}</td>
+            <td style="background:#FAFAFA">配合态度</td>
+            <td colspan="2">{{ detail.attitudescore }}</td>
+          </tr>
+          <tr>
+            <td style="background:#FAFAFA"></td>
+            <td colspan="5">尊敬的用户,感谢您一直以来对我们公司的信任和支持,为更好的为您提供优质服务和产品,请允许我们的客户人员带回您最宝贵的意见</td>
+          </tr>
+        </table>
+      </div>
+      <!--服务确认单-->
+      <div ref="container" style="background:#ffffff" v-else-if="detail.workorder.type == '服务'">
+        <div slot="title" style="text-align: center;width: 100%;">
+            <h2 style="margin:0">浙江班尼戈智慧管网股份有限公司</h2>
+            <h3 style="padding:10px;text-align:center">售后服务确认单 </h3>
+            <div class="flex">
+                <p>日期:{{detail.createdate}}</p>
+                  <p> 编号:{{detail.confirmationno}}</p>
+            </div>
+        </div>
+        <table id="header__table" border="1" style="border-collapse: collapse;border:1px solid #EBEBED;">
+          <tr>
+            <td class="td__title">项目名称</td>
+            <td>{{ detail.workorder.projectname || '--' }}</td>
+            <td class="td__title">保质期</td>
+            <td>{{ detail.workorder.isouritem === 1?'内':'外' }}</td>
+            <td class="td__title">是否有偿服务</td>
+            <td>{{ text.descriptions4 > 0?'是':'否' }}</td>
+          </tr>
+          <tr>
+            <td class="td__title">服务金额</td>
+            <td>{{ text.descriptions4 }}</td>
+            <td class="td__title">联系人</td>
+            <td>{{ detail.workorder.scenecontact || '--' }}</td>
+            <td class="td__title">联系方式</td>
+            <td>{{ detail.workorder.scenecontactphonenumber || '--' }}</td>
+          </tr>
+          <tr>
+            <td class="td__title">应用系统</td>
+            <td>{{ detail.workorder.class1 || '--' }}</td>
+            <td class="td__title">客诉大类</td>
+            <td>{{ detail.workorder.class2 || '--' }}</td>
+            <td class="td__title">地址</td>
+            <td>{{ detail.workorder.province + detail.workorder.city + detail.workorder.county + detail.workorder.address }}</td>
+          </tr>
+          <!-- <tr>
+            <td colspan="6" style="padding:0">
+              <el-table :data="detail.trainers" :header-cell-style="{background:'#F2F3F5',color:'#000000'}" size="mini">
+              <el-table-column width="260" prop="name" label="培训人员姓名">
+                <template slot-scope="scope">
+                    {{ scope.row.name ? scope.row.name : '--' }}
+                </template>
+              </el-table-column>
+              <el-table-column prop="position"  label="职务">
+                <template slot-scope="scope">
+                    {{ scope.row.position ? scope.row.position : '--' }}
+                </template>
+              </el-table-column>
+              <el-table-column width="200" prop="phonenumber"  label="电话">
+                <template slot-scope="scope">
+                    {{ scope.row.phonenumber ? scope.row.phonenumber : '--' }}
+                </template>
+              </el-table-column>
+              <el-table-column width="200" prop="enterprisename"  label="所属经销商">
+                <template slot-scope="scope">
+                    {{ scope.row.enterprisename ? scope.row.enterprisename : '--' }}
+                </template>
+              </el-table-column>
+            </el-table>
+            </td>
+          </tr> -->
+          <tr>
+            <td colspan="6" style="padding:0">
+              <el-table :data="detail.trainertitems" :header-cell-style="{background:'#F2F3F5',color:'#000000'}" size="mini">
+              <el-table-column width="260" prop="itemname" label="培训产品名">
+                <template slot-scope="scope">
+                    {{ scope.row.itemname ? scope.row.itemname : '--' }}
+                </template>
+              </el-table-column>
+              <el-table-column prop="itemno"  label="编号">
+                <template slot-scope="scope">
+                    {{ scope.row.itemno ? scope.row.itemno : '--' }}
+                </template>
+              </el-table-column>
+              <el-table-column width="200" prop="qty"  label="数量">
+                <template slot-scope="scope">
+                    {{ scope.row.qty ? scope.row.qty : '--' }}
+                </template>
+              </el-table-column>
+              <el-table-column width="200" prop="model"  label="型号">
+                <template slot-scope="scope">
+                    {{ scope.row.model ? scope.row.model : '--' }}
+                </template>
+              </el-table-column>
+              <el-table-column width="200" prop="spec"  label="规格">
+                <template slot-scope="scope">
+                    {{ scope.row.spec ? scope.row.spec : '--' }}
+                </template>
+              </el-table-column>
+            </el-table>
+            </td>
+          </tr>
+          <tr>
+            <td style="background:#FAFAFA">问题简述</td>
+            <td colspan="5">{{ detail.workorder.reason || '--' }}</td>
+          </tr>
+          <tr>
+            <td style="background:#FAFAFA">原因及处理措施</td>
+            <td colspan="5">{{ detail.confirmationcontent[8]?detail.confirmationcontent[8].treatment.confirm_value :''}}</td>
+          </tr>
+          <tr>
+            <td style="background:#FAFAFA">下次处理日期</td>
+            <td colspan="5">{{ detail.confirmationcontent[7]?detail.confirmationcontent[7].nextTreatmentTime.confirm_value:''}}</td>
+          </tr>
+          <tr>
+            <td style="background:#FAFAFA">事项说明</td>
+            <td colspan="5">{{ detail.confirmationcontent[9]?detail.confirmationcontent[9].explain.confirm_value:"" }}</td>
+          </tr>
+          <tr>
+            <td style="background:#FAFAFA">客户意见及签字确认:</td>
+            <td colspan="5"><img ref="nameImage" style="width:200px" v-if="signatureName.length" :src="signatureName[0].url" alt=""></td>
+          </tr>
+          <tr>
+            <td style="background:#FAFAFA">反应速度</td>
+            <td colspan="2">{{ detail.responsescore }}</td>
+            <td style="background:#FAFAFA">配合态度</td>
+            <td colspan="2">{{ detail.attitudescore }}</td>
+          </tr>
+          <tr>
+            <td style="background:#FAFAFA"></td>
+            <td colspan="5">尊敬的用户,感谢您一直以来对我们公司的信任和支持,为更好的为您提供优质服务和产品,请允许我们的客户人员带回您最宝贵的意见</td>
+          </tr>
+        </table>
+      </div>
+      <!--安装调试确认单-->
+      <div ref="container" style="background:#ffffff" v-else-if="detail.workorder.type == '安装调试'">
+        <div slot="title" style="text-align: center;width: 100%;">
+            <h2 style="margin:0">浙江班尼戈智慧管网股份有限公司</h2>
+            <h3 style="padding:10px;text-align:center">售后服务确认单 </h3>
+            <div class="flex">
+                <p>日期:{{detail.createdate}}</p>
+                  <p> 编号:{{detail.confirmationno}}</p>
+            </div>
+        </div>
+        <table id="header__table" border="1" style="border-collapse: collapse;border:1px solid #EBEBED;">
+          <tr>
+            <td class="td__title">项目名称</td>
+            <td>{{ detail.workorder.projectname || '--' }}</td>
+            <td class="td__title">保质期</td>
+            <td>{{ detail.workorder.isouritem === 1?'内':'外' }}</td>
+            <td class="td__title">是否有偿服务</td>
+            <td>{{ text.descriptions4 > 0?'是':'否' }}</td>
+          </tr>
+          <tr>
+            <td class="td__title">服务金额</td>
+            <td>{{ text.descriptions4 }}</td>
+            <td class="td__title">联系人</td>
+            <td>{{ detail.workorder.scenecontact || '--' }}</td>
+            <td class="td__title">联系方式</td>
+            <td>{{ detail.workorder.scenecontactphonenumber || '--' }}</td>
+          </tr>
+          <tr>
+            <td class="td__title">应用系统</td>
+            <td>{{ detail.workorder.class1 || '--' }}</td>
+            <td class="td__title">客诉大类</td>
+            <td>{{ detail.workorder.class2 || '--' }}</td>
+            <td class="td__title">地址</td>
+            <td>{{ detail.workorder.province + detail.workorder.city + detail.workorder.county + detail.workorder.address }}</td>
+          </tr>
+          <!-- <tr>
+            <td colspan="6" style="padding:0">
+              <el-table :data="detail.trainers" :header-cell-style="{background:'#F2F3F5',color:'#000000'}" size="mini">
+              <el-table-column width="260" prop="name" label="培训人员姓名">
+                <template slot-scope="scope">
+                    {{ scope.row.name ? scope.row.name : '--' }}
+                </template>
+              </el-table-column>
+              <el-table-column prop="position"  label="职务">
+                <template slot-scope="scope">
+                    {{ scope.row.position ? scope.row.position : '--' }}
+                </template>
+              </el-table-column>
+              <el-table-column width="200" prop="phonenumber"  label="电话">
+                <template slot-scope="scope">
+                    {{ scope.row.phonenumber ? scope.row.phonenumber : '--' }}
+                </template>
+              </el-table-column>
+              <el-table-column width="200" prop="enterprisename"  label="所属经销商">
+                <template slot-scope="scope">
+                    {{ scope.row.enterprisename ? scope.row.enterprisename : '--' }}
+                </template>
+              </el-table-column>
+            </el-table>
+            </td>
+          </tr> -->
+          <tr>
+            <td colspan="6" style="padding:0">
+              <el-table :data="detail.trainertitems" :header-cell-style="{background:'#F2F3F5',color:'#000000'}" size="mini">
+              <el-table-column width="260" prop="itemname" label="培训产品名">
+                <template slot-scope="scope">
+                    {{ scope.row.itemname ? scope.row.itemname : '--' }}
+                </template>
+              </el-table-column>
+              <el-table-column prop="itemno"  label="编号">
+                <template slot-scope="scope">
+                    {{ scope.row.itemno ? scope.row.itemno : '--' }}
+                </template>
+              </el-table-column>
+              <el-table-column width="200" prop="qty"  label="数量">
+                <template slot-scope="scope">
+                    {{ scope.row.qty ? scope.row.qty : '--' }}
+                </template>
+              </el-table-column>
+              <el-table-column width="200" prop="model"  label="型号">
+                <template slot-scope="scope">
+                    {{ scope.row.model ? scope.row.model : '--' }}
+                </template>
+              </el-table-column>
+              <el-table-column width="200" prop="spec"  label="规格">
+                <template slot-scope="scope">
+                    {{ scope.row.spec ? scope.row.spec : '--' }}
+                </template>
+              </el-table-column>
+            </el-table>
+            </td>
+          </tr>
+          <tr>
+            <td style="background:#FAFAFA">问题简述</td>
+            <td colspan="5">{{ detail.workorder.reason || '--' }}</td>
+          </tr>
+          <tr>
+            <td style="background:#FAFAFA">原因及处理措施</td>
+            <td colspan="5">{{ detail.confirmationcontent[8]?detail.confirmationcontent[8].treatment.confirm_value :''}}</td>
+          </tr>
+          <tr>
+            <td style="background:#FAFAFA">下次处理日期</td>
+            <td colspan="5">{{ detail.confirmationcontent[7]?detail.confirmationcontent[7].nextTreatmentTime.confirm_value:''}}</td>
+          </tr>
+          <tr>
+            <td style="background:#FAFAFA">事项说明</td>
+            <td colspan="5">{{ detail.confirmationcontent[9]?detail.confirmationcontent[9].explain.confirm_value:"" }}</td>
+          </tr>
+          <tr>
+            <td style="background:#FAFAFA">客户意见及签字确认:</td>
+            <td colspan="5"><img ref="nameImage" style="width:200px" v-if="signatureName.length" :src="signatureName[0].url" alt=""></td>
+          </tr>
+          <tr>
+            <td style="background:#FAFAFA">反应速度</td>
+            <td colspan="2">{{ detail.responsescore }}</td>
+            <td style="background:#FAFAFA">配合态度</td>
+            <td colspan="2">{{ detail.attitudescore }}</td>
+          </tr>
+          <tr>
+            <td style="background:#FAFAFA"></td>
+            <td colspan="5">尊敬的用户,感谢您一直以来对我们公司的信任和支持,为更好的为您提供优质服务和产品,请允许我们的客户人员带回您最宝贵的意见</td>
+          </tr>
+        </table>
+      </div>
+      <div class="dialog-footer">
+        <el-button type="primary" @click="submit" size="small" class="normal-btn-width">生成图片</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import domtoimage from 'dom-to-image'
+export default {
+  props: ['data'],
+  data () {
+    return {
+      visible: false,
+      detail: {
+        servicetype:{},
+        workorder:{},
+        servicetitems:[],
+        confirmationcontent:[]
+      },
+      signatureName:[],
+      needSignName:true,
+      show:true,
+      text:{
+        descriptions1:'',
+        descriptions2:'',
+        descriptions3:'',
+        descriptions4:0,
+        descriptions5:'',
+        descriptions6:'',
+        descriptions7:''
+      }
+    }
+  },
+  methods: {
+    async compile () {
+      this.visible = true
+      let res = await this.$api.requested({
+        "id": "20230211105803",
+        "version": 1,
+        "content": {
+          "sa_workorder_confirmationid": this.data.sa_workorder_confirmationid
+        }
+      })
+      res.data.confirmationcontent.forEach(e => {
+        Object.keys(e).map((key,index)=>{
+          this.text.descriptions4 += e[key].amount
+          if (key.includes('现场培训内容')) {
+            this.text.descriptions1 = e[key].confirm_value
+          }
+          if (key.includes('测试培训效果')) {
+            this.text.descriptions2 = e[key].confirm_value
+          }
+        })
+      })
+      this.detail = res.data
+      this.signatureName = this.detail.attinfos.filter(e=>{
+        if (e.usetype === 'signature') {
+          return e
+        }
+      })
+      console.log(this.detail)
+    },
+    submit () {
+      let that = this
+      domtoimage.toBlob(this.$refs.container)
+	    .then(function (blob) {
+        console.log('触发');
+        let blobUrl = window.URL.createObjectURL(blob)
+        let link = document.createElement('a')
+        link.download = that.detail.workorder.type
+        link.style.display = 'none'
+        link.href = blobUrl
+        // 触发点击
+        document.body.appendChild(link)
+        link.click()
+        // 移除
+        document.body.removeChild(link)
+      })
+    },
+  },
+  created () {
+  }
+}
+
+</script>
+<style scoped>
+#header__table tr td {
+  width: 120px;
+  padding:10px;
+}
+.td__title {
+  background: #FAFAFA;
+  color: #000000;
+  font-weight: bold;
+}
+.flex{
+      display: flex;
+      justify-content: space-between;
+  }
+
+</style>

+ 9 - 3
src/router/index.js

@@ -22,10 +22,15 @@ let routes = [
     name: 'login',
     component: () => import(/* webpackChunkName: "about" */ '@/views/login/login.vue')
   },
+  // {
+  //   path: '/accounts',
+  //   name: 'accounts',
+  //   component: () => import(/* webpackChunkName: "about" */ '@/views/select_accounts/index.vue')
+  // },
   {
-    path: '/accounts',
-    name: 'accounts',
-    component: () => import(/* webpackChunkName: "about" */ '@/views/select_accounts/index.vue')
+    path: '/printTable',
+    name: 'printTable',
+    component: () => import(/* webpackChunkName: "about" */ '@/HDrpManagement/serveWorkBill/components/printTable')
   },
   {
     path: '/main',
@@ -34,6 +39,7 @@ let routes = [
     component: () => import(/* webpackChunkName: "about" */ '@/components/newLayout/index.vue'),
     redirect: '/message',
     children: [
+      
       {
         path: '/home',
         name: 'home',

+ 5 - 2
src/utils/basic-data.js

@@ -64,8 +64,11 @@ function querySite_Parameter () {
     sessionStorage.setItem('folderid',JSON.stringify(obj))
   })
 }
-arealist ()
-getEnterpriseList()
+setTimeout(() => {
+  arealist ()
+  getEnterpriseList()
+},3000)
+
 
 export default{
   query_userauth,

+ 9 - 0
src/views/printmodel/design/index.vue

@@ -859,8 +859,17 @@ export default {
   font-weight: bold;
 }
 
+<<<<<<< HEAD
+/* /deep/ .hiprint-printElement-image-content {
+  img {
+    // content: url("~@/assets/logo.png");
+  }
+} */
+
+=======
 
 
+>>>>>>> xiaoqin
 /deep/ .toplineOfPosition {
   border: 0;
   border-top: 1px dashed purple;

+ 2 - 2
vue.config.js

@@ -10,8 +10,8 @@ module.exports = {
       },
       open: true,
       // host: '192.168.4.170',
-      host: 'localhost',
-      port: 8000,
+      host: 'oms.idcgroup.com.cn',
+      port: 8087,
       proxy: {
         '/apis': {
           target: 'http://61.164.207.46:8000',  // target host*/