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.

1192 lines
37 KiB

  1. <template>
  2. <div class="mod-config">
  3. <el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList()">
  4. <el-row :gutter="10">
  5. <el-col :span="3">
  6. <el-form-item :label="'BU'">
  7. <el-select v-model="searchData.bu" placeholder="请选择" clearable>
  8. <el-option
  9. v-for = "i in userBuList"
  10. :key = "i.buNo"
  11. :label = "i.buDesc"
  12. :value = "i.buNo">
  13. </el-option>
  14. </el-select>
  15. </el-form-item>
  16. </el-col>
  17. <el-col :span="3">
  18. <el-form-item label="客户编码">
  19. <el-input v-model="searchData.customerNo"></el-input>
  20. </el-form-item>
  21. </el-col>
  22. <el-col :span="3">
  23. <el-form-item label="客户名称">
  24. <el-input v-model="searchData.customerDesc"></el-input>
  25. </el-form-item>
  26. </el-col>
  27. <el-col :span="3">
  28. <el-form-item label="采购专员">
  29. <el-input v-model="searchData.purchase"></el-input>
  30. </el-form-item>
  31. </el-col>
  32. <el-col :span="3">
  33. <el-form-item label="报价单号">
  34. <el-input v-model="searchData.quoteVersionNo"></el-input>
  35. </el-form-item>
  36. </el-col>
  37. <el-col :span="3">
  38. <el-form-item label="客户询价单号">
  39. <el-input v-model="searchData.customerInquiryNo"></el-input>
  40. </el-form-item>
  41. </el-col>
  42. </el-row>
  43. <el-row :gutter="10">
  44. <el-col :span="3">
  45. <el-form-item label="内部询价单号">
  46. <el-input v-model="searchData.insideInquiryNo"></el-input>
  47. </el-form-item>
  48. </el-col>
  49. <el-col :span="3">
  50. <el-form-item label="报价专员">
  51. <el-input v-model="searchData.quoter"></el-input>
  52. </el-form-item>
  53. </el-col>
  54. <el-col :span="3">
  55. <el-form-item label="状态">
  56. <el-select v-model="searchData.status" style="width: 100%">
  57. <el-option label="全部" value=""></el-option>
  58. <el-option label="草稿" value="草稿"></el-option>
  59. <el-option label="下达" value="下达"></el-option>
  60. </el-select>
  61. </el-form-item>
  62. </el-col>
  63. <el-col :span="6">
  64. <el-form-item label="报价日期">
  65. <div style="display: flex">
  66. <el-date-picker style="width: 47%" v-model="searchData.startDate" type="date" value-format='yyyy-MM-dd' format='yyyy-MM-dd'></el-date-picker>
  67. <div style="width: 6%;text-align: center">-</div>
  68. <el-date-picker style="width: 47%" v-model="searchData.endDate" type="date" value-format='yyyy-MM-dd' format='yyyy-MM-dd'></el-date-picker>
  69. </div>
  70. </el-form-item>
  71. </el-col>
  72. <el-col :span="3">
  73. <el-form-item label=" ">
  74. <el-button @click="getDataListAll"> </el-button>
  75. </el-form-item>
  76. </el-col>
  77. </el-row>
  78. </el-form>
  79. <!-- 询价列表 -->
  80. <el-table
  81. height="30vh"
  82. :data="dataList"
  83. border
  84. ref="mainTable"
  85. highlight-current-row
  86. @row-click="quoteClickRow"
  87. @current-change="changeCurrentRow"
  88. v-loading="dataListLoading"
  89. style="width: 100%;margin-top: 5px">
  90. <el-table-column
  91. v-for="(item,index) in columnList" :key="index"
  92. :sortable="item.columnSortable"
  93. :prop="item.columnProp"
  94. :header-align="item.headerAlign"
  95. :align="item.align"
  96. :fixed="item.fixed === ''?false:item.fixed"
  97. :min-width="item.columnWidth"
  98. :label="item.columnLabel">
  99. <template slot-scope="scope">
  100. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  101. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  102. </template>
  103. </el-table-column>
  104. <el-table-column
  105. fixed="right"
  106. header-align="center"
  107. align="center"
  108. width="180"
  109. label="操作">
  110. <template slot-scope="scope">
  111. <el-link style="cursor: pointer" @click="updateModal(scope.row)">审批</el-link>
  112. </template>
  113. </el-table-column>
  114. </el-table>
  115. <!-- 分页插件 -->
  116. <el-pagination style="margin-top: 0px"
  117. @size-change="sizeChangeHandle"
  118. @current-change="currentChangeHandle"
  119. :current-page="pageIndex"
  120. :page-sizes="[20, 50, 100, 200, 500]"
  121. :page-size="pageSize"
  122. :total="totalPage"
  123. layout="total, sizes, prev, pager, next, jumper">
  124. </el-pagination>
  125. <el-tabs style="margin-top: 0px; width: 100%; height: 100%;" v-model="activeName" class="customer-tab" type="border-card" @tab-click="tabClick">
  126. <el-tab-pane label="报价信息" name="quotationInformation">
  127. <el-form :inline="true" label-width="120px" label-position="top">
  128. <el-form-item label="Application">
  129. <el-input v-model="quoteCurrentRow.application" style="width: 210px" readonly></el-input>
  130. </el-form-item>
  131. <el-form-item label="Customer">
  132. <el-input v-model="quoteCurrentRow.customerDesc" readonly></el-input>
  133. </el-form-item>
  134. <el-form-item label="年需求量">
  135. <el-input-number v-model="quoteCurrentRow.annualDemand" disabled :controls="false"></el-input-number>
  136. </el-form-item>
  137. <el-form-item label="Cost Model">
  138. <el-input v-model="quoteCurrentRow.costModel" style="width: 210px" readonly></el-input>
  139. </el-form-item>
  140. <el-form-item label="Markup">
  141. <el-input-number v-model="quoteCurrentRow.markup" disabled :controls="false"></el-input-number>
  142. </el-form-item>
  143. </el-form>
  144. <el-form :inline="true" label-width="120px" label-position="top">
  145. <el-form-item label="报价备注">
  146. <el-input type="textarea" :rows="2" v-model="quoteCurrentRow.remark" style="width: 1019px" readonly></el-input>
  147. </el-form-item>
  148. </el-form>
  149. <quote-detail :quote="quoteCurrentRow" :auth-flag="true" :height="'33vh'"></quote-detail>
  150. </el-tab-pane>
  151. </el-tabs>
  152. <el-dialog title="申请单审核" :visible.sync="reviewFlag" width="520px" :close-on-click-modal="false"
  153. v-drag>
  154. <el-row>
  155. <el-col :span="24" style="margin-top: 30px">
  156. <div style="margin-left: 45px;margin-top: -30px">
  157. <el-form :inline="true" label-width="120px" label-position="top">
  158. <el-form-item label="申请单号">
  159. <el-input style="width: 200px;" readonly placeholder="" :value="modalData.quoteVersionNo"></el-input>
  160. </el-form-item>
  161. <el-form-item label="审批步骤号">
  162. <el-input style="width: 200px;" readonly placeholder="" :value="modalData.stepId"></el-input>
  163. </el-form-item>
  164. </el-form>
  165. <el-form :inline="true" label-width="120px" label-position="top">
  166. <el-form-item label="审批人">
  167. <el-input style="width: 200px;" readonly placeholder="" :value="modalData.userName"></el-input>
  168. </el-form-item>
  169. <el-form-item label="审批时间">
  170. <el-input style="width: 200px;" readonly placeholder=""
  171. :value="modalData.strActAuthorizeDate"></el-input>
  172. </el-form-item>
  173. <el-form-item label="备注">
  174. <el-input type="textarea" :readonly="(modalData.canAuthFlag!=='Y') "
  175. :rows="3"
  176. style="text-align: left;width: 415px;" v-model="modalData.authHistRemark"></el-input>
  177. </el-form-item>
  178. </el-form>
  179. <el-footer style="height:30px;margin-top: 5px;margin-left:-35px;text-align:center">
  180. <el-button type="primary" v-if="( modalData.canAuthFlag === 'Y') "
  181. @click="saveReview(modalData,'Y')">{{'同意'}}
  182. </el-button>
  183. <el-button type="primary" v-if="( modalData.canAuthFlag === 'Y') "
  184. @click="saveReview(modalData ,'N')">{{'不同意'}}
  185. </el-button>
  186. </el-footer>
  187. </div>
  188. </el-col>
  189. </el-row>
  190. </el-dialog>
  191. <!-- chooseList模态框 -->
  192. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  193. </div>
  194. </template>
  195. <script>
  196. import Chooselist from '@/views/modules/common/Chooselist_eam'
  197. import {getSiteAndBuByUserName} from "../../../api/qc/qc";
  198. import DictDataSelect from "../sys/dict-data-select.vue";
  199. import {queryCustomerList} from "@/api/customer/customer";
  200. import {verifyData} from "@/api/part/partInformation";
  201. import {EventBus} from "../../../main";
  202. import {partInformationSearch} from "../../../api/part/partInformation";
  203. import {
  204. searchUserAuthQuoteApplicationInfo
  205. } from "../../../api/quote/quote";
  206. import quotationUpload from "../quote/quotation_upload.vue";
  207. import {updateAuthHist} from "../../../api/auth/auth";
  208. import TpCost from "../quote/detail/tpCost.vue";
  209. import QuoteDetail from "../quote/detail/quoteDetail.vue";
  210. export default {
  211. beforeRouteEnter(to, from, next) {
  212. next((vm) => {
  213. // 跳转后清除 redirectPath
  214. localStorage.removeItem('redirectPath');
  215. console.log('redirectPath 已清除');
  216. });
  217. },
  218. computed: {
  219. // quotationInformationFlag () {
  220. // return (value) => {
  221. // if (!this.plmQuotationInformationArr){
  222. // return 'N'
  223. // }
  224. // let arr = this.plmQuotationInformationArr.filter(a => a.fieldId === value)
  225. // if (arr.length > 0) {
  226. // return arr[0].updateFlag
  227. // }
  228. // return 'N'
  229. // }
  230. // },
  231. },
  232. components: {
  233. QuoteDetail,
  234. TpCost,
  235. quotationUpload,
  236. DictDataSelect,
  237. Chooselist
  238. },
  239. props:{
  240. height:{
  241. type:Number,
  242. default:200
  243. }
  244. },
  245. data() {
  246. return {
  247. userBuList: [],
  248. copyPriceCheckDetail:{},
  249. loading:false,
  250. attributeDialog:true,
  251. activeName: 'quotationInformation',
  252. priceCheckRule: {
  253. associatedPartNo:[{required: true, message: ' ', trigger: 'change'},],
  254. materialRequired:[{required: true, message: ' ', trigger: 'change'},],
  255. yearlyOrMonthlyRequirement:[{required: true, message: ' ', trigger: 'change'},],
  256. runningWidth:[{required: true, message: ' ', trigger: 'change'},],
  257. },
  258. savePriceDetail:{
  259. site:'',
  260. quotationNo:'',
  261. associatedPartNo:'',
  262. materialRequired:'',
  263. yearlyOrMonthlyRequirement:'',
  264. runningWidth:'',
  265. },
  266. priceCheckPropertiesList: [],
  267. // 导出
  268. exportData: [],
  269. exportName: '询价申请' + this.dayjs().format('YYYYMMDDHHmmss'),
  270. exportHeader: ['询价申请'],
  271. exportFooter: [],
  272. resultList: [],
  273. uploadUrl: '/plm/quotationInformation/uploadExcel',
  274. // ======== 行高 ========
  275. secondHeight: 200,
  276. // ======== 分页 ========
  277. pageIndex: 1,
  278. pageSize: 50,
  279. totalPage: 0,
  280. selectedDataNum: 0,
  281. // 条件查询
  282. searchData: {
  283. userId: this.$store.state.user.id,
  284. site: this.$store.state.user.site,
  285. id: '',
  286. customerNo: '',
  287. customerDesc: '',
  288. quoteVersionNo: '',
  289. bu: '',
  290. requestStartDate: '',
  291. requestEndDate: '',
  292. requiredCompletionStartDate: '',
  293. requiredCompletionEndDate: '',
  294. status: '',
  295. quoterName: '',
  296. requesterName: '',
  297. priorityLevel: '',
  298. orderRef1: 'BJ',
  299. page: 1,
  300. limit: 10,
  301. menuId: this.$route.meta.menuId,
  302. },
  303. searchData1: {
  304. userId: this.$store.state.user.id,
  305. site: this.$store.state.user.site,
  306. id: '',
  307. customerNo: '',
  308. customerDesc: '',
  309. quoteVersionNo: '',
  310. bu: '',
  311. requestStartDate: '',
  312. requestEndDate: '',
  313. requiredCompletionStartDate: '',
  314. requiredCompletionEndDate: '',
  315. status: '',
  316. quoterName: '',
  317. requesterName: '',
  318. priorityLevel: '',
  319. orderRef1: 'BJ',
  320. page: 1,
  321. limit: 10,
  322. menuId: this.$route.meta.menuId,
  323. },
  324. // 其它
  325. dataListLoading: false,
  326. // 选择项目弹框开关
  327. chooseProjectListFlag: false,
  328. reviewFlag: false,
  329. // 初始页签
  330. activeTable: 'inquiryAuth',
  331. // ======== 数据对象 ========
  332. modalData: {
  333. flag: '',
  334. title: '',
  335. site: this.$store.state.user.site,
  336. userName: this.$store.state.user.name,
  337. id: '',
  338. quoteVersionNo: '',
  339. customerNo: '',
  340. customerDesc: '',
  341. requestDate: '',
  342. requester: '',
  343. requesterName: '',
  344. customerInquiryNo: '',
  345. priorityLevel: '',
  346. requiredCompletionDate: '',
  347. quoter: '',
  348. quoterName: '',
  349. status: '',
  350. remark: '',
  351. createDate: '',
  352. createBy: '',
  353. updateDate: '',
  354. updateBy: '',
  355. authHistId: '',
  356. approveResult: '',
  357. authHistRemark: '',
  358. canAuthFlag: '',
  359. actAuthorizator: '',
  360. strActAuthorizeDate: this.dayjs().format("YYYY-MM-DD HH:mm:ss"),
  361. actAuthorizeDate: ''
  362. },
  363. inquiryPartItemModalData: {
  364. bu: '',
  365. buDesc: '',
  366. quoteVersionNo: '',
  367. partNo: '',
  368. partDesc: '',
  369. umId: '',
  370. umName: '',
  371. codeNo: '',
  372. codeDesc: '',
  373. textValue: '',
  374. numValue: '',
  375. valueType: '',
  376. valueTypeDb: '',
  377. valueChooseFlag: '',
  378. availableValueList: [],
  379. },
  380. // ======== 数据列表 ========
  381. dataList: [],
  382. inquiryAuthDataList: [],
  383. // ======== 列表表头 ========
  384. columnList: [
  385. {
  386. userId: this.$store.state.user.name,
  387. functionId: 190006,
  388. serialNumber: '190006Table1BuDesc',
  389. tableId: '190006Table1',
  390. tableName: '报价信息表',
  391. columnProp: 'buDesc',
  392. headerAlign: 'center',
  393. align: 'center',
  394. columnLabel: 'BU',
  395. columnHidden: false,
  396. columnImage: false,
  397. columnSortable: false,
  398. sortLv: 0,
  399. status: true,
  400. fixed: '',
  401. columnWidth: 120
  402. },
  403. {
  404. userId: this.$store.state.user.name,
  405. functionId: 190006,
  406. serialNumber: '190006Table1QuoteVersionNo',
  407. tableId: '190006Table1',
  408. tableName: '报价信息表',
  409. columnProp: 'quoteVersionNo',
  410. headerAlign: 'center',
  411. align: 'center',
  412. columnLabel: '报价单号',
  413. columnHidden: false,
  414. columnImage: false,
  415. columnSortable: false,
  416. sortLv: 0,
  417. status: true,
  418. fixed: '',
  419. columnWidth: 180
  420. },
  421. {
  422. userId: this.$store.state.user.name,
  423. functionId: 190006,
  424. serialNumber: '190006Table1QuoteDate',
  425. tableId: '190006Table1',
  426. tableName: '报价信息表',
  427. columnProp: 'quoteDate',
  428. headerAlign: 'center',
  429. align: 'center',
  430. columnLabel: '报价日期',
  431. columnHidden: false,
  432. columnImage: false,
  433. columnSortable: false,
  434. sortLv: 0,
  435. status: true,
  436. fixed: '',
  437. columnWidth: 100
  438. },
  439. {
  440. userId: this.$store.state.user.name,
  441. functionId: 190006,
  442. serialNumber: '190006Table1CustomerNo',
  443. tableId: '190006Table1',
  444. tableName: '报价信息表',
  445. columnProp: 'customerNo',
  446. headerAlign: 'center',
  447. align: 'center',
  448. columnLabel: '客户编码',
  449. columnHidden: false,
  450. columnImage: false,
  451. columnSortable: false,
  452. sortLv: 0,
  453. status: true,
  454. fixed: '',
  455. columnWidth: 120
  456. },
  457. {
  458. userId: this.$store.state.user.name,
  459. functionId: 190006,
  460. serialNumber: '190006Table1CustomerDesc',
  461. tableId: '190006Table1',
  462. tableName: '报价信息表',
  463. columnProp: 'customerDesc',
  464. headerAlign: 'center',
  465. align: 'left',
  466. columnLabel: '客户名称',
  467. columnHidden: false,
  468. columnImage: false,
  469. columnSortable: false,
  470. sortLv: 0,
  471. status: true,
  472. fixed: '',
  473. columnWidth: 120
  474. },
  475. {
  476. userId: this.$store.state.user.name,
  477. functionId: 190006,
  478. serialNumber: '190006Table1QuoterName',
  479. tableId: '190006Table1',
  480. tableName: '报价信息表',
  481. columnProp: 'quoterName',
  482. headerAlign: 'center',
  483. align: 'left',
  484. columnLabel: '报价专员',
  485. columnHidden: false,
  486. columnImage: false,
  487. columnSortable: false,
  488. sortLv: 0,
  489. status: true,
  490. fixed: '',
  491. columnWidth: 120
  492. },
  493. {
  494. userId: this.$store.state.user.name,
  495. functionId: 190006,
  496. serialNumber: '190006Table1PurchaseName',
  497. tableId: '190006Table1',
  498. tableName: '报价信息表',
  499. columnProp: 'purchaseName',
  500. headerAlign: 'center',
  501. align: 'left',
  502. columnLabel: '采购专员',
  503. columnHidden: false,
  504. columnImage: false,
  505. columnSortable: false,
  506. sortLv: 0,
  507. status: true,
  508. fixed: '',
  509. columnWidth: 120
  510. },
  511. {
  512. userId: this.$store.state.user.name,
  513. functionId: 190006,
  514. serialNumber: '190006Table1Currency',
  515. tableId: '190006Table1',
  516. tableName: '报价信息表',
  517. columnProp: 'currency',
  518. headerAlign: 'center',
  519. align: 'center',
  520. columnLabel: '货币',
  521. columnHidden: false,
  522. columnImage: false,
  523. columnSortable: false,
  524. sortLv: 0,
  525. status: true,
  526. fixed: '',
  527. columnWidth: 120
  528. },
  529. {
  530. userId: this.$store.state.user.name,
  531. functionId: 190006,
  532. serialNumber: '190006Table1Status',
  533. tableId: '190006Table1',
  534. tableName: '报价信息表',
  535. columnProp: 'status',
  536. headerAlign: 'center',
  537. align: 'center',
  538. columnLabel: '状态',
  539. columnHidden: false,
  540. columnImage: false,
  541. columnSortable: false,
  542. sortLv: 0,
  543. status: true,
  544. fixed: '',
  545. columnWidth: 120
  546. },
  547. {
  548. userId: this.$store.state.user.name,
  549. functionId: 190006,
  550. serialNumber: '190006Table1CustomerInquiryNo',
  551. tableId: '190006Table1',
  552. tableName: '报价信息表',
  553. columnProp: 'customerInquiryNo',
  554. headerAlign: 'center',
  555. align: 'center',
  556. columnLabel: '客户报价单号',
  557. columnHidden: false,
  558. columnImage: false,
  559. columnSortable: false,
  560. sortLv: 0,
  561. status: true,
  562. fixed: '',
  563. columnWidth: 120
  564. },
  565. {
  566. userId: this.$store.state.user.name,
  567. functionId: 190006,
  568. serialNumber: '190006Table1InsideInquiryNo',
  569. tableId: '190006Table1',
  570. tableName: '报价信息表',
  571. columnProp: 'insideInquiryNo',
  572. headerAlign: 'center',
  573. align: 'center',
  574. columnLabel: '内部询价单号',
  575. columnHidden: false,
  576. columnImage: false,
  577. columnSortable: false,
  578. sortLv: 0,
  579. status: true,
  580. fixed: '',
  581. columnWidth: 120
  582. },
  583. {
  584. userId: this.$store.state.user.name,
  585. functionId: 190006,
  586. serialNumber: '190006Table1Auth',
  587. tableId: '190006Table1',
  588. tableName: '询价产品表',
  589. columnProp: 'auth',
  590. headerAlign: 'center',
  591. align: 'left',
  592. columnLabel: '审批组/人',
  593. columnHidden: false,
  594. columnImage: false,
  595. columnSortable: false,
  596. sortLv: 0,
  597. status: true,
  598. fixed: '',
  599. columnWidth: 120
  600. },
  601. {
  602. userId: this.$store.state.user.name,
  603. functionId: 190006,
  604. serialNumber: '190006Table2StepId',
  605. tableId: '190006Table2',
  606. tableName: '询价产品表',
  607. columnProp: 'stepId',
  608. headerAlign: 'center',
  609. align: 'left',
  610. columnLabel: '审批步骤号',
  611. columnHidden: false,
  612. columnImage: false,
  613. columnSortable: false,
  614. sortLv: 0,
  615. status: true,
  616. fixed: '',
  617. columnWidth: 120
  618. },
  619. {
  620. userId: this.$store.state.user.name,
  621. functionId: 190006,
  622. serialNumber: '190006Table1AuthHistRemark',
  623. tableId: '190006Table1',
  624. tableName: '询价信息表',
  625. columnProp: 'authHistRemark',
  626. headerAlign: 'center',
  627. align: 'left',
  628. columnLabel: '审批备注',
  629. columnHidden: false,
  630. columnImage: false,
  631. columnSortable: false,
  632. sortLv: 0,
  633. status: true,
  634. fixed: '',
  635. columnWidth: 120
  636. },
  637. ],
  638. // ======== 必填规则 ========
  639. rules: {
  640. bu: [
  641. {required: true, message: ' ', trigger: 'change'},
  642. {required: true, message: ' ', trigger: 'blur'},
  643. ],
  644. quoteVersionNo: [
  645. {required: true, message: ' ', trigger: 'change'},
  646. {required: true, message: ' ', trigger: 'blur'},
  647. ],
  648. customerNo: [
  649. {required: true, message: ' ', trigger: 'change'},
  650. {required: true, message: ' ', trigger: 'blur'},
  651. ],
  652. customerDesc: [
  653. {required: true, message: ' ', trigger: 'change'},
  654. {required: true, message: ' ', trigger: 'blur'},
  655. ],
  656. requester: [
  657. {required: true, message: ' ', trigger: 'change'},
  658. {required: true, message: ' ', trigger: 'blur'},
  659. ],
  660. requesterName: [
  661. {required: true, message: ' ', trigger: 'change'},
  662. {required: true, message: ' ', trigger: 'blur'},
  663. ],
  664. quoter: [
  665. {required: true, message: ' ', trigger: 'change'},
  666. {required: true, message: ' ', trigger: 'blur'},
  667. ],
  668. quoterName: [
  669. {required: true, message: ' ', trigger: 'change'},
  670. {required: true, message: ' ', trigger: 'blur'},
  671. ],
  672. priorityLevel: [
  673. {required: true, message: ' ', trigger: 'change'},
  674. ],
  675. requiredCompletionDate: [
  676. {required: true, message: ' ', trigger: 'change'},
  677. {required: true, message: ' ', trigger: 'blur'},
  678. ],
  679. requestDate: [
  680. {required: true, message: ' ', trigger: 'change'},
  681. {required: true, message: ' ', trigger: 'blur'},
  682. ],
  683. },
  684. inquiryPartRules: {
  685. bu: [
  686. {required: true, message: ' ', trigger: 'change'},
  687. {required: true, message: ' ', trigger: 'blur'},
  688. ],
  689. partNo: [
  690. {required: true, message: ' ', trigger: 'change'},
  691. {required: true, message: ' ', trigger: 'blur'},
  692. ],
  693. partDesc: [
  694. {required: true, message: ' ', trigger: 'change'},
  695. {required: true, message: ' ', trigger: 'blur'},
  696. ],
  697. inquiryQty: [
  698. {required: true, message: ' ', trigger: 'change'},
  699. {required: true, message: ' ', trigger: 'blur'},
  700. ],
  701. umId: [
  702. {required: true, message: ' ', trigger: 'change'},
  703. {required: true, message: ' ', trigger: 'blur'},
  704. ],
  705. codeNo: [
  706. {required: true, message: ' ', trigger: 'change'},
  707. {required: true, message: ' ', trigger: 'blur'},
  708. ],
  709. },
  710. // ======== 选中的当前行数据 ========
  711. quoteCurrentRow: {},
  712. // ======== 模态框开关控制 ========
  713. modalFlag: false,
  714. modalDisableFlag: false,
  715. inquiryPartModalFlag: false,
  716. inquiryPartModalDisableFlag: false,
  717. inquiryPartItemModalFlag: false,
  718. }
  719. },
  720. mounted() {
  721. this.$nextTick(() => {
  722. /*第二个表格高度的动态调整*/
  723. this.height = window.innerHeight - 210;
  724. })
  725. },
  726. created() {
  727. this.getSiteAndBuByUserName()
  728. // 获取 URL 查询参数
  729. const {quoteVersionNo} = this.$route.query;
  730. // 将查询参数赋值给 searchData
  731. if (quoteVersionNo){
  732. this.searchData1.quoteVersionNo = this.$route.query.quoteVersionNo;
  733. }
  734. this.getDataList()
  735. },
  736. methods: {
  737. // 获取用户的bu
  738. getSiteAndBuByUserName () {
  739. let tempData = {
  740. username: this.$store.state.user.name,
  741. }
  742. getSiteAndBuByUserName(tempData).then(({data}) => {
  743. if (data.code === 0) {
  744. this.userBuList = data.rows
  745. }
  746. })
  747. },
  748. // ======== 分页相关方法 ========
  749. /**
  750. * 每页数
  751. * @param val
  752. */
  753. sizeChangeHandle(val) {
  754. this.pageSize = val
  755. this.pageIndex = 1
  756. this.getDataList()
  757. },
  758. /**
  759. * 当前页
  760. * @param val
  761. */
  762. currentChangeHandle(val) {
  763. this.pageIndex = val
  764. this.getDataList()
  765. },
  766. // ======== 页签切换相关方法 ========
  767. /**
  768. * 列表表格选择替换
  769. * @param tab
  770. * @param event
  771. */
  772. tabClick(tab, event) {
  773. // 刷新列表数据
  774. this.refreshCurrentTabTable()
  775. },
  776. // ======== 列表操作方法 ========
  777. /**
  778. * 单机选中询价信息
  779. * @param row
  780. */
  781. quoteClickRow(row) {
  782. this.quoteCurrentRow = JSON.parse(JSON.stringify(row))
  783. },
  784. /**
  785. * 当前值发生变化的时候修改
  786. * @param row
  787. * @param oldRow
  788. */
  789. changeCurrentRow(row, oldRow) {
  790. // 判断是否是获取焦点的事件
  791. if (row) {
  792. this.quoteCurrentRow = JSON.parse(JSON.stringify(row))
  793. //刷新当前页表
  794. this.refreshCurrentTabTable()
  795. }
  796. },
  797. /**
  798. * 刷新页签的table数据
  799. */
  800. refreshCurrentTabTable() {
  801. },
  802. // ======== 列表数据刷新方法 ========
  803. /**
  804. * 获取数据列表
  805. */
  806. getDataListAll(){
  807. this.searchData1 = null
  808. this.getDataList()
  809. },
  810. getDataList() {
  811. console.log(this.searchData1)
  812. this.searchData.limit = this.pageSize
  813. this.searchData.page = this.pageIndex
  814. let inData = this.searchData
  815. if (this.searchData1 !== null){
  816. this.searchData1.limit = this.pageSize
  817. this.searchData1.page = this.pageIndex
  818. inData = this.searchData1
  819. }
  820. searchUserAuthQuoteApplicationInfo(inData).then(({data}) => {
  821. if (data.code === 0) {
  822. this.dataList = data.page.list
  823. this.pageIndex = data.page.currPage
  824. this.pageSize = data.page.pageSize
  825. this.totalPage = data.page.totalCount
  826. this.dataList.forEach(item => {
  827. if (item.groupDesc === '' || item.groupDesc === null) {
  828. item.auth = item.userDisplay
  829. } else {
  830. item.auth = item.groupDesc
  831. }
  832. })
  833. //判断是否全部存在数据
  834. if (this.totalPage > 0) {
  835. //设置选中行
  836. this.$refs.mainTable.setCurrentRow(this.dataList[0])
  837. this.refreshCurrentTabTable() //加载当前的页签的table
  838. this.quoteClickRow(this.dataList[0])
  839. }
  840. }
  841. this.dataListLoading = false
  842. })
  843. },
  844. // /**
  845. // * 获得这些询价号的全部附件
  846. // */
  847. // getFileContentList () {
  848. // let currentData = {
  849. // orderRef1: this.$store.state.user.site,
  850. // orderRef2: this.enterResultData.quotationNo
  851. // }
  852. // getFileContentList(currentData).then(({data}) => {
  853. // if (data && data.code === 0) {
  854. // this.enterResultData.fileContentList = data.rows
  855. // } else {
  856. // this.enterResultData.fileContentList = []
  857. // }
  858. // })
  859. // },
  860. // ======== chooseList相关方法 ========
  861. /**
  862. * 获取基础数据列表S
  863. * @param val
  864. * @param type
  865. */
  866. getBaseList(val, type) {
  867. this.tagNo = val
  868. this.tagNo1 = type
  869. this.$nextTick(() => {
  870. let strVal = ''
  871. let conSql = ''
  872. if (val === 509) {
  873. if (type === 1) {
  874. strVal = this.modalData.customerNo ? this.modalData.customerNo : ''
  875. }
  876. if (type === 2) {
  877. strVal = this.searchData.customerNo ? this.searchData.customerNo : ''
  878. }
  879. }
  880. if (val === 2002) {
  881. if (type === 1) {
  882. strVal = this.searchData.quoterName ? this.searchData.quoterName : ''
  883. conSql = " and b.site = '" + this.$store.state.user.site + "'"
  884. }
  885. if (type === 2) {
  886. strVal = this.modalData.quoterName ? this.modalData.quoterName : ''
  887. conSql = " and b.site = '" + this.$store.state.user.site + "'"
  888. }
  889. }
  890. if (val === 2008) {
  891. if (type === 1) {
  892. strVal = this.searchData.requesterName ? this.searchData.requesterName : ''
  893. conSql = " and b.site = '" + this.$store.state.user.site + "'"
  894. }
  895. if (type === 2) {
  896. strVal = this.modalData.requesterName ? this.modalData.requesterName : ''
  897. conSql = " and b.site = '" + this.$store.state.user.site + "'"
  898. }
  899. }
  900. this.$refs.baseList.init(val, strVal, conSql)
  901. })
  902. },
  903. /**
  904. * 列表方法的回调
  905. * @param val
  906. */
  907. getBaseData(val) {
  908. if (this.tagNo === 509) {
  909. if (this.tagNo1 === 1) {
  910. if (val.customer_no === this.modalData.customerNo) {
  911. return
  912. }
  913. this.modalData.customerNo = val.customer_no
  914. this.modalData.customerDesc = val.customer_desc
  915. }
  916. if (this.tagNo1 === 2) {
  917. if (val.customer_no === this.searchData.customerNo) {
  918. return
  919. }
  920. this.searchData.customerNo = val.customer_no
  921. }
  922. }
  923. if (this.tagNo === 2002) {
  924. if (this.tagNo1 === 1) {
  925. this.searchData.quoter = val.username
  926. this.searchData.quoterName = val.user_display
  927. }
  928. if (this.tagNo1 === 2) {
  929. this.modalData.quoter = val.username
  930. this.modalData.quoterName = val.user_display
  931. }
  932. }
  933. if (this.tagNo === 2008) {
  934. if (this.tagNo1 === 1) {
  935. this.searchData.requester = val.username
  936. this.searchData.requesterName = val.user_display
  937. }
  938. if (this.tagNo1 === 2) {
  939. this.modalData.requester = val.username
  940. this.modalData.requesterName = val.user_display
  941. }
  942. }
  943. },
  944. updateModal(row) {
  945. this.modalData = JSON.parse(JSON.stringify(row))
  946. this.modalData.strActAuthorizeDate = this.dayjs().format("YYYY-MM-DD HH:mm:ss")
  947. this.modalData.userName = this.$store.state.user.name
  948. this.reviewFlag = true
  949. },
  950. saveReview(row, val) {
  951. if (row.authHistRemark == '') {
  952. this.$alert(data.msg, '操作提示', {
  953. confirmButtonText: '确定',
  954. callback: action => {
  955. this.saveButton = false
  956. }
  957. });
  958. }
  959. this.modalData.id = row.authHistId
  960. this.modalData.actAuthorizator = row.userName
  961. this.modalData.remark = row.authHistRemark
  962. this.modalData.actAuthorizeDate = row.strActAuthorizeDate
  963. this.modalData.orderRef1 = row.quoteVersionNo
  964. if (val === "Y") {
  965. if (row.lastStepFlag === 'Y') {
  966. this.modalData.approveResult = "已审批"
  967. } else {
  968. this.modalData.approveResult = "已审批"
  969. }
  970. } else if (val === "N") {
  971. this.modalData.approveResult = "未通过"
  972. }
  973. updateAuthHist(this.modalData).then(({data}) => {
  974. if (data && data.code === 0) {
  975. this.getDataList()
  976. this.reviewFlag = false
  977. this.$message({
  978. message: '操作成功',
  979. type: 'success',
  980. duration: 1500,
  981. onClose: () => {}
  982. })
  983. } else {
  984. this.$alert(data.msg, '错误', {
  985. confirmButtonText: '确定'
  986. })
  987. }
  988. })
  989. },
  990. // ======== 导出相关方法 ========
  991. /**
  992. * 导出excel
  993. */
  994. async createExportData() {
  995. this.searchData.limit = -1
  996. this.searchData.page = 1
  997. await searchUserAuthQuoteApplicationInfo(this.searchData).then(({data}) => {
  998. this.resultList = data.page.list
  999. })
  1000. return this.resultList
  1001. },
  1002. startDownload() {
  1003. },
  1004. finishDownload() {
  1005. },
  1006. fields() {
  1007. let json = '{'
  1008. this.columnList.forEach((item, index) => {
  1009. if (index == this.columnList.length - 1) {
  1010. json += '"' + item.columnLabel + '"' + ':' + '"' + item.columnProp + '"'
  1011. } else {
  1012. json += '"' + item.columnLabel + '"' + ':' + '"' + item.columnProp + '"' + ','
  1013. }
  1014. })
  1015. json += '}'
  1016. let s = eval('(' + json + ')')
  1017. return s
  1018. },
  1019. // ======== 导入相关方法 ========
  1020. handleImportQuotation() {
  1021. let currentData = {
  1022. createBy: this.$store.state.user.name,
  1023. site: this.$store.state.user.site,
  1024. }
  1025. //打开组件 去做新增业务
  1026. this.$nextTick(() => {
  1027. this.$refs.quotationUpload.init(currentData)
  1028. })
  1029. },
  1030. // openSaveDataDialog(){
  1031. // if (this.modalData.title === '询价新增') {
  1032. // let rfqNos = [];
  1033. // this.dataList.forEach((item) => {
  1034. // // 如果item.rfqNo为XJ开头
  1035. // if (item.quoteVersionNo.startsWith('XJ')) {
  1036. // // 解析数字部分
  1037. // const numPart = parseInt(item.quoteVersionNo.replace('XJ', ''), 10);
  1038. // if (!isNaN(numPart)) {
  1039. // rfqNos.push(numPart);
  1040. // }
  1041. // }
  1042. // });
  1043. // if (rfqNos.length === 0) {
  1044. // // 如果没有XJ开头的rfqNo
  1045. // this.modalData.quoteVersionNo = 'XJ00000001';
  1046. // } else {
  1047. // // 取到最大的XJ开头的rfqNo
  1048. // let maxRfqNo = Math.max(...rfqNos);
  1049. //
  1050. // // 生成新的rfqNo,确保有9位数,前面补零
  1051. // maxRfqNo += 1; // 增加最大值
  1052. // this.modalData.quoteVersionNo = 'XJ' + String(maxRfqNo).padStart(8, '0');
  1053. // }
  1054. // }
  1055. // },
  1056. // 保存弹框关闭事件
  1057. closeSaveDataDialog() {
  1058. this.modalData = {
  1059. flag: '',
  1060. title: '',
  1061. site: '',
  1062. bu: '',
  1063. buNo: '',
  1064. buDesc: '',
  1065. id: '',
  1066. quoteVersionNo: '',
  1067. customerNo: '',
  1068. customerDesc: '',
  1069. requester:'',
  1070. requesterName: '',
  1071. quoter: '',
  1072. quoterName: '',
  1073. customerInquiryNo: '',
  1074. status: '',
  1075. priorityLevel: '',
  1076. requestDate: '',
  1077. requiredCompletionDate: '',
  1078. remark: '',
  1079. }
  1080. this.modalFlag = false
  1081. },
  1082. rowStyle({row}) {
  1083. if (this.quoteCurrentRow.id === row.id) {
  1084. return {'background-color': '#E8F7F6', cursor: 'pointer'};
  1085. }
  1086. },
  1087. },
  1088. }
  1089. </script>
  1090. <style scoped>
  1091. /deep/ .customer-tab .el-tabs__content {
  1092. padding: 0px !important;
  1093. height: 100%;
  1094. }
  1095. /deep/ .el-checkbox__input.is-disabled.is-checked .el-checkbox__inner {
  1096. background-color: #17B3A3;
  1097. border-color: #17B3A3;
  1098. }
  1099. /deep/ .el-checkbox__input.is-disabled.is-checked .el-checkbox__inner::after {
  1100. border-color: #FFF
  1101. }
  1102. /deep/ .el-form-item--medium .el-form-item__content{
  1103. height: auto;
  1104. }
  1105. .el-input-number /deep/ .el-input__inner {
  1106. text-align: right;
  1107. padding-right: 5px !important;
  1108. }
  1109. /deep/ .el-input .el-input--medium{
  1110. line-height: 20px;
  1111. }
  1112. /deep/ .el-input-number .el-input--medium{
  1113. line-height: 20px;
  1114. }
  1115. /*table中input 修改样式*/
  1116. /deep/ div.table-el-date {
  1117. padding: 0px 0px;
  1118. height: 25px !important;
  1119. }
  1120. /*table中input*/
  1121. div.table-el-date /deep/ input.el-input__inner{
  1122. padding: 0px 0px;
  1123. height: 23px !important;
  1124. text-align: right;
  1125. }
  1126. /* 特殊的样式*/
  1127. /deep/ .el-table div.cell:has(.table-el-date) {
  1128. /* 直接作用于 <td> 元素 */
  1129. padding: 0px;
  1130. height: 25px;
  1131. }
  1132. .el-transfer-panel {
  1133. border: 2px solid #17b3a3;
  1134. border-radius: 4px;
  1135. overflow: hidden;
  1136. background: #fff;
  1137. display: inline-block;
  1138. vertical-align: middle;
  1139. width: 200px;
  1140. max-height: 100%;
  1141. -webkit-box-sizing: border-box;
  1142. box-sizing: border-box;
  1143. position: relative;
  1144. }
  1145. .el-transfer-panel .el-transfer-panel__header {
  1146. height: 40px;
  1147. line-height: 40px;
  1148. background: #17b3a3;
  1149. margin: 0;
  1150. padding-left: 15px;
  1151. border-bottom: 1px solid #17b3a3;
  1152. -webkit-box-sizing: border-box;
  1153. box-sizing: border-box;
  1154. color: #000;
  1155. }
  1156. .el-transfer-panel .el-transfer-panel__header .el-checkbox .el-checkbox__label {
  1157. font-size: 14px;
  1158. color: #303133;
  1159. font-weight: 400;
  1160. }
  1161. </style>