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.

1096 lines
37 KiB

  1. <template>
  2. <div class="mod-config">
  3. <!-- 查询条件 -->
  4. <el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList()">
  5. <el-form-item :label="'BU'">
  6. <el-select v-model="searchData.bu" placeholder="请选择" clearable style="width: 120px">
  7. <el-option
  8. v-for = "i in userBuList"
  9. :key = "i.buNo"
  10. :label = "i.buDesc"
  11. :value = "i.buNo">
  12. </el-option>
  13. </el-select>
  14. </el-form-item>
  15. <el-form-item label="询价单号">
  16. <el-input v-model="searchData.rfqNo" clearable style="width: 120px"></el-input>
  17. </el-form-item>
  18. <el-form-item label="客户编码">
  19. <span style="cursor: pointer" slot="label" @click="getBaseList(509,2)"><a herf="#">客户编码</a></span>
  20. <el-input v-model="searchData.customerNo" clearable style="width: 120px"></el-input>
  21. </el-form-item>
  22. <el-form-item :label="'客户名称'">
  23. <el-input v-model="searchData.customerDesc" clearable style="width: 120px"></el-input>
  24. </el-form-item>
  25. <el-form-item :label="'询价日期'">
  26. <el-date-picker
  27. style="width: 120px"
  28. v-model="searchData.requestStartDate"
  29. type="date"
  30. value-format="yyyy-MM-dd"
  31. placeholder="选择日期">
  32. </el-date-picker>
  33. </el-form-item>
  34. <el-form-item label=" ">
  35. <div style="text-align: center;"><i class="el-icon-right"></i></div>
  36. </el-form-item>
  37. <el-form-item :label="' '">
  38. <el-date-picker
  39. style="width: 120px"
  40. v-model="searchData.requestEndDate"
  41. type="date"
  42. value-format="yyyy-MM-dd"
  43. placeholder="选择日期">
  44. </el-date-picker>
  45. </el-form-item>
  46. <el-form-item :label="'优先等级'">
  47. <dict-data-select v-model="searchData.priorityLevel" clearable style="width: 120px" :use-default-value="false"
  48. dict-type="priority_Level"/>
  49. </el-form-item>
  50. </el-form>
  51. <el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList()">
  52. <el-form-item label="产品编码">
  53. <span style="cursor: pointer" slot="label" @click="getBaseList(2005)"><a herf="#">产品编码</a></span>
  54. <el-input v-model="searchData.partNo" clearable style="width: 120px"></el-input>
  55. </el-form-item>
  56. <el-form-item :label="'产品名称'">
  57. <el-input v-model="searchData.partDesc" clearable style="width: 120px"></el-input>
  58. </el-form-item>
  59. <el-form-item :label="'PjM'">
  60. <span style="cursor: pointer" slot="label" @click="getBaseList(2004,1)"><a herf="#">PjM</a></span>
  61. <el-input v-model="searchData.requesterName" clearable style="width: 120px"></el-input>
  62. </el-form-item>
  63. <el-form-item :label="'报价专员'">
  64. <span style="cursor: pointer" slot="label" @click="getBaseList(2002,1)"><a herf="#">报价专员</a></span>
  65. <el-input v-model="searchData.quoterName" clearable style="width: 120px"></el-input>
  66. </el-form-item>
  67. <el-form-item :label="'要求报价日期'">
  68. <el-date-picker
  69. style="width: 120px"
  70. v-model="searchData.requiredCompletionStartDate"
  71. type="date"
  72. value-format="yyyy-MM-dd"
  73. placeholder="选择日期">
  74. </el-date-picker>
  75. </el-form-item>
  76. <el-form-item label=" ">
  77. <div style="text-align: center;"><i class="el-icon-right"></i></div>
  78. </el-form-item>
  79. <el-form-item :label="' '">
  80. <el-date-picker
  81. style="width: 120px"
  82. v-model="searchData.requiredCompletionEndDate"
  83. type="date"
  84. value-format="yyyy-MM-dd"
  85. placeholder="选择日期">
  86. </el-date-picker>
  87. </el-form-item>
  88. <el-form-item :label="'状态'">
  89. <el-select v-model="searchData.status" style="width: 120px">
  90. <el-option label="全部" value=""></el-option>
  91. <el-option label="草稿" value="C"></el-option>
  92. <el-option label="已下达" value="B"></el-option>
  93. <el-option label="已报价" value="A"></el-option>
  94. </el-select>
  95. </el-form-item>
  96. <el-form-item :label="' '">
  97. <el-button @click="getDataList()">查询</el-button>
  98. <!-- <el-button type="primary" icon="el-icon-upload" @click="handleImportQuotation()">导入</el-button>-->
  99. <!-- <download-excel-->
  100. <!-- :fields="fields()"-->
  101. <!-- :data="exportData"-->
  102. <!-- type="xls"-->
  103. <!-- :name="exportName"-->
  104. <!-- :header="exportHeader"-->
  105. <!-- :footer="exportFooter"-->
  106. <!-- :fetch="createExportData"-->
  107. <!-- :before-generate="startDownload"-->
  108. <!-- :before-finish="finishDownload"-->
  109. <!-- worksheet="导出信息"-->
  110. <!-- class="el-button el-button&#45;&#45;primary el-button&#45;&#45;medium">-->
  111. <!-- {{ "导出" }}-->
  112. <!-- </download-excel>-->
  113. </el-form-item>
  114. </el-form>
  115. <!-- 询价产品列表 -->
  116. <el-table
  117. height="37vh"
  118. :data="dataList"
  119. border
  120. :row-style="rowStyle"
  121. ref="mainTable"
  122. @row-click="inquiryPartClickRow"
  123. @current-change="changeCurrentRow"
  124. style="width: 100%;margin-top: 5px">
  125. <el-table-column
  126. v-for="(item,index) in columnList" :key="index"
  127. :sortable="item.columnSortable"
  128. :prop="item.columnProp"
  129. :header-align="item.headerAlign"
  130. :align="item.align"
  131. :fixed="item.fixed === ''?false:item.fixed"
  132. :min-width="item.columnWidth"
  133. :label="item.columnLabel">
  134. <template slot-scope="scope">
  135. <div v-if="item.columnProp !== 'status' && item.columnProp !== 'priorityLevel'">
  136. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  137. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  138. style="width: 100px; height: 80px"/></span>
  139. </div>
  140. <div v-else-if="item.columnProp === 'status'">
  141. <span v-if="!item.columnHidden">
  142. <span v-if="scope.row.status === 'C'">草稿</span>
  143. <span v-if="scope.row.status === 'B'">已下达</span>
  144. <span v-if="scope.row.status === 'A'">已报价</span>
  145. </span>
  146. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  147. style="width: 100px; height: 80px"/></span>
  148. </div>
  149. <div v-else-if="item.columnProp === 'priorityLevel'">
  150. <span v-if="!item.columnHidden">
  151. <span v-if="scope.row.priorityLevel === 'A'">普通</span>
  152. <span v-if="scope.row.priorityLevel === ' B'">重要</span>
  153. <span v-if="scope.row.priorityLevel === ' C'">紧急</span>
  154. </span>
  155. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  156. style="width: 100px; height: 80px"/></span>
  157. </div>
  158. </template>
  159. </el-table-column>
  160. </el-table>
  161. <!-- 分页插件 -->
  162. <el-pagination style="margin-top: 0px"
  163. @size-change="sizeChangeHandle"
  164. @current-change="currentChangeHandle"
  165. :current-page="pageIndex"
  166. :page-sizes="[20, 50, 100, 200, 500]"
  167. :page-size="pageSize"
  168. :total="totalPage"
  169. layout="total, sizes, prev, pager, next, jumper">
  170. </el-pagination>
  171. <!-- 页签 -->
  172. <el-tabs style="margin-top: 0px; width: 100%; height: 100%;" v-model="activeTable" class="customer-tab" type="border-card" @tab-click="tabClick">
  173. <!-- 询价明细 属性页签 -->
  174. <el-tab-pane label="属性" name="inquiryPartItem">
  175. <el-table
  176. :height="height - 300"
  177. :data="inquiryPartItemDataList"
  178. border
  179. style="width: 100%;">
  180. <el-table-column
  181. v-for="(item,index) in columnItemList" :key="index"
  182. :sortable="item.columnSortable"
  183. :prop="item.columnProp"
  184. :header-align="item.headerAlign"
  185. :show-overflow-tooltip="item.showOverflowTooltip"
  186. :align="item.align"
  187. :fixed="item.fixed==''?false:item.fixed"
  188. :min-width="item.columnWidth"
  189. :label="item.columnLabel">
  190. <template slot-scope="scope">
  191. <div v-if="item.columnProp !== 'textValue' && item.columnProp !== 'numValue'">
  192. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  193. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  194. </div>
  195. <div v-else>
  196. {{ scope.row.textValue ? scope.row.textValue : scope.row.numValue }}
  197. </div>
  198. </template>
  199. </el-table-column>
  200. </el-table>
  201. </el-tab-pane>
  202. <!-- 询价明细 详情页签 -->
  203. <el-tab-pane label="详情" name="inquiryPartDetail">
  204. <div style="margin-left: 10px;height: 225px">
  205. <el-form :inline="true" label-position="top" :model="inquiryPartCurrentRow">
  206. <el-form-item :label="'BU'">
  207. <el-input v-model="inquiryPartCurrentRow.buDesc" readonly style="width: 70px"></el-input>
  208. </el-form-item>
  209. <el-form-item :label="'客户编码'">
  210. <el-input v-model="inquiryPartCurrentRow.customerNo" readonly style="width: 160px"></el-input>
  211. </el-form-item>
  212. <el-form-item :label="'客户名称'">
  213. <el-input v-model="inquiryPartCurrentRow.customerDesc" readonly style="width: 340px"></el-input>
  214. </el-form-item>
  215. <el-form-item :label="'询价单号'">
  216. <el-input v-model="inquiryPartCurrentRow.rfqNo" readonly style="width: 160px"></el-input>
  217. </el-form-item>
  218. <el-form-item :label="'询价日期'">
  219. <el-input v-model="inquiryPartCurrentRow.requestDate" readonly style="width: 100px"></el-input>
  220. </el-form-item>
  221. <el-form-item :label="'询价数量'">
  222. <el-input-number :controls="false" :step="0" v-model="inquiryPartCurrentRow.inquiryQty" readonly style="width: 70px"></el-input-number>
  223. </el-form-item>
  224. </el-form>
  225. <el-form :inline="true" label-position="top" :model="inquiryPartCurrentRow">
  226. <el-form-item :label="'状态'">
  227. <el-input v-model="statusDisplay" readonly style="width: 70px"></el-input>
  228. </el-form-item>
  229. <el-form-item :label="'产品编码'">
  230. <el-input v-model="inquiryPartCurrentRow.partNo" readonly style="width: 160px"></el-input>
  231. </el-form-item>
  232. <el-form-item :label="'产品描述'">
  233. <el-input v-model="inquiryPartCurrentRow.partDesc" readonly style="width: 340px"></el-input>
  234. </el-form-item>
  235. <el-form-item :label="'客户询价单号'">
  236. <el-input v-model="inquiryPartCurrentRow.customerInquiryNo" readonly style="width: 160px"></el-input>
  237. </el-form-item>
  238. <el-form-item :label="'要求报价日期'">
  239. <el-input v-model="inquiryPartCurrentRow.requiredCompletionDate" readonly style="width: 100px"></el-input>
  240. </el-form-item>
  241. <el-form-item :label="'计量单位'">
  242. <el-input v-model="inquiryPartCurrentRow.umName" readonly style="width: 70px"></el-input>
  243. </el-form-item>
  244. </el-form>
  245. <el-form :inline="true" label-position="top" :model="inquiryPartCurrentRow">
  246. <el-form-item :label="'属性模版'">
  247. <el-input v-model="inquiryPartCurrentRow.codeNo" readonly style="width: 244px"></el-input>
  248. </el-form-item>
  249. <el-form-item :label="'PjM'">
  250. <el-input v-model="inquiryPartCurrentRow.requesterName" readonly style="width: 163px"></el-input>
  251. </el-form-item>
  252. <el-form-item :label="'报价专员'">
  253. <el-input v-model="inquiryPartCurrentRow.quoterName" readonly style="width: 163px"></el-input>
  254. </el-form-item>
  255. <el-form-item :label="'优先等级'">
  256. <el-input v-model="priorityLevelDisplay" readonly style="width: 274px"></el-input>
  257. </el-form-item>
  258. </el-form>
  259. <el-form :inline="true" label-position="top" :model="inquiryPartCurrentRow">
  260. <el-form-item :label="'备注'">
  261. <el-input v-model="inquiryPartCurrentRow.remark" readonly style="width: 885px"></el-input>
  262. </el-form-item>
  263. </el-form>
  264. <el-form :inline="true" label-position="top" :model="inquiryPartCurrentRow">
  265. <el-form-item :label="'创建人'">
  266. <el-input v-model="inquiryPartCurrentRow.createBy" readonly style="width: 146px"></el-input>
  267. </el-form-item>
  268. <el-form-item :label="'创建时间'">
  269. <el-input v-model="inquiryPartCurrentRow.createDate" readonly style="width: 263px"></el-input>
  270. </el-form-item>
  271. <el-form-item :label="'更新人'">
  272. <el-input v-model="inquiryPartCurrentRow.updateBy" readonly style="width: 161px"></el-input>
  273. </el-form-item>
  274. <el-form-item :label="'更新时间'">
  275. <el-input v-model="inquiryPartCurrentRow.updateDate" readonly style="width: 276px"></el-input>
  276. </el-form-item>
  277. </el-form>
  278. </div>
  279. </el-tab-pane>
  280. <!-- 询价明细 相关文档 -->
  281. <el-tab-pane label="相关文档" name="inquiryPartDocument">
  282. </el-tab-pane>
  283. <!-- 询价明细 报价记录页签 -->
  284. <el-tab-pane label="报价记录" name="inquiryPartQuotation">
  285. </el-tab-pane>
  286. </el-tabs>
  287. <!-- chooseList模态框 -->
  288. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  289. </div>
  290. </template>
  291. <script>
  292. import Chooselist from '@/views/modules/common/Chooselist_eam'
  293. import {getSiteAndBuByUserName} from "../../../api/qc/qc";
  294. import {searchInquiryApplicationInfo,addInquiryApplicationInfo,updateInquiryApplicationInfo,deleteInquiryApplicationInfo} from "@/api/inquiry/inquiryApplication";
  295. import {searchInquiryDetailInfo,addInquiryDetailInfo,updateInquiryDetailInfo,deleteInquiryDetailInfo} from "@/api/inquiry/inquiryDetail";
  296. import {getItemListByInquiryPartAndCodeNo,updateInquiryPartItemList,searchInquiryDetailHeaderInfo} from "@/api/inquiry/inquiryDetail";
  297. import DictDataSelect from "../sys/dict-data-select.vue";
  298. import {queryCustomerList} from "@/api/customer/customer";
  299. import {verifyData} from "@/api/part/partInformation";
  300. import {EventBus} from "../../../main";
  301. export default {
  302. components: {
  303. DictDataSelect,
  304. Chooselist
  305. },
  306. computed: {
  307. statusDisplay() {
  308. return this.inquiryPartCurrentRow.status === 'C' ? '草稿' : (this.inquiryPartCurrentRow.status === 'B' ? '已下达' : '已报价')
  309. },
  310. priorityLevelDisplay() {
  311. return this.inquiryPartCurrentRow.priorityLevel === 'A' ? '普通' : (this.inquiryPartCurrentRow.priorityLevel === ' B' ? '重要' : '紧急')
  312. }
  313. },
  314. data() {
  315. return {
  316. userBuList: [],
  317. // ======== 分页 ========
  318. pageIndex: 1,
  319. pageSize: 50,
  320. totalPage: 0,
  321. height: 200,
  322. // 条件查询
  323. searchData: {
  324. site: this.$store.state.user.site,
  325. customerNo: '',
  326. customerDesc: '',
  327. id: '',
  328. rfqNo: '',
  329. bu: '',
  330. requestStartDate: '',
  331. requestEndDate: '',
  332. requiredCompletionStartDate: '',
  333. requiredCompletionEndDate: '',
  334. status: '',
  335. quoterName: '',
  336. requesterName: '',
  337. priorityLevel: '',
  338. partNo: '',
  339. partDesc: '',
  340. page: 1,
  341. limit: 10,
  342. menuId: this.$route.meta.menuId,
  343. },
  344. // 初始页签
  345. activeTable: 'inquiryPartItem',
  346. // ======== 数据列表 ========
  347. dataList: [],
  348. inquiryPartItemDataList: [],
  349. // ======== 列表表头 ========
  350. columnList: [
  351. {
  352. userId: this.$store.state.user.name,
  353. functionId: 102001,
  354. serialNumber: '102001Table1BuDesc',
  355. tableId: '102001Table1',
  356. tableName: '询价信息表',
  357. columnProp: 'buDesc',
  358. headerAlign: 'center',
  359. align: 'center',
  360. columnLabel: 'BU',
  361. columnHidden: false,
  362. columnImage: false,
  363. columnSortable: false,
  364. sortLv: 0,
  365. status: true,
  366. fixed: '',
  367. columnWidth: 80
  368. },
  369. {
  370. userId: this.$store.state.user.name,
  371. functionId: 102001,
  372. serialNumber: '102001Table1rfqNo',
  373. tableId: '102001Table1',
  374. tableName: '询价信息表',
  375. columnProp: 'rfqNo',
  376. headerAlign: 'center',
  377. align: 'center',
  378. columnLabel: '询价单号',
  379. columnHidden: false,
  380. columnImage: false,
  381. columnSortable: false,
  382. sortLv: 0,
  383. status: true,
  384. fixed: '',
  385. columnWidth: 120
  386. },
  387. {
  388. userId: this.$store.state.user.name,
  389. functionId: 102001,
  390. serialNumber: '102001Table1CustomerNo',
  391. tableId: '102001Table1',
  392. tableName: '询价信息表',
  393. columnProp: 'customerNo',
  394. headerAlign: 'center',
  395. align: 'center',
  396. columnLabel: '客户编码',
  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: '102001Table1CustomerDesc',
  409. tableId: '102001Table1',
  410. tableName: '询价信息表',
  411. columnProp: 'customerDesc',
  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: 120
  422. },
  423. {
  424. userId: this.$store.state.user.name,
  425. functionId: 102001,
  426. serialNumber: '102001Table1RequestDate',
  427. tableId: '102001Table1',
  428. tableName: '询价信息表',
  429. columnProp: 'requestDate',
  430. headerAlign: 'center',
  431. align: 'center',
  432. columnLabel: '询价日期',
  433. columnHidden: false,
  434. columnImage: false,
  435. columnSortable: false,
  436. sortLv: 0,
  437. status: true,
  438. fixed: '',
  439. columnWidth: 120
  440. },
  441. {
  442. userId: this.$store.state.user.name,
  443. functionId: 102001,
  444. serialNumber: '102001Table1RequesterName',
  445. tableId: '102001Table1',
  446. tableName: '询价信息表',
  447. columnProp: 'requesterName',
  448. headerAlign: 'center',
  449. align: 'left',
  450. columnLabel: 'PjM',
  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: '102001Table1QuoterName',
  463. tableId: '102001Table1',
  464. tableName: '询价信息表',
  465. columnProp: 'quoterName',
  466. headerAlign: 'center',
  467. align: 'left',
  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: 120
  494. },
  495. {
  496. userId: this.$store.state.user.name,
  497. functionId: 102001,
  498. serialNumber: '102001Table1CustomerInquiryNo',
  499. tableId: '102001Table1',
  500. tableName: '询价信息表',
  501. columnProp: 'customerInquiryNo',
  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: 120
  512. },
  513. {
  514. userId: this.$store.state.user.name,
  515. functionId: 102001,
  516. serialNumber: '102001Table2PartNo',
  517. tableId: '102001Table2',
  518. tableName: '询价产品表',
  519. columnProp: 'partNo',
  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: 120
  530. },
  531. {
  532. userId: this.$store.state.user.name,
  533. functionId: 102001,
  534. serialNumber: '102001Table2PartDesc',
  535. tableId: '102001Table2',
  536. tableName: '询价产品表',
  537. columnProp: 'partDesc',
  538. headerAlign: 'center',
  539. align: 'left',
  540. columnLabel: '产品描述',
  541. columnHidden: false,
  542. columnImage: false,
  543. columnSortable: false,
  544. sortLv: 0,
  545. status: true,
  546. fixed: '',
  547. columnWidth: 120
  548. },
  549. {
  550. userId: this.$store.state.user.name,
  551. functionId: 102001,
  552. serialNumber: '102001Table1Status',
  553. tableId: '102001Table1',
  554. tableName: '询价信息表',
  555. columnProp: 'status',
  556. headerAlign: 'center',
  557. align: 'center',
  558. columnLabel: '状态',
  559. columnHidden: false,
  560. columnImage: false,
  561. columnSortable: false,
  562. sortLv: 0,
  563. status: true,
  564. fixed: '',
  565. columnWidth: 100
  566. },
  567. {
  568. userId: this.$store.state.user.name,
  569. functionId: 102001,
  570. serialNumber: '102001Table2InquiryQty',
  571. tableId: '102001Table2',
  572. tableName: '询价产品表',
  573. columnProp: 'inquiryQty',
  574. headerAlign: 'center',
  575. align: 'right',
  576. columnLabel: '询价数量',
  577. columnHidden: false,
  578. columnImage: false,
  579. columnSortable: false,
  580. sortLv: 0,
  581. status: true,
  582. fixed: '',
  583. columnWidth: 120
  584. },
  585. {
  586. userId: this.$store.state.user.name,
  587. functionId: 102001,
  588. serialNumber: '102001Table2Unit',
  589. tableId: '102001Table2',
  590. tableName: '询价产品表',
  591. columnProp: 'umName',
  592. headerAlign: 'center',
  593. align: 'center',
  594. columnLabel: '计量单位',
  595. columnHidden: false,
  596. columnImage: false,
  597. columnSortable: false,
  598. sortLv: 0,
  599. status: true,
  600. fixed: '',
  601. columnWidth: 80
  602. },
  603. {
  604. userId: this.$store.state.user.name,
  605. functionId: 102001,
  606. serialNumber: '102001Table2CodeNo',
  607. tableId: '102001Table2',
  608. tableName: '询价产品表',
  609. columnProp: 'codeNo',
  610. headerAlign: 'center',
  611. align: 'left',
  612. columnLabel: '属性模版',
  613. columnHidden: false,
  614. columnImage: false,
  615. columnSortable: false,
  616. sortLv: 0,
  617. status: true,
  618. fixed: '',
  619. columnWidth: 120
  620. },
  621. {
  622. userId: this.$store.state.user.name,
  623. functionId: 102001,
  624. serialNumber: '102001Table1PriorityLevel',
  625. tableId: '102001Table1',
  626. tableName: '询价信息表',
  627. columnProp: 'priorityLevel',
  628. headerAlign: 'center',
  629. align: 'center',
  630. columnLabel: '优先等级',
  631. columnHidden: false,
  632. columnImage: false,
  633. columnSortable: false,
  634. sortLv: 0,
  635. status: true,
  636. fixed: '',
  637. columnWidth: 80
  638. },
  639. {
  640. userId: this.$store.state.user.name,
  641. functionId: 102001,
  642. serialNumber: '102001Table2Remark',
  643. tableId: '102001Table2',
  644. tableName: '询价产品表',
  645. columnProp: 'remark',
  646. headerAlign: 'center',
  647. align: 'left',
  648. columnLabel: '备注',
  649. columnHidden: false,
  650. columnImage: false,
  651. columnSortable: false,
  652. sortLv: 0,
  653. status: true,
  654. fixed: '',
  655. columnWidth: 120
  656. },
  657. {
  658. userId: this.$store.state.user.name,
  659. functionId: 102001,
  660. serialNumber: '102001Table1CreateDate',
  661. tableId: '102001Table1',
  662. tableName: '询价信息表',
  663. columnProp: 'createDate',
  664. headerAlign: 'center',
  665. align: 'center',
  666. columnLabel: '创建时间',
  667. columnHidden: false,
  668. columnImage: false,
  669. columnSortable: false,
  670. sortLv: 0,
  671. status: true,
  672. fixed: '',
  673. columnWidth: 160
  674. },
  675. {
  676. userId: this.$store.state.user.name,
  677. functionId: 102001,
  678. serialNumber: '102001Table1CreateBy',
  679. tableId: '102001Table1',
  680. tableName: '询价信息表',
  681. columnProp: 'createBy',
  682. headerAlign: 'center',
  683. align: 'left',
  684. columnLabel: '创建人',
  685. columnHidden: false,
  686. columnImage: false,
  687. columnSortable: false,
  688. sortLv: 0,
  689. status: true,
  690. fixed: '',
  691. columnWidth: 80
  692. },
  693. {
  694. userId: this.$store.state.user.name,
  695. functionId: 102001,
  696. serialNumber: '102001Table1UpdateDate',
  697. tableId: '102001Table1',
  698. tableName: '询价信息表',
  699. columnProp: 'updateDate',
  700. headerAlign: 'center',
  701. align: 'center',
  702. columnLabel: '更新时间',
  703. columnHidden: false,
  704. columnImage: false,
  705. columnSortable: false,
  706. sortLv: 0,
  707. status: true,
  708. fixed: '',
  709. columnWidth: 160
  710. },
  711. {
  712. userId: this.$store.state.user.name,
  713. functionId: 102001,
  714. serialNumber: '102001Table1UpdateBy',
  715. tableId: '102001Table1',
  716. tableName: '询价信息表',
  717. columnProp: 'updateBy',
  718. headerAlign: 'center',
  719. align: 'left',
  720. columnLabel: '更新人',
  721. columnHidden: false,
  722. columnImage: false,
  723. columnSortable: false,
  724. sortLv: 0,
  725. status: true,
  726. fixed: '',
  727. columnWidth: 80
  728. }
  729. ],
  730. columnItemList: [
  731. {
  732. userId: this.$store.state.user.name,
  733. functionId: 601006,
  734. serialNumber: '601006Table3ItemID',
  735. tableId: "601006Table3",
  736. tableName: "物料属性表",
  737. columnProp: 'itemNo',
  738. headerAlign: "center",
  739. align: "center",
  740. columnLabel: '属性编码',
  741. columnHidden: false,
  742. columnImage: false,
  743. status: true,
  744. fixed: '',
  745. columnWidth: 100,
  746. },
  747. {
  748. userId: this.$store.state.user.name,
  749. functionId: 601006,
  750. serialNumber: '601006Table3PropertiesItemDesc',
  751. tableId: "601006Table3",
  752. tableName: "物料属性表",
  753. columnProp: 'itemDesc',
  754. headerAlign: "center",
  755. align: "left",
  756. columnLabel: '属性名称',
  757. columnHidden: false,
  758. columnImage: false,
  759. status: true,
  760. fixed: '',
  761. columnWidth: 120,
  762. },
  763. {
  764. userId: this.$store.state.user.name,
  765. functionId: 601006,
  766. serialNumber: '601006Table3ValueType',
  767. tableId: "601006Table3",
  768. tableName: "物料属性表",
  769. columnProp: 'valueType',
  770. headerAlign: "center",
  771. align: "center",
  772. columnLabel: '属性类型',
  773. columnHidden: false,
  774. columnImage: false,
  775. status: true,
  776. fixed: '',
  777. columnWidth: 100,
  778. },
  779. {
  780. userId: this.$store.state.user.name,
  781. functionId: 601006,
  782. serialNumber: '601006Table3ValueChooseFlag',
  783. tableId: "601006Table3",
  784. tableName: "物料属性表",
  785. columnProp: 'textValue',
  786. headerAlign: "center",
  787. align: "left",
  788. columnLabel: '属性值',
  789. columnHidden: false,
  790. columnImage: false,
  791. status: true,
  792. fixed: '',
  793. columnWidth: 100,
  794. },
  795. // {
  796. // userId: this.$store.state.user.name,
  797. // functionId: 601006,
  798. // serialNumber: '601006Table3ValueChooseFlag',
  799. // tableId: "601006Table3",
  800. // tableName: "物料属性表",
  801. // columnProp: 'numValue',
  802. // headerAlign: "center",
  803. // align: "center",
  804. // columnLabel: '数字值',
  805. // columnHidden: false,
  806. // columnImage: false,
  807. // status: true,
  808. // fixed: '',
  809. // columnWidth: 70,
  810. // },
  811. ],
  812. // ======== 选中的当前行数据 ========
  813. inquiryPartCurrentRow: {},
  814. }
  815. },
  816. mounted() {
  817. this.$nextTick(() => {
  818. /*第二个表格高度的动态调整*/
  819. this.height = window.innerHeight - 210;
  820. })
  821. EventBus.$on('updateInquiryPartInfo', () => {
  822. this.getDataList();
  823. });
  824. },
  825. created() {
  826. this.getSiteAndBuByUserName()
  827. this.getDataList()
  828. },
  829. activated() {
  830. console.log(this.$route.query.id)
  831. if (this.$route.query.id) {
  832. this.getDataList(this.$route.query.id);
  833. this.activeTable = 'inquiryPartDetail';
  834. }
  835. },
  836. methods: {
  837. // 获取用户的bu
  838. getSiteAndBuByUserName() {
  839. let tempData = {
  840. username: this.$store.state.user.name,
  841. }
  842. getSiteAndBuByUserName(tempData).then(({data}) => {
  843. if (data.code === 0) {
  844. this.userBuList = data.rows
  845. }
  846. })
  847. },
  848. // ======== 分页相关方法 ========
  849. /**
  850. * 每页数
  851. * @param val
  852. */
  853. sizeChangeHandle(val) {
  854. this.pageSize = val
  855. this.pageIndex = 1
  856. this.getDataList()
  857. },
  858. /**
  859. * 当前页
  860. * @param val
  861. */
  862. currentChangeHandle(val) {
  863. this.pageIndex = val
  864. this.getDataList()
  865. },
  866. // ======== 页签切换相关方法 ========
  867. /**
  868. * 列表表格选择替换
  869. * @param tab
  870. * @param event
  871. */
  872. tabClick(tab, event) {
  873. // 刷新列表数据
  874. this.refreshCurrentTabTable()
  875. },
  876. // ======== 列表操作方法 ========
  877. /**
  878. * 单机选中询价信息
  879. * @param row
  880. */
  881. inquiryPartClickRow(row) {
  882. this.inquiryPartCurrentRow = JSON.parse(JSON.stringify(row))
  883. },
  884. /**
  885. * 当前值发生变化的时候修改
  886. * @param row
  887. * @param oldRow
  888. */
  889. changeCurrentRow(row, oldRow) {
  890. // 判断是否是获取焦点的事件
  891. if (row) {
  892. this.inquiryPartCurrentRow = JSON.parse(JSON.stringify(row))
  893. //刷新当前页表
  894. this.refreshCurrentTabTable()
  895. }
  896. },
  897. /**
  898. * 刷新页签的table数据
  899. */
  900. refreshCurrentTabTable() {
  901. if (this.activeTable === 'inquiryPartItem') {
  902. this.getItemListByInquiryPartAndCodeNo()
  903. }
  904. },
  905. // ======== chooseList相关方法 ========
  906. /**
  907. * 获取基础数据列表S
  908. * @param val
  909. * @param type
  910. */
  911. getBaseList(val, type) {
  912. this.tagNo = val
  913. this.tagNo1 = type
  914. this.$nextTick(() => {
  915. let strVal = ''
  916. let conSql = ''
  917. if (val === 220) {
  918. strVal = this.inquiryPartModalData.codeNo ? this.inquiryPartModalData.codeNo : ''
  919. conSql = " and function_type = 'PRICECHECK'" + " and site = '" + this.inquiryPartModalData.bu.split('_')[0] + "'" +
  920. " and bu_no = '" + this.inquiryPartModalData.bu.split('_')[1] + "'"
  921. }
  922. if (val === 509) {
  923. if (type === 1) {
  924. strVal = this.modalData.customerNo ? this.modalData.customerNo : ''
  925. }
  926. if (type === 2) {
  927. strVal = this.searchData.customerNo ? this.searchData.customerNo : ''
  928. }
  929. }
  930. if (val === 510) {
  931. strVal = this.inquiryPartModalData.umId ? this.inquiryPartModalData.umId : ''
  932. conSql = " and site = '" + this.inquiryPartModalData.bu.split('_')[0] + "'"
  933. }
  934. if (val === 2002) {
  935. if (type === 1) {
  936. strVal = this.searchData.quoterName ? this.searchData.quoterName : ''
  937. conSql = " and b.site = '" + this.$store.state.user.site + "'"
  938. }
  939. if (type === 2) {
  940. strVal = this.modalData.quoterName ? this.modalData.quoterName : ''
  941. conSql = " and b.site = '" + this.$store.state.user.site + "'"
  942. }
  943. }
  944. if (val === 2004) {
  945. if (type === 1) {
  946. strVal = this.searchData.requesterName ? this.searchData.requesterName : ''
  947. conSql = " and b.site = '" + this.$store.state.user.site + "'"
  948. }
  949. if (type === 2) {
  950. strVal = this.modalData.requesterName ? this.modalData.requesterName : ''
  951. conSql = " and b.site = '" + this.$store.state.user.site + "'"
  952. }
  953. }
  954. if (val === 2005) {
  955. strVal = this.searchData.partNo ? this.searchData.partNo : ''
  956. conSql = " and b.site = '" + this.$store.state.user.site + "'"
  957. }
  958. this.$refs.baseList.init(val, strVal, conSql)
  959. })
  960. },
  961. /**
  962. * 列表方法的回调
  963. * @param val
  964. */
  965. getBaseData(val) {
  966. console.log(val)
  967. if (this.tagNo === 220) {
  968. this.inquiryPartModalData.codeNo = val.code_no
  969. this.inquiryPartModalData.codeDesc = val.code_desc
  970. }
  971. if (this.tagNo === 509) {
  972. if (this.tagNo1 === 1) {
  973. if (val.customer_no === this.modalData.customerNo) {
  974. return
  975. }
  976. this.modalData.customerNo = val.customer_no
  977. this.modalData.customerDesc = val.customer_desc
  978. }
  979. if (this.tagNo1 === 2) {
  980. if (val.customer_no === this.searchData.customerNo) {
  981. return
  982. }
  983. this.searchData.customerNo = val.customer_no
  984. }
  985. }
  986. if (this.tagNo === 510) {
  987. this.inquiryPartModalData.umId = val.UMID
  988. this.inquiryPartModalData.umName = val.UMName
  989. }
  990. if (this.tagNo === 2002) {
  991. if (this.tagNo1 === 1) {
  992. this.searchData.quoter = val.username
  993. this.searchData.quoterName = val.user_display
  994. }
  995. if (this.tagNo1 === 2) {
  996. this.modalData.quoter = val.username
  997. this.modalData.quoterName = val.user_display
  998. }
  999. }
  1000. if (this.tagNo === 2004) {
  1001. if (this.tagNo1 === 1) {
  1002. this.searchData.requester = val.username
  1003. this.searchData.requesterName = val.user_display
  1004. }
  1005. if (this.tagNo1 === 2) {
  1006. this.modalData.requester = val.username
  1007. this.modalData.requesterName = val.user_display
  1008. }
  1009. }
  1010. if (this.tagNo === 2005) {
  1011. this.searchData.partNo = val.part_no
  1012. }
  1013. },
  1014. // ======== 列表数据刷新方法 ========
  1015. /**
  1016. * 获取数据列表
  1017. */
  1018. getDataList(id) {
  1019. if (id) {
  1020. this.searchData.id = id
  1021. } else {
  1022. this.searchData.id = ''
  1023. }
  1024. this.searchData.limit = this.pageSize
  1025. this.searchData.page = this.pageIndex
  1026. searchInquiryDetailHeaderInfo(this.searchData).then(({data}) => {
  1027. if (data.code === 0) {
  1028. this.dataList = data.page.list
  1029. this.pageIndex = data.page.currPage
  1030. this.pageSize = data.page.pageSize
  1031. this.totalPage = data.page.totalCount
  1032. //判断是否全部存在数据
  1033. if (this.totalPage > 0) {
  1034. //设置选中行
  1035. this.$refs.mainTable.setCurrentRow(this.dataList[0])
  1036. this.inquiryPartClickRow(this.dataList[0])
  1037. this.refreshCurrentTabTable() //加载当前的页签的table
  1038. }
  1039. }
  1040. })
  1041. },
  1042. async getItemListByInquiryPartAndCodeNo() {
  1043. let inData = this.inquiryPartCurrentRow
  1044. inData.inquiryPartId = inData.id
  1045. inData.recordType = 'PRICECHECK'
  1046. return getItemListByInquiryPartAndCodeNo(inData).then(({data}) => {
  1047. if (data && data.code === 0) {
  1048. this.inquiryPartItemDataList = data.rows;
  1049. } else {
  1050. this.$message.warning(data.msg)
  1051. }
  1052. }).catch((error) => {
  1053. this.$message.error(error)
  1054. })
  1055. },
  1056. rowStyle({row}) {
  1057. if (this.inquiryPartCurrentRow.id === row.id) {
  1058. return {'background-color': '#E8F7F6', cursor: 'pointer'};
  1059. }
  1060. },
  1061. }
  1062. }
  1063. </script>
  1064. <style scoped lang="scss">
  1065. /deep/ .customer-tab .el-tabs__content {
  1066. padding: 0px !important;
  1067. }
  1068. .el-table /deep/ .cell{
  1069. height: auto;
  1070. line-height: 1.5;
  1071. }
  1072. .el-input-number /deep/ .el-input__inner {
  1073. text-align: right;
  1074. padding-right: 5px !important;
  1075. }
  1076. </style>