installationTraining.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. <template>
  2. <div>
  3. <el-drawer
  4. :title="$t('新建确认单')"
  5. :visible.sync="drawerVisible"
  6. size="85%"
  7. direction="rtl"
  8. append-to-body
  9. @close="onClose">
  10. <div class="drawer__panel" style="margin-bottom: -10px" v-if="dataInfo.workorder">
  11. <el-descriptions :title="$t(`单据信息`)" >
  12. <el-descriptions-item :label="$t(`服务单号`)"><span style="color: #666">{{$t(dataInfo.workorder.servicebillno) || '--'}}</span></el-descriptions-item>
  13. <el-descriptions-item :label="$t(`确认日期`)"><span style="color: #666">{{$t(dataInfo.workorder.createdate) || '--'}}</span></el-descriptions-item>
  14. </el-descriptions>
  15. <el-descriptions :title="$t(`服务信息`)">
  16. <el-descriptions-item :label="$t(`服务分类`)"><span style="color: #666">{{$t(dataInfo.workorder.servicetype) || '--'}}</span></el-descriptions-item>
  17. <el-descriptions-item :label="$t(`应用系统`)"><span style="color: #666">{{$t(dataInfo.workorder.class1) || '--'}}</span></el-descriptions-item>
  18. <el-descriptions-item :label="$t(`工单负责人`)"><span style="color: #666">{{$t(dataInfo.workorder.projectleader) || '--'}}</span></el-descriptions-item>
  19. <el-descriptions-item :label="$t(`项目名称`)"><span style="color: #666">{{$t(dataInfo.workorder.projectname) || '--'}}</span></el-descriptions-item>
  20. <el-descriptions-item :label="$t(`业务员`)"><span style="color: #666">{{$t(dataInfo.workorder.saler_name) || '--'}}</span></el-descriptions-item>
  21. <el-descriptions-item :label="$t(`服务企业`)"><span style="color: #666">{{$t(dataInfo.workorder.enterprisename) || '--'}}</span></el-descriptions-item>
  22. </el-descriptions>
  23. <el-descriptions :title="$t(`客户信息`)">
  24. <el-descriptions-item :label="$t(`企业名称`)"><span style="color: #666">{{$t(dataInfo.workorder.abbreviation)}}</span></el-descriptions-item>
  25. <el-descriptions-item :label="$t(`联系方式`)"><span style="color: #666">{{$t(dataInfo.workorder.scenecontactphonenumber)}}</span></el-descriptions-item>
  26. <el-descriptions-item :label="$t(`服务地址`)"><span style="color: #666">{{$t(dataInfo.workorder.province + dataInfo.workorder.city + dataInfo.workorder.county + dataInfo.workorder.address)}}</span></el-descriptions-item>
  27. </el-descriptions>
  28. <el-descriptions :title="$t(`现场联系人信息`)">
  29. <el-descriptions-item :label="$t(`姓名`)"><span style="color: #666">{{$t(dataInfo.workorder.scenecontact) || '--'}}</span></el-descriptions-item>
  30. <el-descriptions-item :label="$t(`电话`)"><span style="color: #666">{{$t(dataInfo.workorder.scenecontactphonenumber) || '--'}}</span></el-descriptions-item>
  31. <el-descriptions-item :label="$t(`地址`)"><span style="color: #666">{{$t(dataInfo.workorder.address) || '--'}}</span></el-descriptions-item>
  32. </el-descriptions>
  33. </div>
  34. <el-descriptions :title="$t(`工序内容填写`)" style="margin-top: 10px">
  35. </el-descriptions>
  36. <div style="color: #999;font-size: 14px">{{$t(`现场培训内容`)}}</div>
  37. <el-input
  38. type="textarea"
  39. style="margin-top: 10px;margin-bottom: 20px"
  40. @blur="inputChange('现场培训内容',trainerContent)"
  41. :rows="1"
  42. placeholder="现场培训内容"
  43. v-model="trainerContent">
  44. </el-input>
  45. <div style="color: #999;font-size: 14px">{{$t(`现场互动及测试培训效果`)}}</div>
  46. <el-input
  47. type="textarea"
  48. style="margin-top: 10px;margin-bottom: 20px"
  49. @blur="inputChange('现场互动及测试培训效果',trainerResult)"
  50. :rows="1"
  51. placeholder="现场互动及测试培训效果"
  52. v-model="trainerResult">
  53. </el-input>
  54. <div style="height: 10px;background: #f5f5f5"></div>
  55. <div style="margin: 10px;font-weight: bold;font-size: 16px">{{$t(`评价`)}}</div>
  56. <div class="drawer__panel" style="margin-bottom: -10px">
  57. <div style="display: flex;justify-content: space-between">
  58. <div style="display: flex;justify-content: left">
  59. <div style="color: #999;font-size: 14px;margin-right: 10px">{{$t(`反应速度`)}}:</div>
  60. <el-rate v-model="dataInfo.responsescore" @change="changeRate"></el-rate>
  61. </div>
  62. <div style="display: flex;justify-content: left">
  63. <div style="color: #999;font-size: 14px;margin-right: 10px">{{$t(`配合态度`)}}:</div>
  64. <el-rate v-model="dataInfo.attitudescore" @change="changeRate"></el-rate>
  65. </div>
  66. </div>
  67. </div>
  68. <div style="height: 10px;background: #f5f5f5"></div>
  69. <div style="margin: 10px;font-weight: bold;font-size: 16px">{{$t(`客户签字`)}}</div>
  70. <div class="drawer__panel" style="margin-bottom: -50px">
  71. <signature ref="signatureRef" :sa_workorder_confirmationid="sa_workorder_confirmationid" :sa_workorderid="sa_workorderid"></signature>
  72. </div>
  73. <div class="fixed__btn__panel">
  74. <el-button
  75. size="small"
  76. class="normal-btn-width"
  77. @click="downLoadBill(dataInfo)"
  78. >{{ $t("单据预览") }}</el-button
  79. >
  80. <el-button
  81. size="small"
  82. type="warning"
  83. class="normal-btn-width"
  84. @click="delClick"
  85. >{{ $t("删除") }}</el-button
  86. >
  87. <el-button
  88. size="small"
  89. type="primary"
  90. class="normal-btn-width"
  91. @click="submitClick"
  92. >{{ $t("提交") }}</el-button
  93. >
  94. </div>
  95. </el-drawer>
  96. </div>
  97. </template>
  98. <script>
  99. import signature from '@/HDrpManagement/serveWorkBill/modules/signature/index'
  100. export default {
  101. name: "installationTraining",//安装培训
  102. components:{signature},
  103. props:['sa_workorderid'],
  104. data(){
  105. return {
  106. dataInfo:{},
  107. paidServiceAmount:'',
  108. inqualityguaranteeperiod:'',
  109. drawerVisible:false,
  110. tablecols:[],
  111. sa_workorder_confirmationid:'',
  112. trainerContent:'',
  113. trainerResult:'',
  114. active_accoun:JSON.parse(sessionStorage.getItem('active_account')),
  115. folderid:JSON.parse(sessionStorage.getItem('folderid')),
  116. }
  117. },
  118. methods:{
  119. async queryInfo(id){
  120. this.sa_workorder_confirmationid = id
  121. const res = await this.$api.requested({
  122. "id": "20230211105803",
  123. "content": {
  124. "sa_workorder_confirmationid": id,
  125. nocache: true
  126. }
  127. })
  128. console.log(res.data)
  129. this.dataInfo = res.data
  130. this.setInputData()
  131. this.drawerVisible = true
  132. this.$nextTick(()=>{
  133. this.$refs.signatureRef.getField()
  134. })
  135. },
  136. setInputData() {
  137. let that = this
  138. that.dataInfo.confirmationcontent.forEach(e => {
  139. Object.keys(e).map((key, index) => {
  140. if (key.includes('现场培训内容')) {
  141. that.trainerContent = e[key].confirm_value
  142. }else if (key.includes('现场互动及测试培训效果')) {
  143. that.trainerResult = e[key].confirm_value
  144. }
  145. })
  146. })
  147. },
  148. inputChange(key,data){
  149. let keyValue = key
  150. this.dataInfo.confirmationcontent.forEach(e => {
  151. Object.keys(e).map((key, index) => {
  152. if (key.includes(keyValue)) {
  153. e[key].confirm_value = data
  154. }
  155. })
  156. })
  157. },
  158. async changeRate(){
  159. console.log(this.dataInfo,'detaInfo')
  160. const res = await this.$api.requested({
  161. "id":"20230211105703",
  162. "content":this.dataInfo
  163. })
  164. },
  165. onClose(){
  166. this.$emit('onClose')
  167. },
  168. async submitClick(){
  169. const res = await this.$api.requested({
  170. "id": "20230211110003",
  171. "content": {
  172. "sa_workorder_confirmationid": this.sa_workorder_confirmationid
  173. }
  174. })
  175. if (res.code == 0){
  176. this.tool.showMessage(res,()=>{})
  177. }else {
  178. this.drawerVisible = false
  179. }
  180. },
  181. async delClick(){
  182. const res = await this.$api.requested({
  183. "id": "20230211110103",
  184. "content": {
  185. "sa_workorder_confirmationids": [this.sa_workorder_confirmationid]
  186. }
  187. })
  188. if (res.code == 0){
  189. this.tool.showMessage(res,()=>{})
  190. }else {
  191. this.drawerVisible = false
  192. }
  193. },
  194. downLoadBill(data) {
  195. let result = data.attinfos.filter(
  196. (item) => item.usetype == "comfirmbill"
  197. );
  198. let http = location.href.substring(0,5) == 'https'?'https://oms.idcgroup.com.cn:8079/yosweb/#/printTable?':'http://61.164.207.46:8000/yosweb/#/printTable?'
  199. let token = 'token=' + this.active_accoun.token
  200. let parentid = '&parentid=' + this.folderid.appfolderid
  201. let ownerid = '&ownerid=' + data.sa_workorder_confirmationid
  202. let action = '&action=1'
  203. let urlNew = http + token + parentid + ownerid + action
  204. // if (result.length == 0)
  205. // window.open(urlNew);
  206. // window.open(result[result.length - 1].url, "_self");
  207. // this.$refs.checkBillRef.listData()
  208. window.open(urlNew);
  209. },
  210. },
  211. mounted() {
  212. this.tablecols = this.tool.tabelCol(this.$route.name).serviceProductBillTable.tablecols
  213. }
  214. }
  215. </script>
  216. <style scoped>
  217. </style>