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.

586 lines
19 KiB

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