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.

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