plm前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1412 lines
48 KiB

  1. <template>
  2. <div class="mod-config">
  3. <!-- 查询条件 -->
  4. <el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList()">
  5. <el-form-item :label="'客户编码'">
  6. <el-input v-model="searchData.customerNo" clearable style="width: 120px"></el-input>
  7. </el-form-item>
  8. <el-form-item :label="'客户名称'">
  9. <el-input v-model="searchData.customerDesc" clearable style="width: 120px"></el-input>
  10. </el-form-item>
  11. <el-form-item :label="'跟单员'">
  12. <el-input v-model="searchData.trackerName" clearable style="width: 120px"></el-input>
  13. </el-form-item>
  14. <el-form-item :label="'产品编码'">
  15. <el-input v-model="searchData.testPartNo" clearable style="width: 120px"></el-input>
  16. </el-form-item>
  17. <el-form-item :label="'产品名称'">
  18. <el-input v-model="searchData.partName" clearable style="width: 120px"></el-input>
  19. </el-form-item>
  20. <el-form-item :label="'要求完成日期'">
  21. <el-date-picker
  22. style="width: 120px"
  23. v-model="searchData.startDate"
  24. type="date"
  25. value-format="yyyy-MM-dd"
  26. placeholder="选择日期">
  27. </el-date-picker>
  28. </el-form-item>
  29. <el-form-item style="margin-top: 23px;">
  30. <laber style="margin-left: 0px;font-size: 19px">&#10142</laber>
  31. </el-form-item>
  32. <el-form-item :label="' '">
  33. <el-date-picker
  34. style="width: 120px"
  35. v-model="searchData.endDate"
  36. type="date"
  37. value-format="yyyy-MM-dd"
  38. placeholder="选择日期">
  39. </el-date-picker>
  40. </el-form-item>
  41. </el-form>
  42. <el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList()">
  43. <el-form-item :label="'项目编码'">
  44. <el-input v-model="searchData.projectId" clearable style="width: 120px"></el-input>
  45. </el-form-item>
  46. <el-form-item :label="'项目名称'">
  47. <el-input v-model="searchData.projectName" clearable style="width: 120px"></el-input>
  48. </el-form-item>
  49. <el-form-item :label="'询价专员'">
  50. <el-input v-model="searchData.quoterName" clearable style="width: 120px"></el-input>
  51. </el-form-item>
  52. <el-form-item :label="'优先等级'">
  53. <el-select v-model="searchData.priorityLevel" style="width: 120px">
  54. <el-option label="全部" value=""></el-option>
  55. <el-option label="紧急" value="紧急"></el-option>
  56. <el-option label="一般" value="一般"></el-option>
  57. <el-option label="不紧急" value="不紧急"></el-option>
  58. </el-select>
  59. </el-form-item>
  60. <el-form-item :label="'状态'">
  61. <el-select v-model="searchData.quotationStatus" style="width: 120px">
  62. <el-option label="全部" value=""></el-option>
  63. <el-option label="草稿" value="草稿"></el-option>
  64. <el-option label="下达" value="下达"></el-option>
  65. </el-select>
  66. </el-form-item>
  67. <el-form-item :label="' '">
  68. <el-button @click="getDataList()">查询</el-button>
  69. <download-excel
  70. :fields="fields()"
  71. :data="exportData"
  72. type="xls"
  73. :name="exportName"
  74. :header="exportHeader"
  75. :footer="exportFooter"
  76. :fetch="createExportData"
  77. :before-generate="startDownload"
  78. :before-finish="finishDownload"
  79. worksheet="导出信息"
  80. class="el-button el-button--primary el-button--medium">
  81. {{ "导出" }}
  82. </download-excel>
  83. </el-form-item>
  84. </el-form>
  85. <el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList()">
  86. <el-form-item :label="' '">
  87. <el-button @click="quotationResultModal()" class="el-button el-button--primary el-button--medium">录入询价结果</el-button>
  88. <el-button @click="submitQuotationModal()" class="el-button el-button--primary el-button--medium">提交客户询价</el-button>
  89. <el-button @click="customerResponseModal()" class="el-button el-button--primary el-button--medium">客户回复</el-button>
  90. </el-form-item>
  91. </el-form>
  92. <!-- 询价列表 -->
  93. <el-table
  94. :height="height"
  95. :data="dataList"
  96. border
  97. ref="quotationTable"
  98. @row-click="quotationClickRow"
  99. @selection-change="selectionQuotation"
  100. v-loading="dataListLoading"
  101. style="width: 100%;">
  102. <el-table-column
  103. type="selection"
  104. header-align="center"
  105. align="center"
  106. :selectable="selectFlag"
  107. width="50">
  108. </el-table-column>
  109. <el-table-column
  110. prop="quotationResultStatus"
  111. header-align="center"
  112. align="center"
  113. label="状态">
  114. <template slot-scope="scope">
  115. <span v-show="scope.row.quotationResultStatus === 'C'">已创建</span>
  116. <span v-show="scope.row.quotationResultStatus === 'E'">已录入</span>
  117. <span v-show="scope.row.quotationResultStatus === 'S'">已提交</span>
  118. <span v-show="scope.row.quotationResultStatus === 'R'">已回复</span>
  119. </template>
  120. </el-table-column>
  121. <el-table-column
  122. v-for="(item,index) in columnList" :key="index"
  123. :sortable="item.columnSortable"
  124. :prop="item.columnProp"
  125. :header-align="item.headerAlign"
  126. :show-overflow-tooltip="item.showOverflowTooltip"
  127. :align="item.align"
  128. :fixed="item.fixed === ''?false:item.fixed"
  129. :min-width="item.columnWidth"
  130. :label="item.columnLabel">
  131. <template slot-scope="scope">
  132. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  133. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  134. </template>
  135. </el-table-column>
  136. </el-table>
  137. <selectDiv ref="selectDiv"></selectDiv>
  138. <!-- 分页插件 -->
  139. <el-pagination style="margin-top: 0px"
  140. @size-change="sizeChangeHandle"
  141. @current-change="currentChangeHandle"
  142. :current-page="pageIndex"
  143. :page-sizes="[20, 50, 100, 200, 500]"
  144. :page-size="pageSize"
  145. :total="totalPage"
  146. layout="total, sizes, prev, pager, next, jumper">
  147. </el-pagination>
  148. <!-- 录入询价结果模态框 -->
  149. <el-dialog title="录入询价结果" :close-on-click-modal="false" v-drag :visible.sync="enterResultModalFlag" width="785px">
  150. <el-form :inline="true" label-position="top" :model="enterResultData" :rules="enterResultRules" style="margin-left: 0px;margin-top: 10px;">
  151. <el-form-item label="实际询价日期" prop="actualityQuotationDate" :rules="enterResultRules.actualityQuotationDate">
  152. <el-date-picker v-model="enterResultData.actualityQuotationDate" type="date" value-format="yyyy-MM-dd" placeholder="请选择日期" style="width: 200px"></el-date-picker>
  153. </el-form-item>
  154. </el-form>
  155. <el-form :inline="true" label-position="top" :model="enterResultData" :rules="enterResultRules" style="margin-left:0px;margin-top: 5px;">
  156. <el-form-item label="询价结果信息" prop="quotationResultInformation" :rules="enterResultRules.quotationResultInformation">
  157. <el-input type="textarea" v-model="enterResultData.quotationResultInformation" :rows="3" resize='none' maxlength="300" show-word-limit style="width: 500px;height: 30px"></el-input>
  158. </el-form-item>
  159. </el-form>
  160. <el-form :inline="true" label-position="top" :model="enterResultData" style="margin-left: 0px;margin-top: 60px;">
  161. <el-form :inline="true" label-position="top" style="margin-top: 5px">
  162. <el-button type="primary" @click="uploadFile()">上传文件</el-button>
  163. </el-form>
  164. <el-table
  165. :height="200"
  166. :data="enterResultData.fileContentList"
  167. border
  168. v-loading="dataListLoading"
  169. style="width: 100%">
  170. <el-table-column
  171. v-for="(item,index) in fileColumnList" :key="index"
  172. :sortable="item.columnSortable"
  173. :prop="item.columnProp"
  174. :header-align="item.headerAlign"
  175. :show-overflow-tooltip="item.showOverflowTooltip"
  176. :align="item.align"
  177. :fixed="item.fixed===''?false:item.fixed"
  178. :min-width="item.columnWidth"
  179. :label="item.columnLabel">
  180. <template slot-scope="scope">
  181. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  182. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  183. </template>
  184. </el-table-column>
  185. <el-table-column
  186. fixed="right"
  187. header-align="center"
  188. align="center"
  189. width="100"
  190. label="操作">
  191. <template slot-scope="scope">
  192. <a @click="deleteFile(scope.row)">删除</a>
  193. </template>
  194. </el-table-column>
  195. </el-table>
  196. </el-form>
  197. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  198. <el-button type="primary" @click="saveQuotationResult()">保存</el-button>
  199. <el-button type="primary" @click="closeQuotationResultModal()">关闭</el-button>
  200. </el-footer>
  201. </el-dialog>
  202. <!-- 提交客户询价模态框 -->
  203. <el-dialog title="提交客户询价" :close-on-click-modal="false" v-drag :visible.sync="submitResultModalFlag" width="620px">
  204. <el-form :inline="true" label-position="top" :model="submitResultData" :rules="submitResultRules" style="margin-left: 0px;margin-top: 10px;">
  205. <el-form-item label="实际提交客户日期" prop="actualitySubmissionDate" :rules="submitResultRules.actualitySubmissionDate">
  206. <el-date-picker v-model="submitResultData.actualitySubmissionDate" type="date" value-format="yyyy-MM-dd" placeholder="请选择日期" style="width: 200px"></el-date-picker>
  207. </el-form-item>
  208. <el-form-item label="提交方式" prop="submissionMethod" :rules="submitResultRules.submissionMethod">
  209. <el-select v-model="submitResultData.submissionMethod" style="width: 221px">
  210. <el-option label="邮件" value="邮件"></el-option>
  211. <el-option label="口头" value="口头"></el-option>
  212. <el-option label="微信" value="微信"></el-option>
  213. <el-option label="其它" value="其它"></el-option>
  214. </el-select>
  215. </el-form-item>
  216. </el-form>
  217. <el-form :inline="true" label-position="top" :model="submitResultData" style="margin-left:0px;margin-top: 5px;">
  218. <el-form-item label="提交备注">
  219. <el-input type="textarea" v-model="submitResultData.submissionRemark" :rows="3" resize='none' maxlength="300" show-word-limit style="width: 456px;height: 30px"></el-input>
  220. </el-form-item>
  221. </el-form>
  222. <el-footer style="height:40px;margin-top: 60px;text-align:center">
  223. <el-button type="primary" @click="saveSubmitResult()">保存</el-button>
  224. <el-button type="primary" @click="submitResultModalFlag = false">关闭</el-button>
  225. </el-footer>
  226. </el-dialog>
  227. <!-- 客户回复模态框 -->
  228. <el-dialog title="客户回复" :close-on-click-modal="false" v-drag :visible.sync="customerResponseModalFlag" width="620px">
  229. <el-form :inline="true" label-position="top" :model="customerResponseData" :rules="customerResponseRules" style="margin-left: 0px;margin-top: 10px;">
  230. <el-form-item label="实际回复日期" prop="actualityReplyDate" :rules="customerResponseRules.actualityReplyDate">
  231. <el-date-picker v-model="customerResponseData.actualityReplyDate" type="date" value-format="yyyy-MM-dd" placeholder="请选择日期" style="width: 185px"></el-date-picker>
  232. </el-form-item>
  233. <el-form-item label="客户确认结果" prop="confirmResults" :rules="customerResponseRules.confirmResults">
  234. <el-select v-model="customerResponseData.confirmResults" style="width: 185px">
  235. <el-option label="接受" value="接受"></el-option>
  236. <el-option label="不接受" value="不接受"></el-option>
  237. </el-select>
  238. </el-form-item>
  239. <el-form-item label="客户确认人" prop="confirmBy" :rules="customerResponseRules.confirmBy">
  240. <el-input v-model="customerResponseData.confirmBy" style="width: 185px"></el-input>
  241. </el-form-item>
  242. </el-form>
  243. <el-form :inline="true" label-position="top" :model="customerResponseData" style="margin-left:0px;margin-top: 5px;">
  244. <el-form-item label="客户回复信息">
  245. <el-input type="textarea" v-model="customerResponseData.confirmInformation" :rows="3" resize='none' maxlength="300" show-word-limit style="width: 595px;height: 30px"></el-input>
  246. </el-form-item>
  247. </el-form>
  248. <el-footer style="height:40px;margin-top: 60px;text-align:center">
  249. <el-button type="primary" @click="saveCustomerResponse()">保存</el-button>
  250. <el-button type="primary" @click="customerResponseModalFlag = false">关闭</el-button>
  251. </el-footer>
  252. </el-dialog>
  253. <!-- 上传文件的modal -->
  254. <quotationUploadFile ref="quotationUploadFile" @refreshPageTables="getFileContentData()" v-drag></quotationUploadFile>
  255. </div>
  256. </template>
  257. <script>
  258. import {
  259. quotationInformationSearch, // 询价信息列表查询
  260. getFileContentList, // 获取询价单附件列表
  261. batchDeleteQuotationFile, // 批量文件删除
  262. saveQuotationResult, // 保存询价结果
  263. saveSubmitResult, // 保存提交结果
  264. saveCustomerResponse, // 保存客户回复
  265. checkQuotationStatus, // 检查询价进度
  266. closeModalDeleteFile, // 关闭模态框删除文件
  267. } from '@/api/quotation/quotationInformation.js'
  268. import quotationUploadFile from "./quotation_upload_file"
  269. export default {
  270. components: {
  271. quotationUploadFile
  272. },
  273. watch: {
  274. searchData: {
  275. deep: true,
  276. handler: function (newV, oldV) {
  277. this.searchData.customerNo = this.searchData.customerNo.toUpperCase()
  278. this.searchData.projectId = this.searchData.projectId.toUpperCase()
  279. }
  280. },
  281. modalData: {
  282. deep: true,
  283. handler: function (newV, oldV) {
  284. this.modalData.customerNo = this.modalData.customerNo.toUpperCase()
  285. this.modalData.projectId = this.modalData.projectId.toUpperCase()
  286. this.modalData.quotationNo = this.modalData.quotationNo.toUpperCase()
  287. }
  288. }
  289. },
  290. data () {
  291. return {
  292. // 导出
  293. exportData: [],
  294. exportName: '设备分类' + this.dayjs().format('YYYYMMDDHHmmss'),
  295. exportHeader: ['设备分类'],
  296. exportFooter: [],
  297. resultList: [],
  298. // ======== 行高 ========
  299. height: 200,
  300. // ======== 分页 ========
  301. pageIndex: 1,
  302. pageSize: 50,
  303. totalPage: 0,
  304. selectedDataNum: 0,
  305. // 条件查询
  306. searchData: {
  307. site: this.$store.state.user.site,
  308. customerNo: '',
  309. customerDesc: '',
  310. trackerName: '',
  311. testPartNo: '',
  312. partName: '',
  313. quotationStatus: '',
  314. startDate: '',
  315. endDate: '',
  316. projectId: '',
  317. projectName: '',
  318. quoterName: '',
  319. priorityLevel: '',
  320. page: 1,
  321. limit: 10
  322. },
  323. // 其它
  324. dataListLoading: false,
  325. // ======== 数据对象 ========
  326. modalData: {
  327. flag: '',
  328. title: '',
  329. site: this.$store.state.user.site,
  330. quotationNo: '',
  331. customerNo: '',
  332. customerDesc: '',
  333. projectId: '',
  334. projectName: '',
  335. tracker: '',
  336. trackerName: '',
  337. quoter: '',
  338. quoterName: '',
  339. quotationStatus: '',
  340. testPartNo: '',
  341. partName: '',
  342. priorityLevel: '',
  343. requiredCompletionDate: '',
  344. remark: '',
  345. technicalConsiderations: '',
  346. customerResponsiblePerson: '',
  347. customerResponsiblePersonPhone: '',
  348. nextToDo: '',
  349. actualityQuotationDate: '',
  350. quotationResultInformation: '',
  351. actualitySubmissionDate: '',
  352. submissionMethod: '',
  353. submissionRemark: '',
  354. actualityReplyDate: '',
  355. confirmResults: '',
  356. confirmBy: '',
  357. confirmInformation: '',
  358. quotationResultStatus: '',
  359. createDate: '',
  360. createBy: '',
  361. updateDate: '',
  362. updateBy: ''
  363. },
  364. quotationResultData: {
  365. actualityQuotationDate: '',
  366. quotationResultInformation: '',
  367. actualitySubmissionDate: '',
  368. submissionMethod: '',
  369. submissionRemark: '',
  370. confirmResults: '',
  371. actualityReplyDate: '',
  372. confirmBy: '',
  373. confirmInformation: '',
  374. quotationResultStatus: '',
  375. },
  376. enterResultData: {
  377. site: this.$store.state.user.site,
  378. quotationNo: '',
  379. actualityQuotationDate: '',
  380. quotationResultInformation: '',
  381. updateBy: this.$store.state.user.name,
  382. quotationResultStatus: '',
  383. fileContentList: []
  384. },
  385. submitResultData: {
  386. site: this.$store.state.user.site,
  387. quotationNo: '',
  388. actualitySubmissionDate: '',
  389. submissionMethod: '',
  390. submissionRemark: '',
  391. updateBy: this.$store.state.user.name,
  392. quotationResultStatus: ''
  393. },
  394. customerResponseData: {
  395. site: this.$store.state.user.site,
  396. quotationNo: '',
  397. actualityReplyDate: '',
  398. confirmResults: '',
  399. confirmBy: '',
  400. confirmInformation: '',
  401. updateBy: this.$store.state.user.name,
  402. quotationResultStatus: ''
  403. },
  404. // ======== 数据列表 ========
  405. dataList: [],
  406. // ======== 列表表头 ========
  407. columnList: [
  408. {
  409. userId: this.$store.state.user.name,
  410. functionId: 102001,
  411. serialNumber: '102001Table1QuotationNo',
  412. tableId: '102001Table1',
  413. tableName: '询价信息表',
  414. columnProp: 'quotationNo',
  415. headerAlign: 'center',
  416. align: 'center',
  417. columnLabel: '申请单号',
  418. columnHidden: false,
  419. columnImage: false,
  420. columnSortable: false,
  421. sortLv: 0,
  422. status: true,
  423. fixed: '',
  424. columnWidth: 120
  425. },
  426. {
  427. userId: this.$store.state.user.name,
  428. functionId: 102001,
  429. serialNumber: '102001Table1CustomerNo',
  430. tableId: '102001Table1',
  431. tableName: '询价信息表',
  432. columnProp: 'customerNo',
  433. headerAlign: 'center',
  434. align: 'center',
  435. columnLabel: '客户编码',
  436. columnHidden: false,
  437. columnImage: false,
  438. columnSortable: false,
  439. sortLv: 0,
  440. status: true,
  441. fixed: '',
  442. columnWidth: 100
  443. },
  444. {
  445. userId: this.$store.state.user.name,
  446. functionId: 102001,
  447. serialNumber: '102001Table1CustomerDesc',
  448. tableId: '102001Table1',
  449. tableName: '询价信息表',
  450. columnProp: 'customerDesc',
  451. headerAlign: 'center',
  452. align: 'center',
  453. columnLabel: '客户名称',
  454. columnHidden: false,
  455. columnImage: false,
  456. columnSortable: false,
  457. sortLv: 0,
  458. status: true,
  459. fixed: '',
  460. columnWidth: 120
  461. },
  462. {
  463. userId: this.$store.state.user.name,
  464. functionId: 102001,
  465. serialNumber: '102001Table1ProjectId',
  466. tableId: '102001Table1',
  467. tableName: '询价信息表',
  468. columnProp: 'projectId',
  469. headerAlign: 'center',
  470. align: 'center',
  471. columnLabel: '项目编码',
  472. columnHidden: false,
  473. columnImage: false,
  474. columnSortable: false,
  475. sortLv: 0,
  476. status: true,
  477. fixed: '',
  478. columnWidth: 100
  479. },
  480. {
  481. userId: this.$store.state.user.name,
  482. functionId: 102001,
  483. serialNumber: '102001Table1ProjectName',
  484. tableId: '102001Table1',
  485. tableName: '询价信息表',
  486. columnProp: 'projectName',
  487. headerAlign: 'center',
  488. align: 'center',
  489. columnLabel: '项目名称',
  490. columnHidden: false,
  491. columnImage: false,
  492. columnSortable: false,
  493. sortLv: 0,
  494. status: true,
  495. fixed: '',
  496. columnWidth: 120
  497. },
  498. {
  499. userId: this.$store.state.user.name,
  500. functionId: 102001,
  501. serialNumber: '102001Table1TrackerName',
  502. tableId: '102001Table1',
  503. tableName: '询价信息表',
  504. columnProp: 'trackerName',
  505. headerAlign: 'center',
  506. align: 'center',
  507. columnLabel: '跟单员',
  508. columnHidden: false,
  509. columnImage: false,
  510. columnSortable: false,
  511. sortLv: 0,
  512. status: true,
  513. fixed: '',
  514. columnWidth: 80
  515. },
  516. {
  517. userId: this.$store.state.user.name,
  518. functionId: 102001,
  519. serialNumber: '102001Table1QuoterName',
  520. tableId: '102001Table1',
  521. tableName: '询价信息表',
  522. columnProp: 'quoterName',
  523. headerAlign: 'center',
  524. align: 'center',
  525. columnLabel: '询价专员',
  526. columnHidden: false,
  527. columnImage: false,
  528. columnSortable: false,
  529. sortLv: 0,
  530. status: true,
  531. fixed: '',
  532. columnWidth: 80
  533. },
  534. {
  535. userId: this.$store.state.user.name,
  536. functionId: 102001,
  537. serialNumber: '102001Table1TestPartNo',
  538. tableId: '102001Table1',
  539. tableName: '询价信息表',
  540. columnProp: 'testPartNo',
  541. headerAlign: 'center',
  542. align: 'center',
  543. columnLabel: '项目料号',
  544. columnHidden: false,
  545. columnImage: false,
  546. columnSortable: false,
  547. sortLv: 0,
  548. status: true,
  549. fixed: '',
  550. columnWidth: 100
  551. },
  552. {
  553. userId: this.$store.state.user.name,
  554. functionId: 102001,
  555. serialNumber: '102001Table1PartName',
  556. tableId: '102001Table1',
  557. tableName: '询价信息表',
  558. columnProp: 'partName',
  559. headerAlign: 'center',
  560. align: 'center',
  561. columnLabel: '物料名称',
  562. columnHidden: false,
  563. columnImage: false,
  564. columnSortable: false,
  565. sortLv: 0,
  566. status: true,
  567. fixed: '',
  568. columnWidth: 100
  569. },
  570. {
  571. userId: this.$store.state.user.name,
  572. functionId: 102001,
  573. serialNumber: '102001Table1PriorityLevel',
  574. tableId: '102001Table1',
  575. tableName: '询价信息表',
  576. columnProp: 'priorityLevel',
  577. headerAlign: 'center',
  578. align: 'center',
  579. columnLabel: '优先等级',
  580. columnHidden: false,
  581. columnImage: false,
  582. columnSortable: false,
  583. sortLv: 0,
  584. status: true,
  585. fixed: '',
  586. columnWidth: 80
  587. },
  588. {
  589. userId: this.$store.state.user.name,
  590. functionId: 102001,
  591. serialNumber: '102001Table1RequiredCompletionDate',
  592. tableId: '102001Table1',
  593. tableName: '询价信息表',
  594. columnProp: 'requiredCompletionDate',
  595. headerAlign: 'center',
  596. align: 'center',
  597. columnLabel: '要求完成日期',
  598. columnHidden: false,
  599. columnImage: false,
  600. columnSortable: false,
  601. sortLv: 0,
  602. status: true,
  603. fixed: '',
  604. columnWidth: 160
  605. },
  606. {
  607. userId: this.$store.state.user.name,
  608. functionId: 102001,
  609. serialNumber: '102001Table1quotationStatus',
  610. tableId: '102001Table1',
  611. tableName: '询价信息表',
  612. columnProp: 'quotationStatus',
  613. headerAlign: 'center',
  614. align: 'center',
  615. columnLabel: '状态',
  616. columnHidden: false,
  617. columnImage: false,
  618. columnSortable: false,
  619. sortLv: 0,
  620. status: true,
  621. fixed: '',
  622. columnWidth: 80
  623. },
  624. {
  625. userId: this.$store.state.user.name,
  626. functionId: 102001,
  627. serialNumber: '102001Table1CreateDate',
  628. tableId: '102001Table1',
  629. tableName: '询价信息表',
  630. columnProp: 'createDate',
  631. headerAlign: 'center',
  632. align: 'center',
  633. columnLabel: '创建时间',
  634. columnHidden: false,
  635. columnImage: false,
  636. columnSortable: false,
  637. sortLv: 0,
  638. status: true,
  639. fixed: '',
  640. columnWidth: 160
  641. },
  642. {
  643. userId: this.$store.state.user.name,
  644. functionId: 102001,
  645. serialNumber: '102001Table1CreateBy',
  646. tableId: '102001Table1',
  647. tableName: '询价信息表',
  648. columnProp: 'createBy',
  649. headerAlign: 'center',
  650. align: 'center',
  651. columnLabel: '创建人',
  652. columnHidden: false,
  653. columnImage: false,
  654. columnSortable: false,
  655. sortLv: 0,
  656. status: true,
  657. fixed: '',
  658. columnWidth: 80
  659. },
  660. {
  661. userId: this.$store.state.user.name,
  662. functionId: 102001,
  663. serialNumber: '102001Table1UpdateDate',
  664. tableId: '102001Table1',
  665. tableName: '询价信息表',
  666. columnProp: 'updateDate',
  667. headerAlign: 'center',
  668. align: 'center',
  669. columnLabel: '更新时间',
  670. columnHidden: false,
  671. columnImage: false,
  672. columnSortable: false,
  673. sortLv: 0,
  674. status: true,
  675. fixed: '',
  676. columnWidth: 160
  677. },
  678. {
  679. userId: this.$store.state.user.name,
  680. functionId: 102001,
  681. serialNumber: '102001Table1UpdateBy',
  682. tableId: '102001Table1',
  683. tableName: '询价信息表',
  684. columnProp: 'updateBy',
  685. headerAlign: 'center',
  686. align: 'center',
  687. columnLabel: '更新人',
  688. columnHidden: false,
  689. columnImage: false,
  690. columnSortable: false,
  691. sortLv: 0,
  692. status: true,
  693. fixed: '',
  694. columnWidth: 80
  695. }
  696. ],
  697. fileColumnList: [
  698. {
  699. userId: this.$store.state.user.name,
  700. functionId: 102001,
  701. serialNumber: '102001Table2FileName',
  702. tableId: '102001Table2',
  703. tableName: '文件信息表',
  704. columnProp: 'fileName',
  705. headerAlign: 'center',
  706. align: 'center',
  707. columnLabel: '文件名称',
  708. columnHidden: false,
  709. columnImage: false,
  710. columnSortable: false,
  711. sortLv: 0,
  712. status: true,
  713. fixed: '',
  714. columnWidth: 140
  715. },
  716. {
  717. userId: this.$store.state.user.name,
  718. functionId: 102001,
  719. serialNumber: '102001Table2FileRemark',
  720. tableId: '102001Table2',
  721. tableName: '文件信息表',
  722. columnProp: 'fileRemark',
  723. headerAlign: 'center',
  724. align: 'center',
  725. columnLabel: '备注',
  726. columnHidden: false,
  727. columnImage: false,
  728. columnSortable: false,
  729. sortLv: 0,
  730. status: true,
  731. fixed: '',
  732. columnWidth: 240
  733. },
  734. // {
  735. // userId: this.$store.state.user.name,
  736. // functionId: 102001,
  737. // serialNumber: '102001Table2OrderRef3',
  738. // tableId: '102001Table2',
  739. // tableName: '文件信息表',
  740. // columnProp: 'orderRef3',
  741. // headerAlign: 'center',
  742. // align: 'center',
  743. // columnLabel: '文件描述',
  744. // columnHidden: false,
  745. // columnImage: false,
  746. // columnSortable: false,
  747. // sortLv: 0,
  748. // status: true,
  749. // fixed: '',
  750. // columnWidth: 120
  751. // },
  752. {
  753. userId: this.$store.state.user.name,
  754. functionId: 102001,
  755. serialNumber: '102001Table2CreateDate',
  756. tableId: '102001Table2',
  757. tableName: '文件信息表',
  758. columnProp: 'createDate',
  759. headerAlign: 'center',
  760. align: 'center',
  761. columnLabel: '上传时间',
  762. columnHidden: false,
  763. columnImage: false,
  764. columnSortable: false,
  765. sortLv: 0,
  766. status: true,
  767. fixed: '',
  768. columnWidth: 140
  769. },
  770. {
  771. userId: this.$store.state.user.name,
  772. functionId: 102001,
  773. serialNumber: '102001Table2CreatedBy',
  774. tableId: '102001Table2',
  775. tableName: '文件信息表',
  776. columnProp: 'createdBy',
  777. headerAlign: 'center',
  778. align: 'center',
  779. columnLabel: '上传人',
  780. columnHidden: false,
  781. columnImage: false,
  782. columnSortable: false,
  783. sortLv: 0,
  784. status: true,
  785. fixed: '',
  786. columnWidth: 140
  787. }
  788. ],
  789. // ======== 必填规则 ========
  790. rules: {
  791. customerDesc: [
  792. {
  793. required: true,
  794. message: ' ',
  795. trigger: 'change'
  796. }
  797. ],
  798. trackerName: [
  799. {
  800. required: true,
  801. message: ' ',
  802. trigger: 'change'
  803. }
  804. ],
  805. projectName: [
  806. {
  807. required: true,
  808. message: ' ',
  809. trigger: 'change'
  810. }
  811. ],
  812. quoterName: [
  813. {
  814. required: true,
  815. message: ' ',
  816. trigger: 'change'
  817. }
  818. ],
  819. partName: [
  820. {
  821. required: true,
  822. message: ' ',
  823. trigger: 'change'
  824. }
  825. ],
  826. priorityLevel: [
  827. {
  828. required: true,
  829. message: ' ',
  830. trigger: 'change'
  831. }
  832. ],
  833. requiredCompletionDate: [
  834. {
  835. required: true,
  836. message: ' ',
  837. trigger: 'change'
  838. }
  839. ]
  840. },
  841. enterResultRules: {
  842. actualityQuotationDate: [
  843. {
  844. required: true,
  845. message: ' ',
  846. trigger: 'change'
  847. }
  848. ],
  849. quotationResultInformation: [
  850. {
  851. required: true,
  852. message: ' ',
  853. trigger: 'change'
  854. }
  855. ]
  856. },
  857. submitResultRules: {
  858. actualitySubmissionDate: [
  859. {
  860. required: true,
  861. message: ' ',
  862. trigger: 'change'
  863. }
  864. ],
  865. submissionMethod: [
  866. {
  867. required: true,
  868. message: ' ',
  869. trigger: 'change'
  870. }
  871. ]
  872. },
  873. customerResponseRules: {
  874. actualityReplyDate: [
  875. {
  876. required: true,
  877. message: ' ',
  878. trigger: 'change'
  879. }
  880. ],
  881. confirmResults: [
  882. {
  883. required: true,
  884. message: ' ',
  885. trigger: 'change'
  886. }
  887. ],
  888. confirmBy: [
  889. {
  890. required: true,
  891. message: ' ',
  892. trigger: 'change'
  893. }
  894. ]
  895. },
  896. // ======== 复选数据集 ========
  897. quotationSelections: [],
  898. // ======== 选中的当前行数据 ========
  899. quotationCurrentRow: {},
  900. // ======== 模态框开关控制 ========
  901. modalFlag: false,
  902. modalDisableFlag: false,
  903. enterResultModalFlag: false,
  904. submitResultModalFlag: false,
  905. customerResponseModalFlag: false,
  906. }
  907. },
  908. mounted () {
  909. this.$nextTick(() => {
  910. this.height = window.innerHeight - 210
  911. })
  912. },
  913. created () {
  914. this.getDataList()
  915. },
  916. methods: {
  917. // ======== 分页相关方法 ========
  918. /**
  919. * 每页数
  920. * @param val
  921. */
  922. sizeChangeHandle (val) {
  923. this.pageSize = val
  924. this.pageIndex = 1
  925. this.getDataList()
  926. },
  927. /**
  928. * 当前页
  929. * @param val
  930. */
  931. currentChangeHandle (val) {
  932. this.pageIndex = val
  933. this.getDataList()
  934. },
  935. // ======== 复选框操作相关方法 ========
  936. /**
  937. * 未知
  938. * @returns {boolean}
  939. */
  940. selectFlag () {
  941. return true;
  942. },
  943. // ======== 列表数据刷新方法 ========
  944. /**
  945. * 获取数据列表
  946. */
  947. getDataList () {
  948. this.searchData.limit = this.pageSize
  949. this.searchData.page = this.pageIndex
  950. quotationInformationSearch(this.searchData).then(({data}) => {
  951. if (data.code === 0) {
  952. this.dataList = data.page.list
  953. this.pageIndex = data.page.currPage
  954. this.pageSize = data.page.pageSize
  955. this.totalPage = data.page.totalCount
  956. this.$refs.selectDiv.setLengthAll( this.dataList.length)
  957. //判断是否全部存在数据
  958. if(this.totalPage > 0){
  959. //设置选中行
  960. this.$refs.quotationTable.setCurrentRow(this.dataList[0])
  961. this.quotationClickRow(this.dataList[0])
  962. }
  963. }
  964. this.dataListLoading = false
  965. })
  966. },
  967. // ======== 列表操作方法 ========
  968. /**
  969. * 单机选中询价信息
  970. * @param row
  971. */
  972. quotationClickRow (row) {
  973. this.$refs.quotationTable.toggleRowSelection(row)
  974. this.quotationCurrentRow = JSON.parse(JSON.stringify(row))
  975. },
  976. /**
  977. * 复选询价信息
  978. * @param val
  979. */
  980. selectionQuotation (val) {
  981. this.quotationSelections = val
  982. this.$refs.selectDiv.setLengthselected(this.quotationSelections.length)
  983. },
  984. // ======== 询价结果相关方法 ========
  985. /**
  986. * 录入询价结果
  987. */
  988. quotationResultModal () {
  989. // 判断是否选中询价单
  990. if (this.quotationSelections == null || this.quotationSelections.length <= 0) {
  991. this.$message.warning('请勾选询价单!')
  992. return
  993. }
  994. let tempData = {
  995. currentStatus: 'C',
  996. informationList: this.quotationSelections,
  997. }
  998. // 检查询价单状态
  999. checkQuotationStatus(tempData).then(({data}) => {
  1000. if (data && data.code === 0) {
  1001. if (data.flag === 1) { // 状态一致
  1002. this.packQuotationResultModal()
  1003. } else { // 状态不同
  1004. this.$message.warning('选中的询价单进度不一致或与按钮不符,请确认!')
  1005. }
  1006. } else {
  1007. this.$alert(data.msg, '错误', {
  1008. confirmButtonText: '确定'
  1009. })
  1010. }
  1011. })
  1012. },
  1013. /**
  1014. * 封装录入方法
  1015. */
  1016. packQuotationResultModal () {
  1017. // 重置对象
  1018. this.enterResultData = {
  1019. site: this.$store.state.user.site,
  1020. quotationNo: '',
  1021. actualityQuotationDate: '',
  1022. quotationResultInformation: '',
  1023. quotationResultStatus: 'E',
  1024. fileContentList: [],
  1025. updateBy: this.$store.state.user.name
  1026. }
  1027. // 获得选中的询价号
  1028. this.quotationSelections.forEach(val => {
  1029. this.enterResultData.quotationNo += ';' + val.quotationNo
  1030. })
  1031. this.enterResultData.quotationNo = this.enterResultData.quotationNo.substring(1)
  1032. this.enterResultModalFlag = true
  1033. },
  1034. /**
  1035. * 保存询价结果
  1036. */
  1037. saveQuotationResult () {
  1038. if (this.enterResultData.actualityQuotationDate === '' || this.enterResultData.actualityQuotationDate == null) {
  1039. this.$message.warning('请选择实际询价日期!')
  1040. return
  1041. }
  1042. if (this.enterResultData.quotationResultInformation === '' || this.enterResultData.quotationResultInformation == null) {
  1043. this.$message.warning('请填写询价结果信息!')
  1044. return
  1045. }
  1046. if (this.quotationSelections.length > 1) {
  1047. this.$confirm(`是否录入多条询价结果?`, '提示', {
  1048. confirmButtonText: '确定',
  1049. cancelButtonText: '取消',
  1050. type: 'warning'
  1051. }).then(() => {
  1052. saveQuotationResult(this.enterResultData).then(({data}) => {
  1053. if (data && data.code === 0) {
  1054. this.getDataList()
  1055. this.enterResultModalFlag = false
  1056. this.$message({
  1057. message: '操作成功',
  1058. type: 'success',
  1059. duration: 1500,
  1060. onClose: () => {}
  1061. })
  1062. } else {
  1063. this.$alert(data.msg, '错误', {
  1064. confirmButtonText: '确定'
  1065. })
  1066. }
  1067. })
  1068. }).catch(() => {
  1069. })
  1070. } else {
  1071. saveQuotationResult(this.enterResultData).then(({data}) => {
  1072. if (data && data.code === 0) {
  1073. this.getDataList()
  1074. this.enterResultModalFlag = false
  1075. this.$message({
  1076. message: '操作成功',
  1077. type: 'success',
  1078. duration: 1500,
  1079. onClose: () => {}
  1080. })
  1081. } else {
  1082. this.$alert(data.msg, '错误', {
  1083. confirmButtonText: '确定'
  1084. })
  1085. }
  1086. })
  1087. }
  1088. },
  1089. /**
  1090. * 关闭询价结果模态框
  1091. */
  1092. closeQuotationResultModal () {
  1093. // 删除已上传的文件
  1094. let tempData = {
  1095. orderRef1: this.enterResultData.site,
  1096. quotationNo: this.enterResultData.quotationNo
  1097. }
  1098. closeModalDeleteFile(tempData).then(({data}) => {
  1099. if (data && data.code === 0) {
  1100. this.enterResultModalFlag = false
  1101. } else {
  1102. this.$alert(data.msg, '错误', {
  1103. confirmButtonText: '确定'
  1104. })
  1105. }
  1106. })
  1107. },
  1108. /**
  1109. * 提交客户询价
  1110. */
  1111. submitQuotationModal () {
  1112. // 判断是否选中询价单
  1113. if (this.quotationSelections == null || this.quotationSelections.length <= 0) {
  1114. this.$message.warning('请勾选询价单!')
  1115. return
  1116. }
  1117. let tempData = {
  1118. currentStatus: 'E',
  1119. informationList: this.quotationSelections,
  1120. }
  1121. // 检查询价单状态
  1122. checkQuotationStatus(tempData).then(({data}) => {
  1123. if (data && data.code === 0) {
  1124. if (data.flag === 1) { // 状态一致
  1125. this.packSubmitQuotationModal()
  1126. } else { // 状态不同
  1127. this.$message.warning('选中的询价单进度不一致或与按钮不符,请确认!')
  1128. }
  1129. } else {
  1130. this.$alert(data.msg, '错误', {
  1131. confirmButtonText: '确定'
  1132. })
  1133. }
  1134. })
  1135. },
  1136. /**
  1137. * 封装提交方法
  1138. */
  1139. packSubmitQuotationModal () {
  1140. this.submitResultData = {
  1141. site: this.$store.state.user.site,
  1142. quotationNo: '',
  1143. actualitySubmissionDate: '',
  1144. submissionMethod: '',
  1145. submissionRemark: '',
  1146. quotationResultStatus: 'S',
  1147. updateBy: this.$store.state.user.name
  1148. }
  1149. // 获得选中的询价号
  1150. this.quotationSelections.forEach(val => {
  1151. this.submitResultData.quotationNo += ';' + val.quotationNo
  1152. })
  1153. this.submitResultData.quotationNo = this.submitResultData.quotationNo.substring(1)
  1154. this.submitResultModalFlag = true
  1155. },
  1156. /**
  1157. * 保存提交结果
  1158. */
  1159. saveSubmitResult () {
  1160. if (this.submitResultData.actualitySubmissionDate === '' || this.submitResultData.actualitySubmissionDate == null) {
  1161. this.$message.warning('请选择实际提交客户日期!')
  1162. return
  1163. }
  1164. if (this.submitResultData.submissionMethod === '' || this.submitResultData.submissionMethod == null) {
  1165. this.$message.warning('请选择提交方式!')
  1166. return
  1167. }
  1168. if (this.quotationSelections.length > 1) {
  1169. this.$confirm(`是否提交多条客户询价?`, '提示', {
  1170. confirmButtonText: '确定',
  1171. cancelButtonText: '取消',
  1172. type: 'warning'
  1173. }).then(() => {
  1174. saveSubmitResult(this.submitResultData).then(({data}) => {
  1175. if (data && data.code === 0) {
  1176. this.getDataList()
  1177. this.submitResultModalFlag = false
  1178. this.$message({
  1179. message: '操作成功',
  1180. type: 'success',
  1181. duration: 1500,
  1182. onClose: () => {}
  1183. })
  1184. } else {
  1185. this.$alert(data.msg, '错误', {
  1186. confirmButtonText: '确定'
  1187. })
  1188. }
  1189. })
  1190. }).catch(() => {
  1191. })
  1192. }
  1193. },
  1194. /**
  1195. * 客户回复
  1196. */
  1197. customerResponseModal () {
  1198. // 判断是否选中询价单
  1199. if (this.quotationSelections == null || this.quotationSelections.length <= 0) {
  1200. this.$message.warning('请勾选询价单!')
  1201. return
  1202. }
  1203. let tempData = {
  1204. currentStatus: 'S',
  1205. informationList: this.quotationSelections,
  1206. }
  1207. // 检查询价单状态
  1208. checkQuotationStatus(tempData).then(({data}) => {
  1209. if (data && data.code === 0) {
  1210. if (data.flag === 1) { // 状态一致
  1211. this.packCustomerResponseModal()
  1212. } else { // 状态不同
  1213. this.$message.warning('选中的询价单进度不一致或与按钮不符,请确认!')
  1214. }
  1215. } else {
  1216. this.$alert(data.msg, '错误', {
  1217. confirmButtonText: '确定'
  1218. })
  1219. }
  1220. })
  1221. },
  1222. /**
  1223. * 封装回复方法
  1224. */
  1225. packCustomerResponseModal () {
  1226. this.customerResponseData = {
  1227. site: this.$store.state.user.site,
  1228. quotationNo: '',
  1229. actualityReplyDate: '',
  1230. confirmResults: '',
  1231. confirmBy: '',
  1232. confirmInformation: '',
  1233. quotationResultStatus: 'R',
  1234. updateBy: this.$store.state.user.name
  1235. }
  1236. // 获得选中的询价号
  1237. this.quotationSelections.forEach(val => {
  1238. this.customerResponseData.quotationNo += ';' + val.quotationNo
  1239. })
  1240. this.customerResponseData.quotationNo = this.customerResponseData.quotationNo.substring(1)
  1241. this.customerResponseModalFlag = true
  1242. },
  1243. /**
  1244. * 保存客户回复
  1245. */
  1246. saveCustomerResponse () {
  1247. if (this.customerResponseData.actualityReplyDate === '' || this.customerResponseData.actualityReplyDate == null) {
  1248. this.$message.warning('请选择实际回复日期!')
  1249. return
  1250. }
  1251. if (this.customerResponseData.confirmResults === '' || this.customerResponseData.confirmResults == null) {
  1252. this.$message.warning('请选择客户确认结果!')
  1253. return
  1254. }
  1255. if (this.customerResponseData.confirmBy === '' || this.customerResponseData.confirmBy == null) {
  1256. this.$message.warning('请填写客户确认人!')
  1257. return
  1258. }
  1259. if (this.quotationSelections.length > 1) {
  1260. this.$confirm(`是否提交多条客户回复?`, '提示', {
  1261. confirmButtonText: '确定',
  1262. cancelButtonText: '取消',
  1263. type: 'warning'
  1264. }).then(() => {
  1265. saveCustomerResponse(this.customerResponseData).then(({data}) => {
  1266. if (data && data.code === 0) {
  1267. this.getDataList()
  1268. this.customerResponseModalFlag = false
  1269. this.$message({
  1270. message: '操作成功',
  1271. type: 'success',
  1272. duration: 1500,
  1273. onClose: () => {}
  1274. })
  1275. } else {
  1276. this.$alert(data.msg, '错误', {
  1277. confirmButtonText: '确定'
  1278. })
  1279. }
  1280. })
  1281. }).catch(() => {
  1282. })
  1283. }
  1284. },
  1285. // ======== 询价单附件的相关方法 ========
  1286. /**
  1287. * 获取询价单附件列表
  1288. */
  1289. getFileContentData () {
  1290. let currentData = {
  1291. orderRef1: this.$store.state.user.site,
  1292. orderRef2: this.enterResultData.quotationNo.split(';')[0]
  1293. }
  1294. getFileContentList(currentData).then(({data}) => {
  1295. if (data && data.code === 0) {
  1296. this.enterResultData.fileContentList = data.rows
  1297. } else {
  1298. this.enterResultData.fileContentList = []
  1299. }
  1300. })
  1301. },
  1302. /**
  1303. * 上传文件
  1304. */
  1305. uploadFile () {
  1306. let currentData = {
  1307. titleCon: '批量询价附件上传',
  1308. site: this.$store.state.user.site,
  1309. createBy: this.$store.state.user.name,
  1310. quotationNo: this.enterResultData.quotationNo,
  1311. fileRemark: '',
  1312. folder: 'quotationFile',
  1313. }
  1314. //打开组件 去做新增业务
  1315. this.$nextTick(() => {
  1316. this.$refs.quotationUploadFile.init(currentData)
  1317. })
  1318. },
  1319. /**
  1320. * 文件删除
  1321. * @param row
  1322. */
  1323. deleteFile (row) {
  1324. this.$confirm('确定要删除此文件?', '提示', {
  1325. confirmButtonText: '确定',
  1326. cancelButtonText: '取消',
  1327. type: 'warning'
  1328. }).then(() => {
  1329. let tempData = {
  1330. id: row.id,
  1331. fileName: row.fileName,
  1332. orderRef1: row.orderRef1,
  1333. orderRef2: row.orderRef2,
  1334. orderRef3: row.orderRef3,
  1335. quotationNo: this.enterResultData.quotationNo
  1336. }
  1337. batchDeleteQuotationFile(tempData).then(({data}) => {
  1338. if (data && data.code === 0) {
  1339. this.getFileContentData()
  1340. this.$message({
  1341. message: '操作成功',
  1342. type: 'success',
  1343. duration: 1500,
  1344. onClose: () => {}
  1345. })
  1346. } else {
  1347. this.$alert(data.msg, '错误', {
  1348. confirmButtonText: '确定'
  1349. })
  1350. }
  1351. })
  1352. }).catch(() => {
  1353. })
  1354. },
  1355. // ======== 导出相关方法 ========
  1356. /**
  1357. * 导出excel
  1358. */
  1359. async createExportData () {
  1360. this.searchData.limit = -1
  1361. this.searchData.page = 1
  1362. await quotationInformationSearch(this.searchData).then(({data}) => {
  1363. this.resultList = data.page.list
  1364. })
  1365. return this.resultList
  1366. },
  1367. startDownload () {
  1368. },
  1369. finishDownload () {
  1370. },
  1371. fields () {
  1372. let json = '{'
  1373. this.columnList.forEach((item, index) => {
  1374. if (index == this.columnList.length - 1) {
  1375. json += '"' + item.columnLabel + '"' + ':' + '"' + item.columnProp + '"'
  1376. } else {
  1377. json += '"' + item.columnLabel + '"' + ':' + '"' + item.columnProp + '"' + ','
  1378. }
  1379. })
  1380. json += '}'
  1381. let s = eval('(' + json + ')')
  1382. return s
  1383. }
  1384. }
  1385. }
  1386. </script>
  1387. <style scoped lang="scss">
  1388. /deep/ .customer-tab .el-tabs__content {
  1389. padding: 0px !important;
  1390. height: 459px;
  1391. }
  1392. </style>