opportunityDetailDialog.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406
  1. <template>
  2. <div>
  3. <headerTitle title="基本信息"></headerTitle>
  4. <el-form
  5. label-width="120px"
  6. ref="form"
  7. :model="form"
  8. :rules="rules"
  9. style="margin-top: 30px"
  10. >
  11. <el-row>
  12. <el-col :span="8">
  13. <el-form-item label="客户名称:" prop="contactName">
  14. {{ detailData.contactName }}
  15. </el-form-item>
  16. </el-col>
  17. <el-col :span="8">
  18. <el-form-item label=" 商机名称:" prop="name">
  19. {{ detailData.name }}
  20. </el-form-item>
  21. </el-col>
  22. <el-col :span="8">
  23. <el-form-item label="负责人名称:" prop="responsibleName">
  24. {{ detailData.responsibleName }}
  25. </el-form-item>
  26. </el-col>
  27. <el-col :span="8">
  28. <el-form-item label="商机来源:" prop="sourceCode">
  29. {{ detailData.sourceName }}
  30. </el-form-item>
  31. </el-col>
  32. <el-col :span="8">
  33. <el-form-item label="赢单率:" prop="winRate">
  34. {{ detailData.winRate + '%' }}
  35. </el-form-item>
  36. </el-col>
  37. <el-col :span="8">
  38. <el-form-item label="预算:" prop="budget">
  39. {{ detailData.budget + '万元' }}
  40. </el-form-item>
  41. </el-col>
  42. <el-col :span="8">
  43. <el-form-item label="预计结单日期:" prop="expectedClosingDate">
  44. {{ detailData.expectedClosingDate }}
  45. </el-form-item>
  46. </el-col>
  47. <el-col :span="8">
  48. <el-form-item label="商机阶段:" prop="stageCode">
  49. {{ detailData.stageName }}
  50. </el-form-item>
  51. </el-col>
  52. <el-col :span="8">
  53. <el-form-item label="附件:" prop="files">
  54. <div v-if="detailData.files && detailData.files?.length">
  55. <el-link
  56. v-for="link in detailData.files"
  57. :key="link.id"
  58. type="primary"
  59. :underline="false"
  60. @click="downloadFile(link)"
  61. >
  62. {{ link.name }}</el-link
  63. >
  64. </div>
  65. </el-form-item>
  66. </el-col>
  67. <el-col :span="16">
  68. <el-form-item label="备注:" prop="remark">
  69. {{ detailData.remark }}
  70. </el-form-item>
  71. </el-col>
  72. </el-row>
  73. </el-form>
  74. <headerTitle title="产品清单"></headerTitle>
  75. <inventoryTable
  76. :taskDefinitionKey="taskDefinitionKey"
  77. ref="inventoryTable"
  78. v-if="taskDefinitionKey === 'technicianApprove'"
  79. ></inventoryTable>
  80. <ele-pro-table
  81. v-if="taskDefinitionKey !== 'technicianApprove'"
  82. ref="table"
  83. :needPage="false"
  84. :columns="competAnalysisListcolumns"
  85. :toolkit="[]"
  86. :datasource="detailData.productList"
  87. row-key="id"
  88. >
  89. <template v-slot:toolbar>
  90. <div class="headbox">
  91. <span class="amount">总计:{{ form.totalPrice }}元</span>
  92. </div>
  93. </template>
  94. <template v-slot:technicalDrawings="{ row }">
  95. <div v-if="row.technicalDrawings && row.technicalDrawings?.length">
  96. <el-link
  97. v-for="link in row.technicalDrawings"
  98. :key="link.id"
  99. type="primary"
  100. :underline="false"
  101. @click="downloadFile(link)"
  102. >
  103. {{ link.name }}</el-link
  104. >
  105. </div>
  106. </template>
  107. <template v-slot:customerReqFiles="{ row }">
  108. <div v-if="row.customerReqFiles && row.customerReqFiles?.length">
  109. <el-link
  110. v-for="link in row.customerReqFiles"
  111. :key="link.id"
  112. type="primary"
  113. :underline="false"
  114. @click="downloadFile(link)"
  115. >
  116. {{ link.name }}</el-link
  117. >
  118. </div>
  119. </template>
  120. </ele-pro-table>
  121. <!-- <el-card
  122. shadow="never"
  123. header="竞品对手"
  124. body-style="padding: 22px 20px 0 20px;"
  125. >
  126. <ele-pro-table
  127. ref="table"
  128. :needPage="false"
  129. :columns="competAnalysisListcolumns1"
  130. :datasource="detailData.competAnalysisList"
  131. row-key="id"
  132. >
  133. </ele-pro-table>
  134. </el-card>
  135. <el-card
  136. shadow="never"
  137. header="关键人信息"
  138. body-style="padding: 22px 20px 0 20px;"
  139. >
  140. <ele-pro-table
  141. ref="table"
  142. :needPage="false"
  143. :columns="partyListcolumns"
  144. :datasource="detailData.partyList"
  145. row-key="id"
  146. >
  147. </ele-pro-table>
  148. </el-card> -->
  149. </div>
  150. </template>
  151. <script>
  152. import { getDetail } from '@/api/bpm/components/saleManage/businessOpportunity';
  153. import { getFile } from '@/api/system/file';
  154. import dictMixins from '@/mixins/dictMixins';
  155. import { copyObj } from '@/utils/util';
  156. import inventoryTable from '@/views/bpm/handleTask/components/quotation/inventoryTable.vue';
  157. export default {
  158. mixins: [dictMixins],
  159. components:{
  160. inventoryTable
  161. },
  162. props: {
  163. businessId: {
  164. default: ''
  165. },
  166. taskDefinitionKey: {
  167. default: ''
  168. }
  169. },
  170. data() {
  171. return {
  172. visible: false,
  173. title: '详情',
  174. row: {},
  175. activeName: 'base',
  176. form: {},
  177. rules: {},
  178. detailData: {},
  179. competAnalysisListcolumns1: [
  180. {
  181. prop: 'name',
  182. label: '竞争对手名称',
  183. // sortable: 'custom',
  184. showOverflowTooltip: true,
  185. align: 'center',
  186. width: 300
  187. },
  188. {
  189. prop: 'analysis',
  190. label: '竞品分析',
  191. showOverflowTooltip: true,
  192. align: 'center'
  193. }
  194. ],
  195. partyListcolumns: [
  196. {
  197. prop: 'linkName',
  198. label: '关键人名称',
  199. // sortable: 'custom',
  200. showOverflowTooltip: true,
  201. align: 'center',
  202. minWidth: 110
  203. },
  204. {
  205. prop: 'linkMobilePhone',
  206. label: '联系方式',
  207. showOverflowTooltip: true,
  208. align: 'center',
  209. minWidth: 110
  210. },
  211. {
  212. prop: 'linkPost',
  213. label: '职位',
  214. showOverflowTooltip: true,
  215. align: 'center',
  216. minWidth: 110
  217. },
  218. {
  219. prop: 'attitudeName',
  220. label: '态度',
  221. showOverflowTooltip: true,
  222. align: 'center',
  223. minWidth: 110
  224. },
  225. {
  226. prop: 'influenceName',
  227. label: '影响力',
  228. showOverflowTooltip: true,
  229. align: 'center',
  230. minWidth: 110
  231. },
  232. {
  233. prop: 'goal',
  234. label: '项目目标/期望',
  235. showOverflowTooltip: true,
  236. align: 'center',
  237. minWidth: 110
  238. }
  239. ],
  240. competAnalysisListcolumns: [
  241. {
  242. width: 45,
  243. type: 'index',
  244. columnKey: 'index',
  245. align: 'center',
  246. fixed: 'left'
  247. },
  248. {
  249. width: 200,
  250. prop: 'productName',
  251. label: '名称',
  252. slot: 'productName'
  253. },
  254. {
  255. width: 120,
  256. prop: 'productCode',
  257. label: '编码',
  258. slot: 'productCode'
  259. },
  260. {
  261. width: 200,
  262. prop: 'productCategoryName',
  263. label: '类型',
  264. slot: 'productCategoryName'
  265. },
  266. {
  267. width: 160,
  268. prop: 'productBrand',
  269. label: '牌号',
  270. slot: 'productBrand'
  271. },
  272. {
  273. width: 120,
  274. prop: 'modelType',
  275. label: '型号',
  276. slot: 'modelType'
  277. },
  278. {
  279. width: 120,
  280. prop: 'specification',
  281. label: '规格',
  282. slot: 'specification'
  283. },
  284. {
  285. width: 160,
  286. prop: 'singlePrice',
  287. label: '单价',
  288. slot: 'singlePrice'
  289. },
  290. {
  291. width: 120,
  292. prop: 'totalCount',
  293. label: '数量',
  294. slot: 'totalCount'
  295. },
  296. {
  297. width: 120,
  298. prop: 'totalPrice',
  299. label: '销售总金额',
  300. slot: 'totalPrice',
  301. formatter: (_row, _column, cellValue) => {
  302. return _row.totalPrice + '元';
  303. }
  304. },
  305. {
  306. width: 120,
  307. prop: 'measuringUnit',
  308. label: '计量单位',
  309. slot: 'measuringUnit'
  310. },
  311. {
  312. width: 120,
  313. prop: 'deliveryDays',
  314. label: '交期(天)',
  315. slot: 'deliveryDays'
  316. },
  317. {
  318. width: 200,
  319. prop: 'guaranteePeriod',
  320. label: '质保期',
  321. slot: 'guaranteePeriod',
  322. formatter: (_row, _column, cellValue) => {
  323. return _row.guaranteePeriod + _row.guaranteePeriodUnitName;
  324. }
  325. },
  326. // {
  327. // width: 120,
  328. // prop: 'guaranteePeriodUnitCode',
  329. // label: '',
  330. // slot: 'guaranteePeriodUnitCode'
  331. // },
  332. {
  333. width: 240,
  334. prop: 'customerReqFiles',
  335. label: '客户需求',
  336. slot: 'customerReqFiles',
  337. },
  338. {
  339. width: 120,
  340. prop: 'technicalAnswerName',
  341. label: '技术答疑人',
  342. slot: 'technicalAnswerName'
  343. },
  344. {
  345. width: 220,
  346. prop: 'technicalParams',
  347. label: '技术参数',
  348. slot: 'technicalParams'
  349. },
  350. {
  351. width: 240,
  352. prop: 'technicalDrawings',
  353. label: '技术图纸',
  354. slot: 'technicalDrawings',
  355. formatter: (_row, _column, cellValue) => {
  356. return _row.guaranteePeriod + _row.guaranteePeriodUnitName;
  357. }
  358. },
  359. {
  360. width: 220,
  361. prop: 'remark',
  362. label: '备注',
  363. slot: 'remark'
  364. }
  365. ]
  366. };
  367. },
  368. created() {
  369. this.getDetailData(this.businessId);
  370. },
  371. methods: {
  372. downloadFile(file) {
  373. getFile({ objectName: file.storePath }, file.name);
  374. },
  375. async getDetailData(id) {
  376. this.loading = true;
  377. const data = await getDetail(id);
  378. this.loading = false;
  379. if (data) {
  380. this.detailData = data;
  381. this.$refs.inventoryTable &&
  382. this.$refs.inventoryTable.putTableValue(data.productList);
  383. }
  384. },
  385. getTableValue() {
  386. return this.$refs.inventoryTable.getTableValue();
  387. }
  388. }
  389. };
  390. </script>
  391. <style scoped lang="scss">
  392. .ele-dialog-form {
  393. .el-form-item {
  394. margin-bottom: 10px;
  395. }
  396. }
  397. </style>