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.

641 lines
21 KiB

1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
1 year ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. <template>
  2. <div>
  3. <el-form label-position="top" :inline="true" :model="searchData" @keyup.enter.native="getDataList">
  4. <div>
  5. <el-form-item label="申请批次号">
  6. <el-input v-model="searchData.quotationBatchNo" style="width: 120px" clearable></el-input>
  7. </el-form-item>
  8. <el-form-item label="客户编码">
  9. <el-input v-model="searchData.customerNo" style="width: 120px" clearable></el-input>
  10. </el-form-item>
  11. <el-form-item label="客户名称">
  12. <el-input v-model="searchData.customerDesc" style="width: 120px" clearable></el-input>
  13. </el-form-item>
  14. <el-form-item label="跟单员" v-if="defaultFlag">
  15. <el-input v-model="searchData.trackerName" style="width: 120px" clearable></el-input>
  16. </el-form-item>
  17. <el-form-item label="物料编码">
  18. <el-input v-model="searchData.testPartNo" style="width: 120px" clearable></el-input>
  19. </el-form-item>
  20. <el-form-item label="物料名称">
  21. <el-input v-model="searchData.partName" style="width: 120px" clearable></el-input>
  22. </el-form-item>
  23. <el-form-item label="要求完成日期" v-if="defaultFlag">
  24. <el-date-picker
  25. value-format="yyyy-MM-dd"
  26. style="width: 120px"
  27. v-model="searchData.startDate"
  28. type="date"
  29. placeholder=" ">
  30. </el-date-picker>
  31. </el-form-item>
  32. <el-form-item label=" " v-if="defaultFlag">
  33. <div style="text-align: center;"><i class="el-icon-right"></i></div>
  34. </el-form-item>
  35. <el-form-item label=" " v-if="defaultFlag">
  36. <el-date-picker
  37. value-format="yyyy-MM-dd"
  38. style="width: 120px"
  39. v-model="searchData.endDate"
  40. type="date"
  41. placeholder=" ">
  42. </el-date-picker>
  43. </el-form-item>
  44. </div>
  45. <el-form-item label="批次序号" v-if="defaultFlag">
  46. <el-input v-model="searchData.quotationItemNo" style="width: 120px" clearable ></el-input>
  47. </el-form-item>
  48. <el-form-item label="项目编码">
  49. <el-input v-model="searchData.projectId" style="width: 120px" clearable></el-input>
  50. </el-form-item>
  51. <el-form-item label="项目名称">
  52. <el-input v-model="searchData.projectName" style="width: 120px" clearable></el-input>
  53. </el-form-item>
  54. <el-form-item label="报价专员">
  55. <el-input v-model="searchData.quoterName" style="width: 120px" clearable></el-input>
  56. </el-form-item>
  57. <el-form-item label="IFS物料编码">
  58. <el-input v-model="searchData.finalPartNo" style="width: 120px" clearable></el-input>
  59. </el-form-item>
  60. <el-form-item label="客户物料编码">
  61. <el-input v-model="searchData.customerPartNo" style="width: 120px" clearable></el-input>
  62. </el-form-item>
  63. <el-form-item label="优先等级" v-if="defaultFlag">
  64. <el-select v-model="searchData.priorityLevel" style="width: 120px">
  65. <el-option label="全部" value=""></el-option>
  66. <el-option label="紧急" value="紧急"></el-option>
  67. <el-option label="一般" value="一般"></el-option>
  68. <el-option label="不紧急" value="不紧急"></el-option>
  69. </el-select>
  70. </el-form-item>
  71. <!-- <el-form-item :label="'状态'">-->
  72. <!-- <el-select v-model="searchData.quotationResultStatus" style="width: 120px">-->
  73. <!-- <el-option label="全部" value=""></el-option>-->
  74. <!-- <el-option label="已下达" value="C"></el-option>-->
  75. <!-- <el-option label="已完成报价" value="E"></el-option>-->
  76. <!-- <el-option label="已提交报价" value="S"></el-option>-->
  77. <!-- <el-option label="客户已反馈" value="R"></el-option>-->
  78. <!-- </el-select>-->
  79. <!-- </el-form-item>-->
  80. <el-form-item :label="'状态'">
  81. <el-select v-model="searchData.quotationStatus" style="width: 120px">
  82. <el-option label="全部" value=""></el-option>
  83. <el-option label="草稿" value="草稿"></el-option>
  84. <el-option label="审批中" value="审批中"></el-option>
  85. <el-option label="已完成" value="已完成"></el-option>
  86. </el-select>
  87. </el-form-item>
  88. <el-form-item label=" ">
  89. <el-button type="primary" @click="getDataList"> </el-button>
  90. <el-button type="primary" :loading="saveBatchQuotationLoading" @click="batchQuotation" v-if="defaultFlag"> </el-button>
  91. </el-form-item>
  92. </el-form>
  93. <!-- 报价列表 -->
  94. <el-table
  95. :height="defaultFlag?'76vh':300"
  96. :data="dataList"
  97. border
  98. v-loading="dataListLoading"
  99. row-key='quotationNo'
  100. element-loading-text = "数据正在加载中"
  101. element-loading-spinner = "el-icon-loading"
  102. @row-click="quotationClickRow"
  103. @selection-change="selectionQuotation"
  104. ref="quotationTable"
  105. style="width: 100%;">
  106. <el-table-column
  107. type="selection"
  108. header-align="center"
  109. reserve-selection
  110. align="center"
  111. width="50">
  112. </el-table-column>
  113. <el-table-column
  114. header-align="center"
  115. align="center" label="状态" prop="quotationStatus"
  116. width="80">
  117. <!-- <template slot-scope="scope">-->
  118. <!-- <span v-show="scope.row.quotationResultStatus === 'C'">已下达</span>-->
  119. <!-- <span v-show="scope.row.quotationResultStatus === 'E'">已完成报价</span>-->
  120. <!-- <span v-show="scope.row.quotationResultStatus === 'S'">已提交报价</span>-->
  121. <!-- <span v-show="scope.row.quotationResultStatus === 'R'">客户已反馈</span>-->
  122. <!-- </template>-->
  123. </el-table-column>
  124. <template v-for="(item,index) in columnList">
  125. <el-table-column
  126. :key="index"
  127. :sortable="item.columnSortable"
  128. :prop="item.columnProp"
  129. :header-align="item.headerAlign"
  130. :show-overflow-tooltip="item.showOverflowTooltip"
  131. :align="item.align"
  132. :fixed="item.fixed === ''?false:item.fixed"
  133. :min-width="item.columnWidth"
  134. :label="item.columnLabel">
  135. <template slot-scope="scope">
  136. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  137. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  138. </template>
  139. </el-table-column>
  140. </template>
  141. </el-table>
  142. <selectDiv ref="selectDiv"></selectDiv>
  143. <!-- 分页插件 -->
  144. <el-pagination style="margin-top: 0px"
  145. @size-change="sizeChangeHandle"
  146. @current-change="currentChangeHandle"
  147. :current-page="pageIndex"
  148. :page-sizes="[20,50, 100, 200, 500]"
  149. :page-size="pageSize"
  150. :total="totalPage"
  151. layout="total, sizes, prev, pager, next, jumper">
  152. </el-pagination>
  153. </div>
  154. </template>
  155. <script>
  156. import {
  157. quotationInformationSearch, // 询价信息列表查询
  158. } from '@/api/quotation/quotationInformation.js'
  159. import {
  160. saveBatchQuotationHeader,//批量报价
  161. } from '@/api/quotation/quotationHeader.js';
  162. export default {
  163. name:"toBeQuoted",
  164. props:{
  165. defaultFlag:{
  166. type:Boolean,
  167. default:true,
  168. },
  169. quotationNo:{
  170. type:String,
  171. default: "",
  172. }
  173. },
  174. data(){
  175. return{
  176. // 查询条件
  177. searchData:{
  178. site: this.$store.state.user.site,
  179. quotationBatchNo: '',
  180. quotationItemNo: '',
  181. customerNo: '',
  182. customerDesc: '',
  183. trackerName: '',
  184. testPartNo: '',
  185. partName: '',
  186. quotationStatus: '审批中',
  187. quotationResultStatus: '',
  188. startDate: '',
  189. endDate: '',
  190. projectId: '',
  191. projectName: '',
  192. quoterName: '',
  193. priorityLevel: '',
  194. customerPartNo: '',
  195. finalPartNo: '',
  196. limit:1,
  197. page:0,
  198. },
  199. // 分页
  200. pageIndex: 1,//当前页码
  201. pageSize:20,//每页条数
  202. totalPage:0,//总条数
  203. // 表格数据
  204. dataList:[],//表格数据
  205. quotationSelections:[],//表格选中数据
  206. // 表格刷新
  207. dataListLoading:false,
  208. // 按钮状态
  209. saveBatchQuotationLoading:false,
  210. // ======== 列表表头 ========
  211. columnList: [
  212. {
  213. userId: this.$store.state.user.name,
  214. functionId: 102001,
  215. serialNumber: '102001Table1QuotationNo',
  216. tableId: '102001Table1',
  217. tableName: '报价信息表',
  218. columnProp: 'quotationNo',
  219. headerAlign: 'center',
  220. align: 'center',
  221. columnLabel: '申请单号',
  222. columnHidden: false,
  223. columnImage: false,
  224. columnSortable: false,
  225. sortLv: 0,
  226. status: true,
  227. fixed: false,
  228. columnWidth: 120
  229. },{
  230. userId: this.$store.state.user.name,
  231. functionId: 102001,
  232. serialNumber: '102001Table1QuotationBatchNo',
  233. tableId: '102001Table1',
  234. tableName: '询价信息表',
  235. columnProp: 'quotationBatchNo',
  236. headerAlign: 'center',
  237. align: 'center',
  238. columnLabel: '申请批次号',
  239. columnHidden: false,
  240. columnImage: false,
  241. columnSortable: false,
  242. sortLv: 0,
  243. status: true,
  244. fixed: '',
  245. columnWidth: 120
  246. },{
  247. userId: this.$store.state.user.name,
  248. functionId: 102001,
  249. serialNumber: '102001Table1QuotationItemNo',
  250. tableId: '102001Table1',
  251. tableName: '询价信息表',
  252. columnProp: 'quotationItemNo',
  253. headerAlign: 'center',
  254. align: 'right',
  255. columnLabel: '序号',
  256. columnHidden: false,
  257. columnImage: false,
  258. columnSortable: false,
  259. sortLv: 0,
  260. status: true,
  261. fixed: '',
  262. columnWidth: 60
  263. },
  264. {
  265. userId: this.$store.state.user.name,
  266. functionId: 102001,
  267. serialNumber: '102001Table1CustomerNo',
  268. tableId: '102001Table1',
  269. tableName: '报价信息表',
  270. columnProp: 'customerNo',
  271. headerAlign: 'center',
  272. align: 'center',
  273. columnLabel: '客户编码',
  274. columnHidden: false,
  275. columnImage: false,
  276. columnSortable: false,
  277. sortLv: 0,
  278. status: true,
  279. fixed: '',
  280. columnWidth: 100
  281. },
  282. {
  283. userId: this.$store.state.user.name,
  284. functionId: 102001,
  285. serialNumber: '102001Table1CustomerDesc',
  286. tableId: '102001Table1',
  287. tableName: '报价信息表',
  288. columnProp: 'customerDesc',
  289. headerAlign: 'center',
  290. align: 'left',
  291. columnLabel: '客户名称',
  292. columnHidden: false,
  293. columnImage: false,
  294. columnSortable: false,
  295. sortLv: 0,
  296. status: true,
  297. fixed: '',
  298. columnWidth: 120
  299. },
  300. {
  301. userId: this.$store.state.user.name,
  302. functionId: 102001,
  303. serialNumber: '102001Table1ProjectId',
  304. tableId: '102001Table1',
  305. tableName: '报价信息表',
  306. columnProp: 'projectId',
  307. headerAlign: 'center',
  308. align: 'center',
  309. columnLabel: '项目编码',
  310. columnHidden: false,
  311. columnImage: false,
  312. columnSortable: false,
  313. sortLv: 0,
  314. status: true,
  315. fixed: '',
  316. columnWidth: 120
  317. },
  318. {
  319. userId: this.$store.state.user.name,
  320. functionId: 102001,
  321. serialNumber: '102001Table1ProjectName',
  322. tableId: '102001Table1',
  323. tableName: '报价信息表',
  324. columnProp: 'projectName',
  325. headerAlign: 'center',
  326. align: 'left',
  327. columnLabel: '项目名称',
  328. columnHidden: false,
  329. columnImage: false,
  330. columnSortable: false,
  331. sortLv: 0,
  332. status: true,
  333. fixed: '',
  334. columnWidth: 120
  335. },
  336. {
  337. userId: this.$store.state.user.name,
  338. functionId: 102001,
  339. serialNumber: '102001Table1TestPartNo',
  340. tableId: '102001Table1',
  341. tableName: '报价信息表',
  342. columnProp: 'testPartNo',
  343. headerAlign: 'center',
  344. align: 'center',
  345. columnLabel: '物料编码',
  346. columnHidden: false,
  347. columnImage: false,
  348. columnSortable: false,
  349. sortLv: 0,
  350. status: true,
  351. fixed: '',
  352. columnWidth: 160
  353. },
  354. {
  355. userId: this.$store.state.user.name,
  356. functionId: 102001,
  357. serialNumber: '102001Table1PartName',
  358. tableId: '102001Table1',
  359. tableName: '报价信息表',
  360. columnProp: 'partName',
  361. headerAlign: 'center',
  362. align: 'left',
  363. columnLabel: '物料名称',
  364. columnHidden: false,
  365. columnImage: false,
  366. columnSortable: false,
  367. sortLv: 0,
  368. status: true,
  369. fixed: '',
  370. columnWidth: 100
  371. },
  372. {
  373. userId: this.$store.state.user.name,
  374. functionId: 102001,
  375. serialNumber: '102001Table1FinalPartNo',
  376. tableId: '102001Table1',
  377. tableName: '报价信息表',
  378. columnProp: 'finalPartNo',
  379. headerAlign: 'center',
  380. align: 'left',
  381. columnLabel: 'IFS物料编码',
  382. columnHidden: false,
  383. columnImage: false,
  384. columnSortable: false,
  385. sortLv: 0,
  386. status: true,
  387. fixed: '',
  388. columnWidth: 100
  389. },
  390. {
  391. userId: this.$store.state.user.name,
  392. functionId: 102001,
  393. serialNumber: '102001Table1CustomerPartNo',
  394. tableId: '102001Table1',
  395. tableName: '报价信息表',
  396. columnProp: 'customerPartNo',
  397. headerAlign: 'center',
  398. align: 'left',
  399. columnLabel: '客户物料编码',
  400. columnHidden: false,
  401. columnImage: false,
  402. columnSortable: false,
  403. sortLv: 0,
  404. status: true,
  405. fixed: '',
  406. columnWidth: 100
  407. },
  408. {
  409. userId: this.$store.state.user.name,
  410. functionId: 102001,
  411. serialNumber: '102001Table1TrackerName',
  412. tableId: '102001Table1',
  413. tableName: '报价信息表',
  414. columnProp: 'trackerName',
  415. headerAlign: 'center',
  416. align: 'left',
  417. columnLabel: '采购专员',
  418. columnHidden: false,
  419. columnImage: false,
  420. columnSortable: false,
  421. sortLv: 0,
  422. status: true,
  423. fixed: '',
  424. columnWidth: 80
  425. },
  426. {
  427. userId: this.$store.state.user.name,
  428. functionId: 102001,
  429. serialNumber: '102001Table1QuoterName',
  430. tableId: '102001Table1',
  431. tableName: '报价信息表',
  432. columnProp: 'quoterName',
  433. headerAlign: 'center',
  434. align: 'left',
  435. columnLabel: '报价专员',
  436. columnHidden: false,
  437. columnImage: false,
  438. columnSortable: false,
  439. sortLv: 0,
  440. status: true,
  441. fixed: '',
  442. columnWidth: 80
  443. },
  444. {
  445. userId: this.$store.state.user.name,
  446. functionId: 102001,
  447. serialNumber: '102001Table1PriorityLevel',
  448. tableId: '102001Table1',
  449. tableName: '报价信息表',
  450. columnProp: 'priorityLevel',
  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: 80
  461. },
  462. {
  463. userId: this.$store.state.user.name,
  464. functionId: 102001,
  465. serialNumber: '102001Table1RequiredCompletionDate',
  466. tableId: '102001Table1',
  467. tableName: '报价信息表',
  468. columnProp: 'requiredCompletionDate',
  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: 160
  479. },
  480. {
  481. userId: this.$store.state.user.name,
  482. functionId: 102001,
  483. serialNumber: '102001Table1CreateDate',
  484. tableId: '102001Table1',
  485. tableName: '报价信息表',
  486. columnProp: 'createDate',
  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: 160
  497. },
  498. {
  499. userId: this.$store.state.user.name,
  500. functionId: 102001,
  501. serialNumber: '102001Table1CreateBy',
  502. tableId: '102001Table1',
  503. tableName: '报价信息表',
  504. columnProp: 'createBy',
  505. headerAlign: 'center',
  506. align: 'left',
  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. }
  518. },
  519. created() {
  520. this.getDataList();
  521. },
  522. methods:{
  523. // 搜索条件中的时间输入框 change事件
  524. changeDateRange(){
  525. if (this.searchData.dateValue){
  526. this.searchData.startDate = this.searchData.dateValue[0];
  527. this.searchData.endDate = this.searchData.dateValue[1];
  528. }else {
  529. this.searchData.startDate="";
  530. this.searchData.endDate="";
  531. }
  532. },
  533. /**
  534. * 获取数据列表
  535. */
  536. getDataList () {
  537. this.searchData.limit = this.pageSize
  538. this.searchData.page = this.pageIndex
  539. let params = {
  540. ...this.searchData,
  541. createBy:this.$store.state.user.name
  542. }
  543. if (!this.defaultFlag){
  544. params.quotationNo = this.quotationNo === ""?"*":this.quotationNo;
  545. }
  546. this.dataListLoading = true;
  547. quotationInformationSearch(params).then(({data}) => {
  548. if (data.code === 0) {
  549. this.dataList = data.page.list
  550. this.pageIndex = data.page.currPage
  551. this.pageSize = data.page.pageSize
  552. this.totalPage = data.page.totalCount
  553. this.$refs.selectDiv.setLengthAll(this.dataList.length)
  554. }
  555. this.dataListLoading = false;
  556. })
  557. },
  558. sizeChangeHandle (val) {
  559. this.pageSize = val
  560. this.pageIndex = 1
  561. this.getDataList()
  562. },
  563. currentChangeHandle (val) {
  564. this.pageIndex = val
  565. this.getDataList()
  566. },
  567. // 表格单击事件
  568. quotationClickRow (row) {
  569. this.$refs.quotationTable.toggleRowSelection(row)
  570. },
  571. selectionQuotation (val) {
  572. this.quotationSelections = val
  573. this.$refs.selectDiv.setLengthselected(this.quotationSelections.length)
  574. },
  575. // 报价
  576. batchQuotation(){
  577. if (this.quotationSelections.length === 0){
  578. this.$message.warning("请选择需报价的单号")
  579. return
  580. }
  581. this.quotationSelections = this.quotationSelections.map(item=>{
  582. item.createBy = this.$store.state.user.id
  583. item.site = this.$store.state.user.site
  584. return item;
  585. })
  586. this.saveBatchQuotationHeader(this.quotationSelections);
  587. },
  588. // 批量新增报价信息
  589. saveBatchQuotationHeader(list){
  590. this.saveBatchQuotationLoading = true;
  591. saveBatchQuotationHeader(list).then(({data})=>{
  592. this.saveBatchQuotationLoading = false;
  593. if (data.code === 200){
  594. this.$message.success(data.msg);
  595. this.$refs.quotationTable.clearSelection();
  596. this.$router.push({name:"quotation-sellForQuotation",params:{ids:data.data},})
  597. }else {
  598. this.$message.error(data.msg);
  599. }
  600. }).catch((error)=>{
  601. this.saveBatchQuotationLoading = false;
  602. })
  603. },
  604. },
  605. mounted() {
  606. },
  607. watch:{
  608. "searchData.quotationBatchNo"(newVal,oldVal){
  609. this.searchData.quotationBatchNo = newVal.toUpperCase();
  610. },
  611. "searchData.customerNo"(newVal,oldVal){
  612. this.searchData.customerNo = newVal.toUpperCase();
  613. },
  614. "searchData.projectId"(newVal,oldVal){
  615. this.searchData.projectId = newVal.toUpperCase();
  616. }
  617. }
  618. }
  619. </script>
  620. <style scoped>
  621. /deep/ .el-range-editor--mini.el-input__inner {
  622. height: 20px;
  623. }
  624. /deep/ .el-range-editor.el-input__inner{
  625. padding: 0px 10px;
  626. }
  627. /deep/ .el-date-editor .el-range-separator{
  628. width: auto;
  629. }
  630. /deep/ .el-input--mini .el-input__icon{
  631. line-height: 20px;
  632. }
  633. </style>