printTable.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707
  1. <template>
  2. <div style="display:flex">
  3. <!-- <canvas id="mycanvas" width="400" hight="400"></canvas> -->
  4. <img style="width:100%;object-fit:fill" :src="previewImage" alt="" v-if="previewImage">
  5. <div style="display:inline-block;margin:0 auto;" v-else>
  6. <!--安装培训确认单-->
  7. <div ref="container" style="background:#ffffff" v-if="detail.workorder.type == '安装培训'">
  8. <div slot="title">
  9. <h2 style="margin:0;text-align: center;">浙江班尼戈智慧管网股份有限公司</h2>
  10. <h3 style="text-align: center;">BZ/Q(EO)P38-02系统《E服务确认单》 </h3>
  11. <div class="flex">
  12. <p>日期:{{detail.createdate}}</p>
  13. <p> 编号:{{detail.confirmationno}}</p>
  14. </div>
  15. </div>
  16. <table id="header__table" border="1" style="border-collapse: collapse;border:1px solid #EBEBED;">
  17. <tr>
  18. <td class="td__title">服务分类</td>
  19. <td>{{ detail.workorder.type || '--' }}</td>
  20. <td class="td__title">应用系统</td>
  21. <td>{{ detail.workorder.class1 || '--' }}</td>
  22. <td class="td__title">工单负责人</td>
  23. <td>{{ detail.workorder.projectleader || '--' }}</td>
  24. </tr>
  25. <tr>
  26. <td class="td__title">项目名称</td>
  27. <td>{{ detail.workorder.projectname || '--' }}</td>
  28. <td class="td__title">业务员负责人</td>
  29. <td>{{ detail.workorder.saler_name || '--' }}</td>
  30. <td class="td__title">服务经销商</td>
  31. <td>{{ detail.workorder.abbreviation || '--' }}</td>
  32. </tr>
  33. <tr>
  34. <td class="td__title">联系人</td>
  35. <td>{{ detail.workorder.scenecontact || '--' }}</td>
  36. <td class="td__title">联系方式</td>
  37. <td>{{ detail.workorder.scenecontactphonenumber || '--' }}</td>
  38. <td class="td__title">地址</td>
  39. <td>{{ detail.workorder.province + detail.workorder.city + detail.workorder.county + detail.workorder.address }}</td>
  40. </tr>
  41. <tr>
  42. <td colspan="6" style="padding:0">
  43. <el-table :data="detail.trainers" :header-cell-style="{background:'#F2F3F5',color:'#000000'}" size="mini">
  44. <el-table-column width="260" prop="name" label="培训人员姓名">
  45. <template slot-scope="scope">
  46. {{ scope.row.name ? scope.row.name : '--' }}
  47. </template>
  48. </el-table-column>
  49. <el-table-column prop="position" label="职务">
  50. <template slot-scope="scope">
  51. {{ scope.row.position ? scope.row.position : '--' }}
  52. </template>
  53. </el-table-column>
  54. <el-table-column width="200" prop="phonenumber" label="电话">
  55. <template slot-scope="scope">
  56. {{ scope.row.phonenumber ? scope.row.phonenumber : '--' }}
  57. </template>
  58. </el-table-column>
  59. <el-table-column width="200" prop="enterprisename" label="所属经销商">
  60. <template slot-scope="scope">
  61. {{ scope.row.enterprisename ? scope.row.enterprisename : '--' }}
  62. </template>
  63. </el-table-column>
  64. </el-table>
  65. </td>
  66. </tr>
  67. <tr>
  68. <td colspan="6" style="padding:0">
  69. <el-table :data="detail.trainertitems" :header-cell-style="{background:'#F2F3F5',color:'#000000'}" size="mini">
  70. <el-table-column width="260" prop="itemname" label="产品名">
  71. <template slot-scope="scope">
  72. {{ scope.row.itemname ? scope.row.itemname : '--' }}
  73. </template>
  74. </el-table-column>
  75. <el-table-column prop="itemno" width="200" label="编号">
  76. <template slot-scope="scope">
  77. {{ scope.row.itemno ? scope.row.itemno : '--' }}
  78. </template>
  79. </el-table-column>
  80. <el-table-column width="60" prop="qty" label="数量">
  81. <template slot-scope="scope">
  82. {{ scope.row.qty ? scope.row.qty : '--' }}
  83. </template>
  84. </el-table-column>
  85. <el-table-column width="200" prop="model" label="型号">
  86. <template slot-scope="scope">
  87. {{ scope.row.model ? scope.row.model : '--' }}
  88. </template>
  89. </el-table-column>
  90. <el-table-column width="200" prop="spec" label="规格">
  91. <template slot-scope="scope">
  92. {{ scope.row.spec ? scope.row.spec : '--' }}
  93. </template>
  94. </el-table-column>
  95. </el-table>
  96. </td>
  97. </tr>
  98. <tr>
  99. <td style="background:#FAFAFA">现场培训内容</td>
  100. <td colspan="5">{{ text.descriptions1 }}</td>
  101. </tr>
  102. <tr>
  103. <td style="background:#FAFAFA">现场互动及测试培训效果</td>
  104. <td colspan="5">{{ text.descriptions2 }}</td>
  105. </tr>
  106. <tr>
  107. <td style="background:#FAFAFA">客户意见及签字确认:</td>
  108. <td colspan="5"><img ref="nameImage" style="width:200px" v-if="signatureName.length" :src="signatureName[0].url" alt=""></td>
  109. </tr>
  110. <tr>
  111. <td style="background:#FAFAFA">反应速度</td>
  112. <td colspan="2">{{ detail.responsescore }}</td>
  113. <td style="background:#FAFAFA">配合态度</td>
  114. <td colspan="2">{{ detail.attitudescore }}</td>
  115. </tr>
  116. <tr>
  117. <td style="background:#FAFAFA"></td>
  118. <td colspan="5">尊敬的用户,感谢您一直以来对我们公司的信任和支持,为更好的为您提供优质服务和产品,请允许我们的客户人员带回您最宝贵的意见</td>
  119. </tr>
  120. </table>
  121. </div>
  122. <!--服务确认单-->
  123. <div ref="container" style="background:#ffffff" v-else-if="detail.workorder.type == '服务'">
  124. <div slot="title" style="text-align: center;width: 100%;">
  125. <h2 style="margin:0">浙江班尼戈智慧管网股份有限公司</h2>
  126. <h3 style="padding:10px;text-align:center">售后服务确认单 </h3>
  127. <div class="flex">
  128. <p>日期:{{detail.createdate}}</p>
  129. <p> 编号:{{detail.confirmationno}}</p>
  130. </div>
  131. </div>
  132. <table id="header__table" border="1" style="border-collapse: collapse;border:1px solid #EBEBED;">
  133. <tr>
  134. <td class="td__title">项目名称</td>
  135. <td>{{ detail.workorder.projectname || '--' }}</td>
  136. <td class="td__title">保质期</td>
  137. <td>{{ detail.workorder.isouritem === 1?'内':'外' }}</td>
  138. <td class="td__title">是否有偿服务</td>
  139. <td>{{ text.descriptions4 > 0?'是':'否' }}</td>
  140. </tr>
  141. <tr>
  142. <td class="td__title">服务金额</td>
  143. <td>{{ text.descriptions4 }}</td>
  144. <td class="td__title">联系人</td>
  145. <td>{{ detail.workorder.scenecontact || '--' }}</td>
  146. <td class="td__title">联系方式</td>
  147. <td>{{ detail.workorder.scenecontactphonenumber || '--' }}</td>
  148. </tr>
  149. <tr>
  150. <td class="td__title">应用系统</td>
  151. <td>{{ detail.workorder.class1 || '--' }}</td>
  152. <td class="td__title">客诉大类</td>
  153. <td>{{ detail.workorder.class2 || '--' }}</td>
  154. <td class="td__title">地址</td>
  155. <td>{{ detail.workorder.province + detail.workorder.city + detail.workorder.county + detail.workorder.address }}</td>
  156. </tr>
  157. <tr>
  158. <td colspan="6" style="padding:0">
  159. <el-table :data="detail.trainertitems" :header-cell-style="{background:'#F2F3F5',color:'#000000'}" size="mini">
  160. <el-table-column width="260" prop="itemname" label="产品名">
  161. <template slot-scope="scope">
  162. {{ scope.row.itemname ? scope.row.itemname : '--' }}
  163. </template>
  164. </el-table-column>
  165. <el-table-column prop="itemno" width="200" label="编号">
  166. <template slot-scope="scope">
  167. {{ scope.row.itemno ? scope.row.itemno : '--' }}
  168. </template>
  169. </el-table-column>
  170. <el-table-column width="200" prop="qty" label="数量">
  171. <template slot-scope="scope">
  172. {{ scope.row.qty ? scope.row.qty : '--' }}
  173. </template>
  174. </el-table-column>
  175. <el-table-column width="200" prop="model" label="型号">
  176. <template slot-scope="scope">
  177. {{ scope.row.model ? scope.row.model : '--' }}
  178. </template>
  179. </el-table-column>
  180. <el-table-column width="200" prop="spec" label="规格">
  181. <template slot-scope="scope">
  182. {{ scope.row.spec ? scope.row.spec : '--' }}
  183. </template>
  184. </el-table-column>
  185. </el-table>
  186. </td>
  187. </tr>
  188. <tr>
  189. <td style="background:#FAFAFA">问题简述</td>
  190. <td colspan="5">{{ detail.workorder.reason || '--' }}</td>
  191. </tr>
  192. <tr>
  193. <td style="background:#FAFAFA">原因及处理措施</td>
  194. <td colspan="5">{{ detail.confirmationcontent[8]?detail.confirmationcontent[8].treatment.confirm_value :''}}</td>
  195. </tr>
  196. <tr>
  197. <td style="background:#FAFAFA">下次处理日期</td>
  198. <td colspan="5">{{ detail.confirmationcontent[7]?detail.confirmationcontent[7].nextTreatmentTime.confirm_value:''}}</td>
  199. </tr>
  200. <tr>
  201. <td style="background:#FAFAFA">事项说明</td>
  202. <td colspan="5">{{ detail.confirmationcontent[9]?detail.confirmationcontent[9].explain.confirm_value:"" }}</td>
  203. </tr>
  204. <tr>
  205. <td style="background:#FAFAFA">客户意见及签字确认:</td>
  206. <td colspan="5"><img ref="nameImage" style="width:200px" v-if="signatureName.length" :src="signatureName[0].url" alt=""></td>
  207. </tr>
  208. <tr>
  209. <td style="background:#FAFAFA">反应速度</td>
  210. <td colspan="2">{{ detail.responsescore }}</td>
  211. <td style="background:#FAFAFA">配合态度</td>
  212. <td colspan="2">{{ detail.attitudescore }}</td>
  213. </tr>
  214. <tr>
  215. <td style="background:#FAFAFA"></td>
  216. <td colspan="5">尊敬的用户,感谢您一直以来对我们公司的信任和支持,为更好的为您提供优质服务和产品,请允许我们的客户人员带回您最宝贵的意见</td>
  217. </tr>
  218. </table>
  219. </div>
  220. <!--安装调试确认单-->
  221. <div ref="container" style="background:#ffffff" v-else-if="detail.workorder.type == '安装调试'">
  222. <div slot="title">
  223. <h2 style="margin:0;text-align: center;">浙江班尼戈智慧管网股份有限公司</h2>
  224. <h3 style="text-align: center;">BZ/Q(EO)P38-02系统《E服务确认单》 </h3>
  225. <div class="flex">
  226. <p>日期:{{detail.createdate}}</p>
  227. <p> 编号:{{detail.confirmationno}}</p>
  228. </div>
  229. </div>
  230. <table id="header__table" border="1" style="border-collapse: collapse;border:1px solid #EBEBED;">
  231. <tr>
  232. <td class="td__title">服务分类</td>
  233. <td>{{ detail.workorder.type || '--' }}</td>
  234. <td class="td__title">应用系统</td>
  235. <td>{{ detail.workorder.class1 || '--' }}</td>
  236. <td class="td__title">工单负责人</td>
  237. <td>{{ detail.workorder.projectleader || '--' }}</td>
  238. </tr>
  239. <tr>
  240. <td class="td__title">项目名称</td>
  241. <td>{{ detail.workorder.projectname || '--' }}</td>
  242. <td class="td__title">业务员负责人</td>
  243. <td>{{ detail.workorder.saler_name || '--' }}</td>
  244. <td class="td__title">服务经销商</td>
  245. <td>{{ detail.workorder.abbreviation || '--' }}</td>
  246. </tr>
  247. <tr>
  248. <td class="td__title">联系人</td>
  249. <td>{{ detail.workorder.scenecontact || '--' }}</td>
  250. <td class="td__title">联系方式</td>
  251. <td>{{ detail.workorder.scenecontactphonenumber || '--' }}</td>
  252. <td class="td__title">地址</td>
  253. <td>{{ detail.workorder.province + detail.workorder.city + detail.workorder.county + detail.workorder.address }}</td>
  254. </tr>
  255. <tr>
  256. <td colspan="6" style="padding:0">
  257. <el-table :data="detail.trainertitems" :header-cell-style="{background:'#F2F3F5',color:'#000000'}" size="mini">
  258. <el-table-column width="260" prop="itemname" label="产品名">
  259. <template slot-scope="scope">
  260. {{ scope.row.itemname ? scope.row.itemname : '--' }}
  261. </template>
  262. </el-table-column>
  263. <el-table-column prop="itemno" label="编号">
  264. <template slot-scope="scope">
  265. {{ scope.row.itemno ? scope.row.itemno : '--' }}
  266. </template>
  267. </el-table-column>
  268. <el-table-column width="200" prop="qty" label="数量">
  269. <template slot-scope="scope">
  270. {{ scope.row.qty ? scope.row.qty : '--' }}
  271. </template>
  272. </el-table-column>
  273. <el-table-column width="200" prop="model" label="型号">
  274. <template slot-scope="scope">
  275. {{ scope.row.model ? scope.row.model : '--' }}
  276. </template>
  277. </el-table-column>
  278. <el-table-column width="200" prop="spec" label="规格">
  279. <template slot-scope="scope">
  280. {{ scope.row.spec ? scope.row.spec : '--' }}
  281. </template>
  282. </el-table-column>
  283. </el-table>
  284. </td>
  285. </tr>
  286. <tr>
  287. <td colspan="2" style="background:#FAFAFA">客诉情况</td>
  288. <td colspan="1">{{ detail.workorder.reason }}</td>
  289. <td colspan="2" style="background:#FAFAFA">是否为我公司生产、出货产品?</td>
  290. <td colspan="1">{{ detail.workorder.isouritem === 1?'是':'否' }}</td>
  291. </tr>
  292. <tr>
  293. <td colspan="2" style="background:#FAFAFA">是否可以在线维修、调试</td>
  294. <td colspan="1">{{ text.descriptions1 }}</td>
  295. <td colspan="2" style="background:#FAFAFA">是否需要拆卸配件或整拆?</td>
  296. <td colspan="1">{{ text.descriptions2 }}</td>
  297. </tr>
  298. <tr>
  299. <td colspan="2" style="background:#FAFAFA">与现场协商确认维修方案(包含周期)?</td>
  300. <td colspan="1">{{ text.descriptions3 }}</td>
  301. <td colspan="2" style="background:#FAFAFA">是否有偿服务</td>
  302. <td colspan="5">{{ text.descriptions4 > 0?'是':'否' }}</td>
  303. </tr>
  304. <tr>
  305. <td colspan="2" style="background:#FAFAFA">服务金额</td>
  306. <td colspan="1">{{ text.descriptions4 }}</td>
  307. <td colspan="2" style="background:#FAFAFA">实施内容</td>
  308. <td colspan="1">{{ text.descriptions5 }}</td>
  309. </tr>
  310. <tr>
  311. <td colspan="2" style="background:#FAFAFA">服务测试内容描述</td>
  312. <td colspan="1">{{ text.descriptions6 }}</td>
  313. <td colspan="2" style="background:#FAFAFA">现场交代事项</td>
  314. <td colspan="1">{{ text.descriptions7 }}</td>
  315. </tr>
  316. <tr>
  317. <td style="background:#FAFAFA">保质期</td>
  318. <td colspan="5">{{ detail.workorder.isouritem === 1?'内':'外' }}</td>
  319. </tr>
  320. <tr>
  321. <td style="background:#FAFAFA">备注说明</td>
  322. <td colspan="5">{{ detail.workorder.remarks || '--' }}</td>
  323. </tr>
  324. <tr>
  325. <td style="background:#FAFAFA">客户意见及签字确认:</td>
  326. <td colspan="5"><img ref="nameImage" style="width:200px" v-if="signatureName.length" :src="signatureName[0].url" alt=""></td>
  327. </tr>
  328. <tr>
  329. <td style="background:#FAFAFA">反应速度</td>
  330. <td colspan="2">{{ detail.responsescore }}</td>
  331. <td style="background:#FAFAFA">配合态度</td>
  332. <td colspan="2">{{ detail.attitudescore }}</td>
  333. </tr>
  334. <tr>
  335. <td style="background:#FAFAFA"></td>
  336. <td colspan="5">尊敬的用户,感谢您一直以来对我们公司的信任和支持,为更好的为您提供优质服务和产品,请允许我们的客户人员带回您最宝贵的意见</td>
  337. </tr>
  338. </table>
  339. </div>
  340. <!--非工序确认单-->
  341. <div ref="container" style="background:#ffffff" v-else-if="detail.workorder.type == '维修'">
  342. <div slot="title">
  343. <h2 style="margin:0;text-align: center;">浙江班尼戈智慧管网股份有限公司</h2>
  344. <h3 style="text-align: center;">服务确认单 </h3>
  345. <div class="flex">
  346. <p>日期:{{detail.createdate}}</p>
  347. <p> 编号:{{detail.confirmationno}}</p>
  348. </div>
  349. </div>
  350. <table id="header__table" border="1" style="border-collapse: collapse;border:1px solid #EBEBED;">
  351. <tr>
  352. <td class="td__title">项目名称</td>
  353. <td>{{ detail.workorder.projectname || '--' }}</td>
  354. <td class="td__title">保质期</td>
  355. <td>{{detail.workorder.isouritem === 1?'内':'外'}}</td>
  356. <td class="td__title">服务方式</td>
  357. <td>{{ detail.workorder.projectleader || '--' }}</td>
  358. </tr>
  359. <tr>
  360. <td class="td__title">服务单号</td>
  361. <td>{{ detail.workorder.servicebillno || '--' }}</td>
  362. <td class="td__title">服务类型</td>
  363. <td>{{ detail.workorder.servicetype || '--' }}</td>
  364. <td class="td__title">订单号</td>
  365. <td>{{ detail.workorder.sonum || '--' }}</td>
  366. </tr>
  367. <tr>
  368. <td class="td__title">联系人</td>
  369. <td>{{ detail.workorder.scenecontact || '--' }}</td>
  370. <td class="td__title">联系方式</td>
  371. <td>{{ detail.workorder.scenecontactphonenumber || '--' }}</td>
  372. <td class="td__title">应用系统</td>
  373. <td>{{ detail.workorder.class1 || '--' }}</td>
  374. </tr>
  375. <tr>
  376. <td class="td__title">是否保内</td>
  377. <td>{{ detail.workorder.inqualityguaranteeperiod ? '是' : '否' }}</td>
  378. <td class="td__title">售后人员</td>
  379. <td>{{ detail.workorder.saler_name || '--' }}</td>
  380. <td class="td__title">经销商名称</td>
  381. <td>{{ detail.workorder.enterprisename || '--' }}</td>
  382. </tr>
  383. <tr>
  384. <td class="td__title">申请原因</td>
  385. <td colspan="6">{{ detail.workorder.reason || '--' }}</td>
  386. </tr>
  387. <tr>
  388. <td class="td__title">地址</td>
  389. <td colspan="6">{{ detail.workorder.province + detail.workorder.city + detail.workorder.county + detail.workorder.address }}</td>
  390. </tr>
  391. <tr>
  392. <td colspan="6" style="padding:0">
  393. <el-table :data="detail.trainertitems" :header-cell-style="{background:'#F2F3F5',color:'#000000'}" size="mini">
  394. <el-table-column width="260" prop="itemname" label="产品名">
  395. <template slot-scope="scope">
  396. {{ scope.row.itemname ? scope.row.itemname : '--' }}
  397. </template>
  398. </el-table-column>
  399. <el-table-column prop="itemno" width="200" label="编号">
  400. <template slot-scope="scope">
  401. {{ scope.row.itemno ? scope.row.itemno : '--' }}
  402. </template>
  403. </el-table-column>
  404. <el-table-column width="100" prop="qty" label="数量">
  405. <template slot-scope="scope">
  406. {{ scope.row.qty ? scope.row.qty : '--' }}
  407. </template>
  408. </el-table-column>
  409. <el-table-column width="200" prop="model" label="型号">
  410. <template slot-scope="scope">
  411. {{ scope.row.model ? scope.row.model : '--' }}
  412. </template>
  413. </el-table-column>
  414. <el-table-column width="200" prop="spec" label="规格">
  415. <template slot-scope="scope">
  416. {{ scope.row.spec ? scope.row.spec : '--' }}
  417. </template>
  418. </el-table-column>
  419. <el-table-column width="200" prop="resaon" label="异常现象">
  420. <template slot-scope="scope">
  421. {{ scope.row.resaon ? scope.row.resaon : '--' }}
  422. </template>
  423. </el-table-column>
  424. </el-table>
  425. </td>
  426. </tr>
  427. <tr>
  428. <td class="td__title" colspan="6" style="text-align:center">处理过程</td>
  429. </tr>
  430. <tr v-for="(item,index) in detail.trainertitems" :key="item.sa_workorder_node_itemsid">
  431. <td>
  432. <p>{{ item.itemname }}</p>
  433. <p>{{ item.itemno }}</p>
  434. </td>
  435. <td colspan="6">{{ item.processing }}</td>
  436. </tr>
  437. <tr>
  438. <tr>
  439. <td class="td__title" colspan="6" style="text-align:center">处理结果</td>
  440. </tr>
  441. <tr v-for="(item,index) in detail.trainertitems" :key="item.sa_workorder_node_itemsid">
  442. <td>
  443. <p>{{ item.itemname }}</p>
  444. <p>{{ item.itemno }}</p>
  445. </td>
  446. <td colspan="6">{{ item.result }}</td>
  447. </tr>
  448. <tr>
  449. <tr>
  450. <td class="td__title" colspan="6" style="text-align:center">原因分析</td>
  451. </tr>
  452. <tr v-for="(item,index) in detail.trainertitems" :key="item.sa_workorder_node_itemsid">
  453. <td>
  454. <p>{{ item.itemname }}</p>
  455. <p>{{ item.itemno }}</p>
  456. </td>
  457. <td colspan="6">{{ item.reason }}</td>
  458. </tr>
  459. <tr>
  460. <td style="background:#FAFAFA">客户意见及签字确认:</td>
  461. <td colspan="5"><img ref="nameImage" style="width:200px" v-if="signatureName.length" :src="signatureName[0].url" alt=""></td>
  462. </tr>
  463. <tr>
  464. <td style="background:#FAFAFA">反应速度</td>
  465. <td colspan="1">{{ detail.responsescore }}</td>
  466. <td style="background:#FAFAFA">配合态度</td>
  467. <td colspan="1">{{ detail.attitudescore }}</td>
  468. <td style="background:#FAFAFA">满意度</td>
  469. <td colspan="1">{{ detail.satisfaction }}</td>
  470. </tr>
  471. <tr>
  472. <td style="background:#FAFAFA"></td>
  473. <td colspan="5">尊敬的用户,感谢您一直以来对我们公司的信任和支持,为更好的为您提供优质服务和产品,请允许我们的客户人员带回您最宝贵的意见</td>
  474. </tr>
  475. </table>
  476. </div>
  477. <!-- <el-button style="margin:20px 0" type="primary" size="small" @click="submit">生 成 图 片</el-button> -->
  478. </div>
  479. </div>
  480. </template>
  481. <script>
  482. import domtoimage from 'dom-to-image'
  483. export default {
  484. props: ['data'],
  485. data () {
  486. return {
  487. previewImage:'',
  488. detail: {
  489. servicetype:{},
  490. workorder:{},
  491. servicetitems:[],
  492. confirmationcontent:[]
  493. },
  494. signatureName:[],
  495. needSignName:true,
  496. show:true,
  497. text:{
  498. descriptions1:'',
  499. descriptions2:'',
  500. descriptions3:'',
  501. descriptions4:0,
  502. descriptions5:'',
  503. descriptions6:'',
  504. descriptions7:''
  505. },
  506. folderid:this.$route.query.parentid,
  507. params: {
  508. "accesstoken":this.$route.query.token,
  509. "classname": "system.attachment.huawei.OBS",
  510. "method": "getFileName",
  511. "content": {
  512. "filename": '',
  513. "filetype": '',
  514. "parentid": ""//归属文件夹ID
  515. }
  516. }
  517. }
  518. },
  519. methods: {
  520. async listData () {
  521. let that = this
  522. let param = {
  523. "id": "20230211105803",
  524. "content": {
  525. "sa_workorder_confirmationid": this.$route.query.ownerid
  526. }
  527. }
  528. let res = await this.$api.requested(param)
  529. if (res.data.workorder.type == '安装测试') {
  530. res.data.confirmationcontent.forEach(e => {
  531. Object.keys(e).map((key,index)=>{
  532. this.text.descriptions4 += e[key].amount
  533. if (key.includes('现场培训内容')) {
  534. this.text.descriptions1 = e[key].confirm_value
  535. }
  536. if (key.includes('是否需要拆卸配件或整拆')) {
  537. this.text.descriptions2 = e[key].confirm_value
  538. }
  539. if (key.includes('维修方案')) {
  540. this.text.descriptions3 = e[key].confirm_value?e[key].confirm_value:e[key].textcontent
  541. }
  542. if (key.includes('实施内容记录')) {
  543. this.text.descriptions5 = e[key].confirm_value?e[key].confirm_value:e[key].textcontent
  544. }
  545. if (key.includes('与现场协商试运行测试并验收')) {
  546. this.text.descriptions6 = e[key].confirm_value?e[key].confirm_value:e[key].textcontent
  547. }
  548. if (key.includes('现场交代注意事项')) {
  549. this.text.descriptions7 = e[key].confirm_value?e[key].confirm_value:e[key].textcontent
  550. }
  551. })
  552. })
  553. } else {
  554. res.data.confirmationcontent.forEach(e => {
  555. Object.keys(e).map((key,index)=>{
  556. this.text.descriptions4 += e[key].amount
  557. if (key.includes('现场培训内容')) {
  558. this.text.descriptions1 = e[key].confirm_value
  559. }
  560. if (key.includes('测试培训效果')) {
  561. this.text.descriptions2 = e[key].confirm_value
  562. }
  563. })
  564. })
  565. }
  566. this.detail = res.data
  567. this.signatureName = this.detail.attinfos.filter(e=>{
  568. if (e.usetype === 'signature') {
  569. return e
  570. }
  571. })
  572. if (this.signatureName.length) {
  573. this.$nextTick(() => {
  574. let node = this.$refs.nameImage
  575. console.log(node.height)
  576. let CANVAS = document.createElement('canvas')
  577. CANVAS.width = node.width
  578. CANVAS.height = node.width
  579. let context = CANVAS.getContext('2d')
  580. let img = new Image()
  581. img.crossOrigin = "anonymous"
  582. img.onload=function() {
  583. console.log(img)
  584. context.drawImage(img,0,0,node.width, node.height)
  585. let dataURL = CANVAS.toDataURL("image/jpg")
  586. node.src = dataURL
  587. if (that.detail.status == '新建') {
  588. that.submit()
  589. } else {
  590. domtoimage.toJpeg(that.$refs.container,{
  591. width:that.$refs.container.width,
  592. height:that.$refs.container.height,
  593. cacheBust:true
  594. }).then((res) => {
  595. that.previewImage = res
  596. })
  597. }
  598. }
  599. img.src = this.signatureName[0].url + '?time=' + Date.now();
  600. })
  601. }
  602. },
  603. submit () {
  604. let that = this
  605. domtoimage.toBlob(this.$refs.container)
  606. .then(function (blob) {
  607. let file = new File([blob], that.detail.workorder.type, { type: blob.type })
  608. that.params.content.filename = that.detail.workorder.type + '.jpg'
  609. that.params.content.filetype = 'jpg'
  610. that.getUploadUrl(file,'jpg')
  611. that.previewImage = URL.createObjectURL(blob)
  612. console.log(that.previewImage);
  613. })
  614. },
  615. // 获取华为云上传地址
  616. async getUploadUrl (file, ext) {
  617. this.params.content.parentid = this.folderid
  618. const res = await this.$api.requested(this.params)
  619. let url = res.data.uploadurl
  620. let obsfilename = res.data.serialfilename
  621. this.upoladFileToServer(url, file, ext, obsfilename)
  622. },
  623. // 上传到华为云
  624. async upoladFileToServer (url, file, ext, obsfilename) {
  625. console.log(file)
  626. let THIS = this
  627. let config = {
  628. headers: ext === 'pdf' ? { 'Content-Type': 'application/pdf' } : ext === 'svg'?{ 'Content-Type': 'image/svg+xml' } : { 'Content-Type': 'application/octet-stream' },
  629. }
  630. const res = await this.$upload.hw_upload(url, file, config)
  631. this.createFileRecord(obsfilename)
  632. },
  633. // 上传成功以后生成附件记录
  634. async createFileRecord (obsfilename,attinfos) {
  635. let obj = {
  636. "serialfilename": obsfilename
  637. }
  638. obj = Object.assign({},obj,this.bindData)
  639. let param = {
  640. "accesstoken":this.$route.query.token,
  641. "classname": "system.attachment.huawei.OBS",
  642. "method": "uploadSuccess",
  643. "content":obj
  644. }
  645. const res = await this.$api.requested(param)
  646. if (res.code === 1) {
  647. let res2 = await this.$api.requested({
  648. "accesstoken":this.$route.query.token,
  649. "classname": "system.attachment.Attachment",
  650. "method": "createFileLink",
  651. "content": {
  652. "ownertable": "sa_workorder_confirmation",
  653. "ownerid": this.$route.query.ownerid,
  654. "usetype": "default",
  655. "attachmentids": [
  656. res.data.attachmentids[0]
  657. ]
  658. }
  659. })
  660. this.$emit('onSuccess',res)
  661. }
  662. },
  663. },
  664. created () {
  665. if (sessionStorage.getItem('active_account')) {
  666. let result = JSON.parse(sessionStorage.getItem('active_account'))
  667. result.token = this.$route.query.token
  668. sessionStorage.setItem('active_account',JSON.stringify(result))
  669. } else {
  670. sessionStorage.setItem('active_account',JSON.stringify({token:this.$route.query.token}))
  671. }
  672. },
  673. mounted () {
  674. this.listData()
  675. }
  676. }
  677. </script>
  678. <style scoped>
  679. #header__table tr td {
  680. width: 120px;
  681. padding:10px;
  682. }
  683. .td__title {
  684. background: #FAFAFA;
  685. color: #000000;
  686. }
  687. .flex{
  688. display: flex;
  689. justify-content: space-between;
  690. }
  691. .noborder td {
  692. border-left: none;
  693. border-top: none;
  694. border-bottom: none;
  695. }
  696. </style>