index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409
  1. <template>
  2. <div class="app-container">
  3. <vab-query-form>
  4. <vab-query-form-top-panel>
  5. <el-form :inline="true" :model="queryForm" @submit.native.prevent>
  6. <el-form-item label="项目名">
  7. <el-input
  8. v-model="queryForm.nboName"
  9. clearable
  10. filterable
  11. placeholder="请选择项目名"
  12. @keyup.enter.native="fetchData(1)" />
  13. </el-form-item>
  14. <el-form-item label="工单类型">
  15. <el-select
  16. v-model="queryForm.orderTypeName"
  17. clearable
  18. filterable
  19. placeholder="请选择工单类型"
  20. @change="fetchData(1)">
  21. <el-option v-for="user in orderTypeList" :key="user.val" :label="user.val" :value="user.val" />
  22. </el-select>
  23. </el-form-item>
  24. <el-form-item label="支持人员">
  25. <el-input
  26. v-model="queryForm.assignUserName"
  27. clearable
  28. filterable
  29. placeholder="请输入支持人员"
  30. @keyup.enter.native="fetchData(1)" />
  31. </el-form-item>
  32. <el-form-item label="销售工程师">
  33. <el-input
  34. v-model="queryForm.saleName"
  35. clearable
  36. filterable
  37. placeholder="请输入销售工程师"
  38. @keyup.enter.native="fetchData(1)" />
  39. </el-form-item>
  40. <el-form-item label="时间">
  41. <el-date-picker
  42. v-model="queryForm.trialTime"
  43. end-placeholder="结束日期"
  44. range-separator="至"
  45. start-placeholder="开始日期"
  46. style="width: 100%"
  47. type="datetimerange"
  48. value-format="yyyy-MM-dd HH:mm:ss"
  49. @change="fetchData(1)" />
  50. </el-form-item>
  51. <el-form-item>
  52. <el-button icon="el-icon-search" type="primary" @click="fetchData(1)">查询</el-button>
  53. <el-button icon="el-icon-refresh-right" @click="reset">重置</el-button>
  54. </el-form-item>
  55. </el-form>
  56. </vab-query-form-top-panel>
  57. </vab-query-form>
  58. <el-empty v-if="dynamicsList.length == 0" :image-size="200" />
  59. <ul v-else v-infinite-scroll="loadData" class="records" :style="{ height: height }">
  60. <li v-for="(v, index) in dynamicsList" :key="index">
  61. <div class="date">
  62. <h2>{{ parseTime(v.updatedTime, '{y}-{m}-{d}').split('-')[2] }}</h2>
  63. <h3>{{ parseTime(v.updatedTime, '{y}-{m}-{d}').split('-').splice(0, 2).join('.') }}</h3>
  64. </div>
  65. <ul class="content">
  66. <li>
  67. <vab-icon class="user-avatar" icon="account-circle-fill" />
  68. <div class="text">
  69. <p class="action">{{ v.custName }} - {{ v.orderTypeName }} - {{ v.assignUserName }}</p>
  70. <el-row
  71. v-if="v.orderTypeName == '产品试用申请(硬件)' || v.orderTypeName == '产品试用申请(软件)'"
  72. :gutter="20">
  73. <el-col v-if="v.feedbackTrail" :span="24">
  74. <p class="tit">试用开始反馈:</p>
  75. <div v-for="(row, idx) in startList(v.feedbackTrail)" :key="idx">
  76. <div>
  77. <el-descriptions border :column="3" :content-style="CS" :label-style="LS">
  78. <el-descriptions-item label="反馈人员">
  79. {{ row.feedbackTrialName }}
  80. </el-descriptions-item>
  81. <el-descriptions-item label="反馈时间">
  82. {{ parseTime(row.feedbackTrialTime, '{y}-{m}-{d}') }}
  83. </el-descriptions-item>
  84. <el-descriptions-item label="更新时间">
  85. {{ parseTime(row.createdTime, '{y}-{m}-{d}') }}
  86. </el-descriptions-item>
  87. </el-descriptions>
  88. <el-descriptions border :column="1" :content-style="CS" :label-style="LS">
  89. <el-descriptions-item label="总结/问题">
  90. <span v-html="row.feedbackTrialContent.replace(/\n/g, '<br>')"></span>
  91. </el-descriptions-item>
  92. <el-descriptions-item label="讲解纪要补充">
  93. <span v-html="row.feedbackTrialDist.replace(/\n/g, '<br>')"></span>
  94. </el-descriptions-item>
  95. <el-descriptions-item label="计划">
  96. <span v-html="row.feedbackTrialPlan.replace(/\n/g, '<br>')"></span>
  97. </el-descriptions-item>
  98. </el-descriptions>
  99. </div>
  100. </div>
  101. </el-col>
  102. <el-col v-if="v.feedbackTrail" :span="24">
  103. <p class="tit">试用过程反馈:</p>
  104. <div v-for="(row, idx) in processList(v.feedbackTrail)" :key="idx">
  105. <div v-show="idx < (v.showLength ? v.showLength : 1)">
  106. <el-descriptions border :column="3" :content-style="CS" :label-style="LS">
  107. <el-descriptions-item label="反馈人员">
  108. {{ row.feedbackTrialName }}
  109. </el-descriptions-item>
  110. <el-descriptions-item label="反馈时间">
  111. {{ parseTime(row.feedbackTrialTime, '{y}-{m}-{d}') }}
  112. </el-descriptions-item>
  113. <el-descriptions-item label="更新时间">
  114. {{ parseTime(row.createdTime, '{y}-{m}-{d}') }}
  115. </el-descriptions-item>
  116. </el-descriptions>
  117. <el-descriptions border :column="1" :content-style="CS" :label-style="LS">
  118. <el-descriptions-item label="总结/问题">
  119. <span v-html="row.feedbackTrialContent.replace(/\n/g, '<br>')"></span>
  120. </el-descriptions-item>
  121. <el-descriptions-item label="讲解纪要补充">
  122. <span v-html="row.feedbackTrialDist.replace(/\n/g, '<br>')"></span>
  123. </el-descriptions-item>
  124. <el-descriptions-item label="计划">
  125. <span v-html="row.feedbackTrialPlan.replace(/\n/g, '<br>')"></span>
  126. </el-descriptions-item>
  127. </el-descriptions>
  128. </div>
  129. </div>
  130. <div v-if="v.feedbackTrail && processList(v.feedbackTrail).length > 1" style="margin-top: 10px">
  131. <el-button size="mini" @click="changeLength(index, 1)">收起</el-button>
  132. <el-button size="mini" @click="changeLength(index, 999)">展开</el-button>
  133. </div>
  134. </el-col>
  135. <el-col v-if="v.feedbackTrail" :span="24">
  136. <p class="tit">试用总结反馈:</p>
  137. <div v-for="(row, idx) in endList(v.feedbackTrail)" :key="idx">
  138. <div>
  139. <el-descriptions border :column="3" :content-style="CS" :label-style="LS">
  140. <el-descriptions-item label="反馈人员">
  141. {{ row.feedbackTrialName }}
  142. </el-descriptions-item>
  143. <el-descriptions-item label="反馈时间">
  144. {{ parseTime(row.feedbackTrialTime, '{y}-{m}-{d}') }}
  145. </el-descriptions-item>
  146. <el-descriptions-item label="更新时间">
  147. {{ parseTime(row.createdTime, '{y}-{m}-{d}') }}
  148. </el-descriptions-item>
  149. </el-descriptions>
  150. <el-descriptions border :column="1" :content-style="CS" :label-style="LS">
  151. <el-descriptions-item label="总结/问题">
  152. <span v-html="row.feedbackTrialContent.replace(/\n/g, '<br>')"></span>
  153. </el-descriptions-item>
  154. <el-descriptions-item label="讲解纪要补充">
  155. <span v-html="row.feedbackTrialDist.replace(/\n/g, '<br>')"></span>
  156. </el-descriptions-item>
  157. <el-descriptions-item label="计划">
  158. <span v-html="row.feedbackTrialPlan.replace(/\n/g, '<br>')"></span>
  159. </el-descriptions-item>
  160. </el-descriptions>
  161. </div>
  162. </div>
  163. </el-col>
  164. </el-row>
  165. <el-row v-if="v.orderTypeName == '技术文件支持' || v.orderTypeName == '售前讲解支持'" :gutter="20">
  166. <el-col v-if="v.feedbackSupportTime" :span="24">
  167. <p class="tit">{{ v.feedbackSupportName }} (支持人员)总结:</p>
  168. <el-descriptions border :column="1" :content-style="CS" :label-style="LS">
  169. <el-descriptions-item label="反馈时间">{{ v.feedbackSupportTime }}</el-descriptions-item>
  170. <el-descriptions-item label="本次讲解情况反馈">
  171. <span v-html="v.feedbackSupportContent.replace(/\n/g, '<br>')"></span>
  172. </el-descriptions-item>
  173. </el-descriptions>
  174. </el-col>
  175. <el-col v-if="v.feedbackSaleTime" :span="24">
  176. <p class="tit">{{ v.feedbackSaleName }} (销售人员)反馈:</p>
  177. <el-descriptions border :column="1" :content-style="CS" :label-style="LS">
  178. <el-descriptions-item label="反馈时间">{{ v.feedbackSaleTime }}</el-descriptions-item>
  179. <el-descriptions-item v-if="v.orderTypeName == '售前讲解支持'" label="会议纪要">
  180. <span v-html="v.feedbackSaleMeeting.replace(/\n/g, '<br>')"></span>
  181. </el-descriptions-item>
  182. <el-descriptions-item v-if="v.orderTypeName == '售前讲解支持'" label="讲解纪要补充">
  183. <span v-html="v.feedbackSaleDist.replace(/\n/g, '<br>')"></span>
  184. </el-descriptions-item>
  185. <el-descriptions-item v-if="v.orderTypeName == '技术文件支持'" label="用户反馈">
  186. <span v-html="v.feedbackSaleUser.replace(/\n/g, '<br>')"></span>
  187. </el-descriptions-item>
  188. <el-descriptions-item label="销售下一步工作计划">
  189. <span v-html="v.feedbackSaleNext.replace(/\n/g, '<br>')"></span>
  190. </el-descriptions-item>
  191. </el-descriptions>
  192. </el-col>
  193. </el-row>
  194. </div>
  195. </li>
  196. </ul>
  197. </li>
  198. </ul>
  199. </div>
  200. </template>
  201. <script>
  202. import workApi from '@/api/work/index'
  203. import to from 'await-to-js'
  204. export default {
  205. name: 'WorkRecords',
  206. data() {
  207. return {
  208. LS: {
  209. width: '13%',
  210. },
  211. CS: {
  212. width: '150px',
  213. },
  214. orderTypeList: [
  215. {
  216. val: '技术文件支持',
  217. },
  218. {
  219. val: '售前讲解支持',
  220. },
  221. {
  222. val: '产品试用申请(软件)',
  223. },
  224. {
  225. val: '产品试用申请(硬件)',
  226. },
  227. ],
  228. tryType: {
  229. 10: '试用启动反馈',
  230. 20: '试用过程反馈',
  231. 30: '试用总结反馈',
  232. },
  233. height: this.$baseTableHeight(1),
  234. dynamicsList: [],
  235. queryForm: {
  236. nboName: '',
  237. orderTypeName: '',
  238. assignUserName: '',
  239. saleName: '',
  240. trialTime: [],
  241. updatedTimeStart: null,
  242. updatedTimeEnd: null,
  243. pageSize: 10,
  244. pageNum: 1,
  245. },
  246. total: 0,
  247. }
  248. },
  249. computed: {
  250. startList() {
  251. return function (list) {
  252. return list.filter((item) => item.feedbackTrialType == 10)
  253. }
  254. },
  255. processList() {
  256. return function (list) {
  257. return list.filter((item) => item.feedbackTrialType == 20)
  258. }
  259. },
  260. endList() {
  261. return function (list) {
  262. return list.filter((item) => item.feedbackTrialType == 30)
  263. }
  264. },
  265. },
  266. mounted() {
  267. this.fetchData(1)
  268. },
  269. methods: {
  270. loadData() {
  271. console.log('load')
  272. if (this.total > this.dynamicsList.length) {
  273. this.queryForm.pageNum++
  274. this.fetchData()
  275. }
  276. },
  277. getFirstDay() {
  278. var y = new Date().getFullYear() //获取年份
  279. var m = new Date().getMonth() + 1 //获取月份
  280. var d = '01'
  281. m = m < 10 ? '0' + m : m //月份补 0
  282. return [y, m, d].join('-') + ' 00:00:00'
  283. },
  284. getLastDay() {
  285. var y = new Date().getFullYear() //获取年份
  286. var m = new Date().getMonth() + 1 //获取月份
  287. var d = new Date(y, m, 0).getDate() //获取当月最后一日
  288. m = m < 10 ? '0' + m : m //月份补 0
  289. d = d < 10 ? '0' + d : d //日数补 0
  290. return [y, m, d].join('-') + ' 00:00:00'
  291. },
  292. reset() {
  293. this.queryForm = {
  294. nboName: '',
  295. orderTypeName: '',
  296. assignUserName: '',
  297. saleName: '',
  298. trialTime: [],
  299. updatedTimeStart: null,
  300. updatedTimeEnd: null,
  301. }
  302. this.fetchData(1)
  303. },
  304. changeLength(index, length) {
  305. this.$set(this.dynamicsList[index], 'showLength', length)
  306. },
  307. async fetchData(num) {
  308. let params = this.queryForm
  309. params.pageNum = num || params.pageNum
  310. if (params.trialTime && params.trialTime.length == 2) {
  311. params.updatedTimeStart = params.trialTime[0]
  312. params.updatedTimeEnd = params.trialTime[1]
  313. } else {
  314. params.updatedTimeStart = null
  315. params.updatedTimeEnd = null
  316. }
  317. const [err, res] = await to(workApi.getListFull(params))
  318. if (err) return
  319. if (res.code == 200) {
  320. if (this.queryForm.pageNum == 1) {
  321. this.dynamicsList = res.data.list
  322. } else {
  323. this.dynamicsList = this.dynamicsList.concat(res.data.list)
  324. }
  325. this.total = res.data.total
  326. }
  327. },
  328. },
  329. }
  330. </script>
  331. <style lang="scss" scoped>
  332. .records {
  333. margin: 0;
  334. padding: 10px 20px;
  335. list-style: none;
  336. height: 100%;
  337. overflow-y: auto;
  338. > li {
  339. display: flex;
  340. & + li {
  341. margin-top: 10px;
  342. }
  343. }
  344. .date {
  345. width: 100px;
  346. display: flex;
  347. flex-direction: column;
  348. align-items: center;
  349. h2,
  350. h3 {
  351. margin: 0;
  352. }
  353. h2 {
  354. font-size: 26px;
  355. line-height: 32px;
  356. }
  357. }
  358. .content {
  359. flex: 1;
  360. list-style: none;
  361. li {
  362. display: flex;
  363. & + li {
  364. margin-top: 10px;
  365. }
  366. }
  367. .user-avatar {
  368. font-size: 40px;
  369. }
  370. .text {
  371. flex: 1;
  372. padding-left: 20px;
  373. p {
  374. font-weight: 500;
  375. margin: 0;
  376. line-height: 20px;
  377. span {
  378. color: #1d66dc;
  379. }
  380. }
  381. .action {
  382. font-weight: bold;
  383. color: #333;
  384. }
  385. }
  386. .tit {
  387. font-weight: bold !important;
  388. color: #000;
  389. padding: 10px 0;
  390. }
  391. }
  392. }
  393. </style>