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.

475 lines
14 KiB

1 year ago
  1. <script>
  2. import {querySalesQuoteByPage} from "../../../api/quote/salesQuote";
  3. export default {
  4. name: "salesQuote",
  5. props: {
  6. queryStyle: {
  7. type: Object,
  8. default: () => ({
  9. width: "1200px",
  10. })
  11. },
  12. height: {
  13. type: [String, Number],
  14. default: "80vh"
  15. },
  16. currentRow:{
  17. type: Object,
  18. default: () => ({
  19. id: "",
  20. })
  21. }
  22. },
  23. data() {
  24. return {
  25. queryLoading: false,
  26. dataList: [],
  27. querySalesQuote: {
  28. site: "",
  29. customerNo: "",
  30. customerDesc: "",
  31. projectId: "",
  32. projectDesc: "",
  33. status: "",
  34. quoterName: "",
  35. trackerName: "",
  36. quotationNo: "",
  37. startDate: "",
  38. endDate: "",
  39. customerInquiryNo: "",
  40. internalInquiryNo: "",
  41. },
  42. no: 1,
  43. size: 20,
  44. total: 0,
  45. columns: [
  46. {
  47. userId: this.$store.state.user.name,
  48. functionId: 102003,
  49. serialNumber: '102003Table1QuoteVersionNo',
  50. tableId: '102003Table1',
  51. tableName: '报价信息表',
  52. columnProp: 'quoteVersionNo',
  53. headerAlign: 'center',
  54. align: 'center',
  55. columnLabel: '报价单号',
  56. columnHidden: false,
  57. columnImage: false,
  58. columnSortable: false,
  59. sortLv: 0,
  60. status: true,
  61. fixed: '',
  62. columnWidth: 140
  63. },
  64. {
  65. userId: this.$store.state.user.name,
  66. functionId: 102003,
  67. serialNumber: '102003Table1QuotationDate',
  68. tableId: '102003Table1',
  69. tableName: '报价信息表',
  70. columnProp: 'quotationDate',
  71. headerAlign: 'center',
  72. align: 'center',
  73. columnLabel: '报价日期',
  74. columnHidden: false,
  75. columnImage: false,
  76. columnSortable: false,
  77. sortLv: 0,
  78. status: true,
  79. fixed: '',
  80. columnWidth: 100
  81. },
  82. {
  83. userId: this.$store.state.user.name,
  84. functionId: 102003,
  85. serialNumber: '102003Table1CustomerNo',
  86. tableId: '102003Table1',
  87. tableName: '报价信息表',
  88. columnProp: 'customerNo',
  89. headerAlign: 'center',
  90. align: 'center',
  91. columnLabel: '客户编码',
  92. columnHidden: false,
  93. columnImage: false,
  94. columnSortable: false,
  95. sortLv: 0,
  96. status: true,
  97. fixed: '',
  98. columnWidth: 120
  99. },
  100. {
  101. userId: this.$store.state.user.name,
  102. functionId: 102003,
  103. serialNumber: '102003Table1CustomerName',
  104. tableId: '102003Table1',
  105. tableName: '报价信息表',
  106. columnProp: 'customerDesc',
  107. headerAlign: 'center',
  108. align: 'left',
  109. columnLabel: '客户名称',
  110. columnHidden: false,
  111. columnImage: false,
  112. columnSortable: false,
  113. sortLv: 0,
  114. status: true,
  115. fixed: '',
  116. columnWidth: 120
  117. }, {
  118. userId: this.$store.state.user.name,
  119. functionId: 102003,
  120. serialNumber: '102003Table1ProjectId',
  121. tableId: '102003Table1',
  122. tableName: '报价信息表',
  123. columnProp: 'projectId',
  124. headerAlign: 'center',
  125. align: 'left',
  126. columnLabel: '项目编码',
  127. columnHidden: false,
  128. columnImage: false,
  129. columnSortable: false,
  130. sortLv: 0,
  131. status: true,
  132. fixed: '',
  133. columnWidth: 200
  134. }, {
  135. userId: this.$store.state.user.name,
  136. functionId: 102003,
  137. serialNumber: '102003Table1ProjectName',
  138. tableId: '102003Table1',
  139. tableName: '报价信息表',
  140. columnProp: 'projectDesc',
  141. headerAlign: 'center',
  142. align: 'left',
  143. columnLabel: '项目名称',
  144. columnHidden: false,
  145. columnImage: false,
  146. columnSortable: false,
  147. sortLv: 0,
  148. status: true,
  149. fixed: '',
  150. columnWidth: 200
  151. },
  152. {
  153. userId: this.$store.state.user.name,
  154. functionId: 102003,
  155. serialNumber: '102003Table1QuoterName',
  156. tableId: '102003Table1',
  157. tableName: '报价信息表',
  158. columnProp: 'quoterName',
  159. headerAlign: 'center',
  160. align: 'left',
  161. columnLabel: '报价专员',
  162. columnHidden: false,
  163. columnImage: false,
  164. columnSortable: false,
  165. sortLv: 0,
  166. status: true,
  167. fixed: '',
  168. columnWidth: 120
  169. },
  170. {
  171. userId: this.$store.state.user.name,
  172. functionId: 102003,
  173. serialNumber: '102003Table1TrackerName',
  174. tableId: '102003Table1',
  175. tableName: '报价信息表',
  176. columnProp: 'trackerName',
  177. headerAlign: 'center',
  178. align: 'left',
  179. columnLabel: '采购专员',
  180. columnHidden: false,
  181. columnImage: false,
  182. columnSortable: false,
  183. sortLv: 0,
  184. status: true,
  185. fixed: '',
  186. columnWidth: 120
  187. },
  188. {
  189. userId: this.$store.state.user.name,
  190. functionId: 102003,
  191. serialNumber: '102003Table1Currency',
  192. tableId: '102003Table1',
  193. tableName: '报价信息表',
  194. columnProp: 'currency',
  195. headerAlign: 'center',
  196. align: 'center',
  197. columnLabel: '货币',
  198. columnHidden: false,
  199. columnImage: false,
  200. columnSortable: false,
  201. sortLv: 0,
  202. status: true,
  203. fixed: '',
  204. columnWidth: 120
  205. },
  206. {
  207. userId: this.$store.state.user.name,
  208. functionId: 102003,
  209. serialNumber: '102003Table1Status',
  210. tableId: '102003Table1',
  211. tableName: '报价信息表',
  212. columnProp: 'status',
  213. headerAlign: 'center',
  214. align: 'center',
  215. columnLabel: '状态',
  216. columnHidden: false,
  217. columnImage: false,
  218. columnSortable: false,
  219. sortLv: 0,
  220. status: true,
  221. fixed: '',
  222. columnWidth: 120
  223. },
  224. {
  225. userId: this.$store.state.user.name,
  226. functionId: 102003,
  227. serialNumber: '102003Table1CustomerInquiryNo',
  228. tableId: '102003Table1',
  229. tableName: '报价信息表',
  230. columnProp: 'customerInquiryNo',
  231. headerAlign: 'center',
  232. align: 'center',
  233. columnLabel: '客户报价单号',
  234. columnHidden: false,
  235. columnImage: false,
  236. columnSortable: false,
  237. sortLv: 0,
  238. status: true,
  239. fixed: '',
  240. columnWidth: 120
  241. },
  242. {
  243. userId: this.$store.state.user.name,
  244. functionId: 102003,
  245. serialNumber: '102003Table1InternalInquiryNo',
  246. tableId: '102003Table1',
  247. tableName: '报价信息表',
  248. columnProp: 'internalInquiryNo',
  249. headerAlign: 'center',
  250. align: 'center',
  251. columnLabel: '内部询价单号',
  252. columnHidden: false,
  253. columnImage: false,
  254. columnSortable: false,
  255. sortLv: 0,
  256. status: true,
  257. fixed: '',
  258. columnWidth: 120
  259. },
  260. ],
  261. }
  262. },
  263. methods: {
  264. handleQuerySalesQuote() {
  265. let params = {
  266. ...this.querySalesQuote,
  267. no: this.no,
  268. size: this.size,
  269. site: this.$store.state.user.site,
  270. }
  271. this.queryLoading = true;
  272. querySalesQuoteByPage(params).then(({data}) => {
  273. if (data && data.code === 0) {
  274. this.dataList = data.rows
  275. this.total = data.total
  276. } else {
  277. this.$message.warning(data.msg)
  278. }
  279. this.queryLoading = false;
  280. }).catch((error) => {
  281. this.$message.error(error)
  282. this.queryLoading = false;
  283. })
  284. },
  285. handleSizeChange(val){
  286. this.size = val;
  287. this.handleQuerySalesQuote();
  288. },
  289. handleCurrentChange(val){
  290. this.no = val;
  291. this.handleQuerySalesQuote();
  292. },
  293. handleSaveSalesQuote(){
  294. this.$emit("save")
  295. },
  296. handleUpdateSalesQuoteStatus(row){
  297. let salesQuote = {
  298. ...row,
  299. quotationStatus: row.status,
  300. }
  301. this.$emit("updateStatus",salesQuote)
  302. },
  303. handleShowSalesQuote(row){
  304. this.$emit("show",row)
  305. },
  306. handleUpdateSalesQuote(row){
  307. this.$emit("update",row)
  308. },
  309. handleRemoveSalesQuote(row){
  310. this.$emit("remove",row)
  311. },
  312. handleAgainSalesQuote(row){
  313. this.$emit("again",row)
  314. },
  315. rowStyle({row}){
  316. if (this.currentRow.id === row.id){
  317. return {'background-color': '#E8F7F6'}
  318. }
  319. },
  320. handleClickRow(row){
  321. let salesQuote = {
  322. ...row,
  323. quotationHeaderId: row.id,
  324. }
  325. this.$emit("rowClick",salesQuote)
  326. }
  327. }
  328. }
  329. </script>
  330. <template>
  331. <div>
  332. <div :style="queryStyle">
  333. <el-form :model="querySalesQuote" label-position="top">
  334. <el-row :gutter="10">
  335. <el-col :span="3">
  336. <el-form-item label="客户编码">
  337. <el-input v-model="querySalesQuote.customerNo"></el-input>
  338. </el-form-item>
  339. </el-col>
  340. <el-col :span="3">
  341. <el-form-item label="客户名称">
  342. <el-input v-model="querySalesQuote.customerDesc"></el-input>
  343. </el-form-item>
  344. </el-col>
  345. <el-col :span="3">
  346. <el-form-item label="采购专员">
  347. <el-input v-model="querySalesQuote.trackerName"></el-input>
  348. </el-form-item>
  349. </el-col>
  350. <el-col :span="3">
  351. <el-form-item label="报价单号">
  352. <el-input v-model="querySalesQuote.quotationNo"></el-input>
  353. </el-form-item>
  354. </el-col>
  355. <el-col :span="3">
  356. <el-form-item label="客户询价单号">
  357. <el-input v-model="querySalesQuote.customerInquiryNo"></el-input>
  358. </el-form-item>
  359. </el-col>
  360. <el-col :span="3">
  361. <el-form-item label="内部询价单号">
  362. <el-input v-model="querySalesQuote.internalInquiryNo"></el-input>
  363. </el-form-item>
  364. </el-col>
  365. </el-row>
  366. <el-row :gutter="10">
  367. <el-col :span="3">
  368. <el-form-item label="项目编码">
  369. <el-input v-model="querySalesQuote.projectId"></el-input>
  370. </el-form-item>
  371. </el-col>
  372. <el-col :span="3">
  373. <el-form-item label="项目名称">
  374. <el-input v-model="querySalesQuote.projectDesc"></el-input>
  375. </el-form-item>
  376. </el-col>
  377. <el-col :span="3">
  378. <el-form-item label="报价专员">
  379. <el-input v-model="querySalesQuote.quoterName"></el-input>
  380. </el-form-item>
  381. </el-col>
  382. <el-col :span="3">
  383. <el-form-item label="状态">
  384. <el-select v-model="querySalesQuote.status">
  385. <el-option label="全部" value=""></el-option>
  386. <el-option label="草稿" value="草稿"></el-option>
  387. <el-option label="下达" value="下达"></el-option>
  388. </el-select>
  389. </el-form-item>
  390. </el-col>
  391. <el-col :span="6">
  392. <el-form-item label="报价日期">
  393. <el-date-picker
  394. value-format="yyyy-MM-dd"
  395. v-model="querySalesQuote.startDate"
  396. style="width: 48%"
  397. type="date"
  398. placeholder=" ">
  399. </el-date-picker>
  400. <div style="width: 1.2%;text-align: center;display: inline-block;">
  401. -
  402. </div>
  403. <el-date-picker
  404. value-format="yyyy-MM-dd"
  405. v-model="querySalesQuote.endDate"
  406. style="width: 48%"
  407. type="date"
  408. placeholder=" ">
  409. </el-date-picker>
  410. </el-form-item>
  411. </el-col>
  412. <el-col :span="3">
  413. <el-form-item label=" ">
  414. <el-button type="primary" :loading="queryLoading" @click="handleQuerySalesQuote">查询</el-button>
  415. <el-button type="primary" @click="handleSaveSalesQuote">新增</el-button>
  416. </el-form-item>
  417. </el-col>
  418. </el-row>
  419. </el-form>
  420. </div>
  421. <el-table :data="dataList"
  422. border
  423. :height="height"
  424. :row-style="rowStyle"
  425. @row-click="handleClickRow">
  426. <el-table-column
  427. v-for="(item,index) in columns" :key="index"
  428. :sortable="item.columnSortable"
  429. :prop="item.columnProp"
  430. :header-align="item.headerAlign"
  431. :show-overflow-tooltip="item.showOverflowTooltip"
  432. :align="item.align"
  433. :fixed="item.fixed===''?false:item.fixed"
  434. :min-width="item.columnWidth"
  435. :label="item.columnLabel">
  436. <template slot-scope="scope">
  437. <span v-if="!item.columnHidden">
  438. {{scope.row[item.columnProp]}}
  439. </span>
  440. <span v-if="item.columnImage">
  441. <img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/>
  442. </span>
  443. </template>
  444. </el-table-column>
  445. <el-table-column
  446. label="操作"
  447. align="center"
  448. fixed="right"
  449. width="160">
  450. <template slot-scope="{row,$index}">
  451. <a v-if="row.status === '草稿'" @click="handleUpdateSalesQuoteStatus(row)">下达</a>
  452. <a v-if="row.status === '下达'" @click="handleUpdateSalesQuoteStatus(row)">取消下达</a>
  453. <a v-if="row.status !== '草稿'" @click="handleShowSalesQuote(row)">详情</a>
  454. <a v-if="row.status === '草稿'" @click="handleUpdateSalesQuote(row)">编辑</a>
  455. <a v-if="row.status === '草稿'" @click="handleRemoveSalesQuote(row)">删除</a>
  456. <a @click="handleAgainSalesQuote(row)">重新报价</a>
  457. </template>
  458. </el-table-column>
  459. </el-table>
  460. <el-pagination style="margin-top: 0px"
  461. @size-change="handleSizeChange"
  462. @current-change="handleCurrentChange"
  463. :current-page="no"
  464. :page-sizes="[20, 50, 100, 200, 500]"
  465. :page-size="size"
  466. :total="total"
  467. layout="total,sizes, prev, pager, next, jumper">
  468. </el-pagination>
  469. </div>
  470. </template>
  471. <style scoped>
  472. </style>