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.

936 lines
33 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. <template xmlns="http://www.w3.org/1999/html">
  2. <div class="mode-config">
  3. <el-form label-position="top" :inline="true" :model="searchData">
  4. <el-form-item label="客户编码">
  5. <el-input v-model="searchData.customerNo" clearable />
  6. </el-form-item>
  7. <el-form-item label="客户名称">
  8. <el-input v-model="searchData.customerName" clearable />
  9. </el-form-item>
  10. <el-form-item label="跟单员">
  11. <el-input v-model="searchData.trackerName" clearable/>
  12. </el-form-item>
  13. <el-form-item label="报价单号">
  14. <el-input v-model="searchData.quotationNo" clearable />
  15. </el-form-item>
  16. <el-form-item label="客户询价单号">
  17. <el-input v-model="searchData.customerInquiryNo" clearable />
  18. </el-form-item>
  19. <el-form-item label="内部询价单号">
  20. <el-input v-model="searchData.internalInquiryNo" clearable/>
  21. </el-form-item>
  22. <br/>
  23. <el-form-item label="项目编码">
  24. <el-input v-model="searchData.projectId" clearable />
  25. </el-form-item>
  26. <el-form-item label="项目名称">
  27. <el-input v-model="searchData.projectName" clearable/>
  28. </el-form-item>
  29. <el-form-item label="报价专员">
  30. <el-input v-model="searchData.quoterName" clearable/>
  31. </el-form-item>
  32. <el-form-item label="状态">
  33. <el-select v-model="searchData.quotationStatus">
  34. <el-option label="全部" value=""></el-option>
  35. <el-option label="草稿" value="草稿"></el-option>
  36. <el-option label="下达" value="下达"></el-option>
  37. </el-select>
  38. </el-form-item>
  39. <el-form-item label="开始日期">
  40. <el-date-picker
  41. value-format="yyyy-MM-dd"
  42. v-model="searchData.startDate"
  43. style="width: 140px"
  44. type="date"
  45. placeholder="开始日期">
  46. </el-date-picker>
  47. </el-form-item>
  48. <el-form-item label=" " style="width: 0px;margin-right: 0px">
  49. <label style="margin-left: -10px;font-size: 12px">&#10142</label>
  50. </el-form-item>
  51. <el-form-item label="结束日期">
  52. <el-date-picker
  53. value-format="yyyy-MM-dd"
  54. style="width: 140px"
  55. v-model="searchData.endDate"
  56. type="date"
  57. placeholder="结束日期">
  58. </el-date-picker>
  59. </el-form-item>
  60. <el-form-item label=" ">
  61. <el-button plain type="primary" @click="initDataBtn" @keyup.enter.native="initDataBtn"> </el-button>
  62. <el-button type="primary" @click="insertDiaLogFlag = true"> </el-button>
  63. </el-form-item>
  64. </el-form>
  65. <el-table :data="tableData" v-loading="initQuotationHeaderLoading" element-loading-text = "数据正在加载中"
  66. element-loading-spinner = "el-icon-loading" @row-click="rowClickQuotation" stripe border style="width: 100%;margin-top: 12px" :height="height">
  67. <el-table-column
  68. label="操作"
  69. align="center"
  70. fixed
  71. width="160">
  72. <template slot-scope="scope">
  73. <el-link style="cursor: pointer">下达</el-link>
  74. <el-link style="cursor: pointer" @click="editQuotationHeader(scope.row)">编辑</el-link>
  75. <el-link style="cursor: pointer" @click="deleteQuotationHeader(scope.row)">删除</el-link>
  76. <el-link style="cursor: pointer" @click="quotationAgain(scope.row)">重新报价</el-link>
  77. </template>
  78. </el-table-column>
  79. <el-table-column
  80. v-for="(item,index) in columnList" :key="index"
  81. :sortable="item.columnSortable"
  82. :prop="item.columnProp"
  83. :header-align="item.headerAlign"
  84. :show-overflow-tooltip="item.showOverflowTooltip"
  85. :align="item.align"
  86. :fixed="item.fixed===''?false:item.fixed"
  87. :min-width="item.columnWidth"
  88. :label="item.columnLabel">
  89. <template slot-scope="scope" >
  90. <span v-if="!item.columnHidden"> {{ `${scope.row[item.columnProp]}${index === 0?("-"+scope.row['versionCode']):''}` }}</span>
  91. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  92. </template>
  93. </el-table-column>
  94. </el-table>
  95. <!-- 分页插件 -->
  96. <el-pagination style="margin-top: 0px"
  97. @size-change="quotationHeaderSizeChange"
  98. @current-change="quotationHeaderCurrentChange"
  99. :current-page="no"
  100. :page-sizes="[20, 50, 100, 200, 500]"
  101. :page-size="size"
  102. :total="total"
  103. layout="total,sizes, prev, pager, next, jumper">
  104. </el-pagination>
  105. <!-- 标签页 -->
  106. <el-tabs v-model="activeTabName" @tab-click="handleClickTab"
  107. style="box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);border: 2px;min-height: 440px;margin-top: 5px;">
  108. <el-tab-pane label="报价明细" name="quotation_detail" v-if="false">
  109. <quotation-detail v-if="false" :quotation-header="quotationHeader"></quotation-detail>
  110. </el-tab-pane>
  111. <el-tab-pane label="报价明细" name="quote_detail">
  112. <quote-detail :header="quotationHeader"></quote-detail>
  113. </el-tab-pane>
  114. <el-tab-pane label="报价审批" name="quotation_examine_and_approve">
  115. <quotation-examine-and-approve></quotation-examine-and-approve>
  116. </el-tab-pane>
  117. <el-tab-pane label="项目信息" name="quotation_project_information">
  118. <quotation-project-information :quotation-header="quotationHeader"></quotation-project-information>
  119. </el-tab-pane>
  120. <el-tab-pane label="客户信息" name="quotation_customer_information">
  121. <quotation-customer-information :quotation-header="quotationHeader"></quotation-customer-information>
  122. </el-tab-pane>
  123. <el-tab-pane label="客户联系人" name="quotation_customer_contact">
  124. <quotation-customer-contact :quotation-header="quotationHeader"></quotation-customer-contact>
  125. </el-tab-pane>
  126. </el-tabs>
  127. <!-- 新增弹框 -->
  128. <el-dialog title="新增报价" @close="closeInsertDialog" :close-on-click-modal="false" v-drag :visible.sync="insertDiaLogFlag" width="40%">
  129. <el-form :rules="rules" :inline-message="true" label-position="top" ref="insertQuotationForm" :model="insertData"
  130. label-width="120px">
  131. <el-row>
  132. <el-col :span="8">
  133. <el-form-item prop="internalInquiryNo">
  134. <span slot="label" style="" @click="quotationNoDialogFlag = true"><a herf="#">内部询价单号</a></span>
  135. <el-input v-model="insertData.internalInquiryBatchNo" placeholder="请输入内容" clearable/>
  136. </el-form-item>
  137. </el-col>
  138. <el-col :span="12" :offset="2">
  139. <el-form-item label="客户询价单号" prop="customerInquiryNo">
  140. <el-input v-model="insertData.customerInquiryNo" placeholder="请输入内容" clearable/>
  141. </el-form-item>
  142. </el-col>
  143. </el-row>
  144. <el-row>
  145. <el-col :span="8">
  146. <el-form-item prop="customerNo" label="客户编码">
  147. <span slot="label" style="" v-if="insertData.internalInquiryNo ===''" @click="getBaseList(102,1)"><a herf="#">客户编码</a></span>
  148. <el-input v-model="insertData.customerNo" :disabled="insertData.internalInquiryNo !==''" placeholder="请输入内容" clearable />
  149. </el-form-item>
  150. </el-col>
  151. <el-col :span="12" :offset="2">
  152. <el-form-item prop="customerName" label="客户名称">
  153. <span slot="label" style="" v-if="insertData.internalInquiryNo ===''" @click="getBaseList(102,1)"><a herf="#">客户名称</a></span>
  154. <el-input v-model="insertData.customerName" :disabled="insertData.internalInquiryNo !==''" placeholder="请输入内容" clearable/>
  155. </el-form-item>
  156. </el-col>
  157. </el-row>
  158. <el-row>
  159. <el-col :span="8">
  160. <el-form-item prop="projectId" label="项目编码">
  161. <span slot="label" style="" v-if="insertData.internalInquiryNo ===''" @click="getBaseList(104,1)"><a herf="#">项目编码</a></span>
  162. <el-input v-model="insertData.projectId" :disabled="insertData.internalInquiryNo !==''" placeholder="请输入内容" clearable />
  163. </el-form-item>
  164. </el-col>
  165. <el-col :span="12" :offset="2">
  166. <el-form-item prop="projectName" label="项目名称">
  167. <span slot="label" style="" v-if="insertData.internalInquiryNo ===''" @click="getBaseList(104,1)"><a herf="#">项目名称</a></span>
  168. <el-input v-model="insertData.projectName" :disabled="insertData.internalInquiryNo !==''" placeholder="请输入内容" clearable />
  169. </el-form-item>
  170. </el-col>
  171. </el-row>
  172. <el-row>
  173. <el-col :span="8">
  174. <el-form-item label="货币" prop="currency">
  175. <el-input v-model="insertData.currency" :disabled="insertData.internalInquiryNo !==''" placeholder="请输入内容" clearable />
  176. </el-form-item>
  177. </el-col>
  178. <el-col :span="12" :offset="2">
  179. <el-form-item label="报价日期" prop="quotationDate">
  180. <el-date-picker
  181. style="width: 100%"
  182. v-model="insertData.quotationDate"
  183. type="date"
  184. size="mini"
  185. format="yyyy/MM/dd"
  186. value-format="yyyy-MM-dd"
  187. placeholder="选择日期">
  188. </el-date-picker>
  189. </el-form-item>
  190. </el-col>
  191. </el-row>
  192. <el-row>
  193. <el-col :span="8">
  194. <!-- <el-form-item prop="quoter" label="报价专员">-->
  195. <el-form-item label="报价专员">
  196. <span slot="label" style="" @click="getBaseList(103,2)"><a herf="#">报价专员</a></span>
  197. <el-input v-model="insertData.quoterName" @clear="clearQuoter" placeholder="请输入内容" clearable />
  198. </el-form-item>
  199. </el-col>
  200. <el-col :span="12" :offset="2">
  201. <el-form-item label="跟单员">
  202. <!-- <el-form-item prop="tracker" label="跟单员">-->
  203. <span slot="label" style="" v-if="insertData.internalInquiryNo ===''" @click="getBaseList(103,1)"><a herf="#">跟单员</a></span>
  204. <el-input v-model="insertData.trackerName" :disabled="insertData.internalInquiryNo !==''" @clear="clearTracker" placeholder="请输入内容" clearable />
  205. </el-form-item>
  206. </el-col>
  207. </el-row>
  208. <el-row>
  209. <el-col :span="24">
  210. <el-form-item label="备注" style="width: 100%;min-height: 90px">
  211. <el-input type="textarea" style="width: 100%" resize="none" :autosize="{minRows: 3, maxRows: 3}" v-model="insertData.remark"/>
  212. </el-form-item>
  213. </el-col>
  214. </el-row>
  215. </el-form>
  216. <span slot="footer" class="dialog-footer">
  217. <el-button type="primary" :loading="insertQuotationHeaderBtn" @click="saveQuotationHeader">确定</el-button>
  218. <el-button @click="insertDiaLogFlag = false">关闭</el-button>
  219. </span>
  220. </el-dialog>
  221. <!--询价单号选择弹框-->
  222. <el-dialog title="内部询价单号"
  223. @close="closeQuotationNoDialog"
  224. @open="openQuotationNoDialog"
  225. :visible.sync="quotationNoDialogFlag"
  226. width="685px" v-drag>
  227. <el-form label-position="top"
  228. inline="inline"
  229. :model="quotationNoSearchData"
  230. size="mini"
  231. label-width="120px">
  232. <el-form-item label="询价单号">
  233. <el-input v-model="quotationNoSearchData.quotationNo" clearable/>
  234. </el-form-item>
  235. <el-form-item label="申请批次号">
  236. <el-input v-model="quotationNoSearchData.quotationBatchNo" clearable style="width: 120px"></el-input>
  237. </el-form-item>
  238. <el-form-item label=" ">
  239. <el-button type="primary" style="padding: 3px 12px" @click="searchQuotationData">查询</el-button>
  240. </el-form-item>
  241. </el-form>
  242. <el-table :data="quotationNoData" stripe border @cell-dblclick="dblclickQuotationNo">
  243. <el-table-column prop="quotationNo" label="询价单号"/>
  244. <el-table-column prop="quotationBatchNo" label="询价批次号"/>
  245. <el-table-column width="60" align="right" prop="quotationItemNo" label="询价序号"/>
  246. <el-table-column prop="projectName" label="项目名称"/>
  247. <el-table-column width="160" prop="testPartNo" label="项目料号"/>
  248. <el-table-column prop="partName" label="物料名称"/>
  249. </el-table>
  250. <el-footer style="height:30px;margin-top: 20px;text-align:center">
  251. <el-button type="primary" @click="quotationNoDialogFlag = false">关闭</el-button>
  252. </el-footer>
  253. </el-dialog>
  254. <!-- chooseList模态框 -->
  255. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  256. </div>
  257. </template>
  258. <script>
  259. import quotationDetail from "./sellForQuotation/quotationDetail.vue";
  260. import quotationExamineAndApprove from "./sellForQuotation/quotationExamineAndApprove.vue";
  261. import quotationProjectInformation from "./sellForQuotation/quotationProjectInformation.vue";
  262. import quotationCustomerInformation from "./sellForQuotation/quotationCustomerInformation.vue";
  263. import quotationCustomerContact from "./sellForQuotation/quotationCustomerContact.vue";
  264. import Chooselist from '@/views/modules/common/Chooselist';
  265. import {
  266. getQuotationHeaderByPage,
  267. saveQuotationHeader,
  268. deleteByQuotationHeaderId,
  269. quotationAgain,
  270. } from '@/api/quotation/quotationHeader.js';
  271. import {
  272. searchQuotationByQuotationNo,
  273. } from '@/api/quotation/quotationInformation.js';
  274. import QuoteDetail from "./sellForQuotation/quoteDetail.vue";
  275. export default {
  276. components:{
  277. QuoteDetail,
  278. Chooselist,
  279. quotationDetail,
  280. quotationExamineAndApprove,
  281. quotationProjectInformation,
  282. quotationCustomerInformation,
  283. quotationCustomerContact,
  284. },
  285. data () {
  286. return {
  287. // 搜索条件对象
  288. searchData:{
  289. site:this.$store.state.user.site,// 工厂编号
  290. customerNo:"", // 客户编码
  291. customer:"", // 客户名称
  292. tracker:"", // 跟单员
  293. quotationStatus:"", //状态
  294. projectId:"", // 项目编码
  295. projectName:"", // 项目名称
  296. quoterName:"", // 报价专员
  297. startDate:"", // 开始日期
  298. endDate:"", // 结束日期
  299. dateValue:[],// 开始时间结束时间数组
  300. },
  301. tableData: [],// 查询的数据
  302. columnList: [
  303. {
  304. userId: this.$store.state.user.name,
  305. functionId: 101002001,
  306. serialNumber: '101002001Table5QuotationNo',
  307. tableId: '101002001Table5',
  308. tableName: '报价信息表',
  309. columnProp: 'quotationNo',
  310. headerAlign: 'center',
  311. align: 'center',
  312. columnLabel: '报价单号',
  313. columnHidden: false,
  314. columnImage: false,
  315. columnSortable: false,
  316. sortLv: 0,
  317. status: true,
  318. fixed: '',
  319. columnWidth: 120
  320. },
  321. {
  322. userId: this.$store.state.user.name,
  323. functionId: 101002001,
  324. serialNumber: '101002001Table5QuotationDate',
  325. tableId: '101002001Table5',
  326. tableName: '报价信息表',
  327. columnProp: 'quotationDate',
  328. headerAlign: 'center',
  329. align: 'center',
  330. columnLabel: '报价日期',
  331. columnHidden: false,
  332. columnImage: false,
  333. columnSortable: false,
  334. sortLv: 0,
  335. status: true,
  336. fixed: '',
  337. columnWidth: 100
  338. },
  339. {
  340. userId: this.$store.state.user.name,
  341. functionId: 101002001,
  342. serialNumber: '101002001Table5CustomerNo',
  343. tableId: '101002001Table5',
  344. tableName: '报价信息表',
  345. columnProp: 'customerNo',
  346. headerAlign: 'center',
  347. align: 'center',
  348. columnLabel: '客户编码',
  349. columnHidden: false,
  350. columnImage: false,
  351. columnSortable: false,
  352. sortLv: 0,
  353. status: true,
  354. fixed: '',
  355. columnWidth: 120
  356. },
  357. {
  358. userId: this.$store.state.user.name,
  359. functionId: 101002001,
  360. serialNumber: '101002001Table5CustomerName',
  361. tableId: '101002001Table5',
  362. tableName: '报价信息表',
  363. columnProp: 'customerName',
  364. headerAlign: 'center',
  365. align: 'center',
  366. columnLabel: '客户名称',
  367. columnHidden: false,
  368. columnImage: false,
  369. columnSortable: false,
  370. sortLv: 0,
  371. status: true,
  372. fixed: '',
  373. columnWidth: 120
  374. },{
  375. userId: this.$store.state.user.name,
  376. functionId: 101002001,
  377. serialNumber: '101002001Table5ProjectId',
  378. tableId: '101002001Table5',
  379. tableName: '报价信息表',
  380. columnProp: 'projectId',
  381. headerAlign: 'center',
  382. align: 'center',
  383. columnLabel: '项目编码',
  384. columnHidden: false,
  385. columnImage: false,
  386. columnSortable: false,
  387. sortLv: 0,
  388. status: true,
  389. fixed: '',
  390. columnWidth: 120
  391. },{
  392. userId: this.$store.state.user.name,
  393. functionId: 101002001,
  394. serialNumber: '101002001Table5ProjectName',
  395. tableId: '101002001Table5',
  396. tableName: '报价信息表',
  397. columnProp: 'projectName',
  398. headerAlign: 'center',
  399. align: 'center',
  400. columnLabel: '项目名称',
  401. columnHidden: false,
  402. columnImage: false,
  403. columnSortable: false,
  404. sortLv: 0,
  405. status: true,
  406. fixed: '',
  407. columnWidth: 120
  408. },
  409. {
  410. userId: this.$store.state.user.name,
  411. functionId: 101002001,
  412. serialNumber: '101002001Table5QuoterName',
  413. tableId: '101002001Table5',
  414. tableName: '报价信息表',
  415. columnProp: 'quoterName',
  416. headerAlign: 'center',
  417. align: 'center',
  418. columnLabel: '销售员',
  419. columnHidden: false,
  420. columnImage: false,
  421. columnSortable: false,
  422. sortLv: 0,
  423. status: true,
  424. fixed: '',
  425. columnWidth: 120
  426. },
  427. {
  428. userId: this.$store.state.user.name,
  429. functionId: 101002001,
  430. serialNumber: '101002001Table5TrackerName',
  431. tableId: '101002001Table5',
  432. tableName: '报价信息表',
  433. columnProp: 'trackerName',
  434. headerAlign: 'center',
  435. align: 'center',
  436. columnLabel: '跟单员',
  437. columnHidden: false,
  438. columnImage: false,
  439. columnSortable: false,
  440. sortLv: 0,
  441. status: true,
  442. fixed: '',
  443. columnWidth: 120
  444. },
  445. {
  446. userId: this.$store.state.user.name,
  447. functionId: 101002001,
  448. serialNumber: '101002001Table5Currency',
  449. tableId: '101002001Table5',
  450. tableName: '报价信息表',
  451. columnProp: 'currency',
  452. headerAlign: 'center',
  453. align: 'center',
  454. columnLabel: '货币',
  455. columnHidden: false,
  456. columnImage: false,
  457. columnSortable: false,
  458. sortLv: 0,
  459. status: true,
  460. fixed: '',
  461. columnWidth: 120
  462. },
  463. {
  464. userId: this.$store.state.user.name,
  465. functionId: 101002001,
  466. serialNumber: '101002001Table5QuotationStatus',
  467. tableId: '101002001Table5',
  468. tableName: '报价信息表',
  469. columnProp: 'quotationStatus',
  470. headerAlign: 'center',
  471. align: 'center',
  472. columnLabel: '状态',
  473. columnHidden: false,
  474. columnImage: false,
  475. columnSortable: false,
  476. sortLv: 0,
  477. status: true,
  478. fixed: '',
  479. columnWidth: 120
  480. },
  481. {
  482. userId: this.$store.state.user.name,
  483. functionId: 101002001,
  484. serialNumber: '101002001CustomerInquiryNo',
  485. tableId: '101002001Table5',
  486. tableName: '报价信息表',
  487. columnProp: 'customerInquiryNo',
  488. headerAlign: 'center',
  489. align: 'center',
  490. columnLabel: '客户报价单号',
  491. columnHidden: false,
  492. columnImage: false,
  493. columnSortable: false,
  494. sortLv: 0,
  495. status: true,
  496. fixed: '',
  497. columnWidth: 120
  498. },
  499. {
  500. userId: this.$store.state.user.name,
  501. functionId: 101002001,
  502. serialNumber: '101002001InternalInquiryNo',
  503. tableId: '101002001Table5',
  504. tableName: '报价信息表',
  505. columnProp: 'internalInquiryNo',
  506. headerAlign: 'center',
  507. align: 'center',
  508. columnLabel: '内部报价单号',
  509. columnHidden: false,
  510. columnImage: false,
  511. columnSortable: false,
  512. sortLv: 0,
  513. status: true,
  514. fixed: '',
  515. columnWidth: 120
  516. },
  517. ],
  518. initQuotationHeaderLoading:false,//表格加载状态
  519. // 分页信息
  520. no:1,//页码
  521. size:20,//每页条数
  522. total:0,//总页数
  523. // 表格高度
  524. height:400,
  525. // 标签页
  526. activeTabName:"quote_detail",
  527. //dialog 控制开关
  528. insertDiaLogFlag:false,
  529. quotationNoDialogFlag:false,
  530. // 新增对象
  531. insertData:{
  532. site:this.$store.state.user.site,
  533. quotationNo:"",//客户报价单号
  534. quotationDate:new Date(),//报价日期
  535. customerNo:"", // 客户编号
  536. customerName:"",//客户名称
  537. versionCode:"001",
  538. projectId:"",//项目编码
  539. projectName:"",//项目名称
  540. tracker:"",//跟单员
  541. quoter:"",//销售编号
  542. quoterName:"",//报价专员
  543. trackerName:"",//跟单员
  544. currency:"",//货币
  545. quotationStatus:"草稿",//状态
  546. remark:"",//备注
  547. customerInquiryNo:"",//客户询价单号
  548. internalInquiryNo:"",//内部询价单号
  549. internalInquiryBatchNo:"",//内部询价单号
  550. requireApproval:"",//需要审批
  551. approvalStatus:"",//审批状态
  552. createBy:this.$store.state.user.id,//当前登录账号
  553. createTime:new Date(),//当前时间
  554. },
  555. quotationHeaderColumns:[
  556. {label:"quotationNo",value:"客户报价单号"},
  557. {label:"quotationDate",value:"报价日期"},
  558. {label:"customerNo",value:"客户编码"},
  559. {label:"customerName",value:"客户名称"},
  560. {label:"versionCode",value:"版本号"},
  561. {label:"projectId",value:"项目编码"},
  562. {label:"projectName",value:"项目名称"},
  563. {label:"quoterName",value:"报价专员"},
  564. {label:"trackerName",value:"跟单员"},
  565. {label:"currency",value:"货币"},
  566. {label:"quotationStatus",value:"状态"},
  567. {label:"remark",value:"备注"},
  568. {label:"customerInquiryNo",value:"客户询价单号"},
  569. {label:"internalInquiryNo",value:"内部询价单号"},
  570. {label:"requireApproval",value:"需要审批"},
  571. {label:"approvalStatus",value:"审批状态"},
  572. {label:"createBy",value:"创建人"},
  573. {label:"createDate",value:"创建时间"},
  574. {label:"updateBy",value:"更新人"},
  575. {label:"updateDate",value:"更新时间"},
  576. ],
  577. // 规则
  578. rules: {
  579. customerNo: [
  580. { required: true,message:' '},
  581. ],
  582. customerName: [
  583. { required: true,message:' '},
  584. ],
  585. projectId:[
  586. { required: true,message:' '}
  587. ],
  588. projectName:[
  589. { required: true,message:' '}
  590. ],
  591. tracker:[
  592. { required: true,message:' '}
  593. ],
  594. trackerName:[
  595. { required: true,message:' '}
  596. ],
  597. currency:[
  598. { required: true,message:' '}
  599. ],
  600. quoter:[
  601. { required: true,message:' '}
  602. ],
  603. quoterName:[
  604. { required: true,message:' '}
  605. ],
  606. quotationStatus:[
  607. { required: true,message:' '}
  608. ],
  609. quotationDate:[
  610. { required: true,message:' '}
  611. ],
  612. },
  613. // 参数 选择框
  614. tagNo1:"",
  615. tagNo:"",
  616. // 内部报价单搜索表单对象
  617. quotationNoSearchData:{
  618. quotationNo:"",//单号
  619. quotationBatchNo:"",//批次号
  620. site:this.$store.state.user.site,//工厂编号
  621. },
  622. //内部报价单搜索表格数据对象
  623. quotationNoData:[],
  624. // 行对象
  625. quotationHeader:{},
  626. // 按钮防重复
  627. insertQuotationHeaderBtn:false,
  628. }
  629. },
  630. methods: {
  631. // 点击quotation行事件
  632. rowClickQuotation(row,column,event){
  633. if (column.label !== '操作'){
  634. this.quotationHeader = row;
  635. }
  636. },
  637. // 查询
  638. initDataBtn(){
  639. this.$route.params.ids = null;
  640. this.initData();
  641. },
  642. // 初始化数据
  643. initData(){
  644. let ids = ""
  645. if (this.$route.params.ids){
  646. ids = "?"
  647. for (let i = 0; i < this.$route.params.ids.length; i++) {
  648. ids+='ids='+this.$route.params.ids[i]+'&'
  649. }
  650. ids = ids.substring(0,ids.length-1);
  651. }
  652. let params = {
  653. no:this.no,
  654. size:this.size,
  655. site:this.$store.state.user.site,
  656. customerNo:this.searchData.customerNo,
  657. customerName:this.searchData.customerName,
  658. trackerName:this.searchData.trackerName,
  659. quotationNo:this.searchData.quotationNo,
  660. customerInquiryNo:this.searchData.customerInquiryNo,
  661. internalInquiryNo:this.searchData.internalInquiryNo,
  662. quotationStatus:this.searchData.quotationStatus,
  663. projectId:this.searchData.projectId,
  664. projectName:this.searchData.projectName,
  665. quoterName:this.searchData.quoterName,
  666. startDate:this.searchData.startDate,
  667. endDate: this.searchData.endDate,
  668. }
  669. this.init(params,ids)
  670. },
  671. init(params,ids){
  672. this.initQuotationHeaderLoading = true;
  673. getQuotationHeaderByPage(params,ids).then(({data})=>{
  674. this.tableData = data.data.records;
  675. this.total = data.data.total;
  676. if (this.tableData.length > 0){
  677. this.quotationHeader = this.tableData[0];
  678. }else {
  679. this.quotationHeader = null;
  680. }
  681. this.initQuotationHeaderLoading = false;
  682. }).catch((error)=>{
  683. this.initQuotationHeaderLoading = false;
  684. })
  685. },
  686. // 删除方法
  687. deleteQuotationHeader(row){
  688. this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
  689. confirmButtonText: '确定',
  690. cancelButtonText: '取消',
  691. type: 'warning'
  692. }).then(() => {
  693. deleteByQuotationHeaderId(row).then(({data})=>{
  694. if (data.code === 200){
  695. this.$message.success(data.msg);
  696. this.initData();
  697. }else {
  698. this.$message.error(data.msg);
  699. }
  700. })
  701. })
  702. },
  703. // 修改方法
  704. editQuotationHeader(row){
  705. this.insertData = JSON.parse(JSON.stringify(row));
  706. this.insertData.internalInquiryBatchNo = this.insertData.internalInquiryNo.split("-")[0]
  707. this.insertDiaLogFlag = true;
  708. },
  709. // size 发送改变
  710. quotationHeaderSizeChange(val){
  711. this.size = val;
  712. this.initData();
  713. },
  714. // no发生改变
  715. quotationHeaderCurrentChange(val){
  716. this.no = val;
  717. this.initData();
  718. },
  719. // 新增QuotationHeader
  720. saveQuotationHeader(){
  721. // 校验
  722. this.$refs['insertQuotationForm'].validate((valid,objects)=>{
  723. if (valid){
  724. this.insertQuotationHeaderBtn = true;
  725. // 请求
  726. saveQuotationHeader(this.insertData).then(({data})=>{
  727. // 返回提示
  728. if (data.code === 200){
  729. this.initData();
  730. this.insertQuotationHeaderBtn = false;
  731. this.insertDiaLogFlag = false;
  732. }
  733. this.$message.success(data.msg);
  734. })
  735. }else {
  736. this.rulesValidateLabel(objects,this.quotationHeaderColumns);
  737. }
  738. })
  739. },
  740. // 校验处理
  741. rulesValidateLabel(objects, labels) {
  742. for (let filed in objects) {
  743. for (let i = 0; i < labels.length; i++) {
  744. let quotationToolColumn = labels[i];
  745. if (quotationToolColumn.label === filed) {
  746. this.$message.warning(quotationToolColumn.value+"填写不正确");
  747. return
  748. }
  749. }
  750. }
  751. },
  752. // resetInsertData 重置新增对象
  753. resetInsertData(){
  754. this.insertData = {
  755. site:this.$store.state.user.site,
  756. quotationNo:"",//客户报价单号
  757. quotationDate:new Date(),//报价日期
  758. customerNo:"", // 客户编号
  759. customerName:"",//客户名称
  760. versionCode:"001",
  761. projectId:"",//项目编码
  762. projectName:"",//项目名称
  763. tracker:"",//跟单员
  764. quoter:"",//销售编号
  765. quoterName:"",//报价专员
  766. trackerName:"",//跟单员
  767. currency:"",//货币
  768. quotationStatus:"草稿",//状态
  769. remark:"",//备注
  770. customerInquiryNo:"",//客户询价单号
  771. internalInquiryNo:"",//内部询价单号
  772. requireApproval:"",//需要审批
  773. approvalStatus:"",//审批状态
  774. createBy:this.$store.state.user.id,//当前登录账号
  775. createDate:new Date(),//当前时间
  776. }
  777. },
  778. // 销售员输入框清除事件
  779. clearQuoter(){
  780. this.insertData.quoter = "";
  781. this.insertData.quoterName = "";
  782. },
  783. // 跟单员输入框清除事件
  784. clearTracker(){
  785. this.insertData.tracker = "";
  786. this.insertData.trackerName = "";
  787. },
  788. // 新增弹框关闭事件
  789. closeInsertDialog(){
  790. this.resetInsertData();
  791. this.$refs['insertQuotationForm'].resetFields();
  792. },
  793. // 点击标签页
  794. handleClickTab(tab, event){
  795. },
  796. // ======== chooseList相关方法 ========
  797. /**
  798. * 获取基础数据列表S
  799. * @param val
  800. * @param type
  801. */
  802. getBaseList (val, type) {
  803. this.tagNo = val
  804. this.tagNo1 = type
  805. this.$nextTick(() => {
  806. let strVal = ''
  807. if (val === 102) {
  808. if(type === 1) {
  809. strVal = this.insertData.customerNo
  810. }
  811. }
  812. if (val === 103) {
  813. if(type === 1) {
  814. strVal = this.insertData.tracker
  815. }
  816. if(type === 2) {
  817. strVal = this.insertData.quoter
  818. }
  819. }
  820. if (val === 104) {
  821. if(type === 1) {
  822. strVal = this.insertData.projectId
  823. }
  824. }
  825. this.$refs.baseList.init(val, strVal)
  826. })
  827. },
  828. /**
  829. * 列表方法的回调
  830. * @param val
  831. */
  832. getBaseData (val) {
  833. if (this.tagNo === 102) {
  834. if(this.tagNo1 === 1) {
  835. this.insertData.customerNo = val.Customer_no
  836. this.insertData.customerName = val.Customer_desc
  837. }
  838. }
  839. if (this.tagNo === 103) {
  840. if(this.tagNo1 === 1) {
  841. this.insertData.tracker = val.username
  842. this.insertData.trackerName = val.user_display
  843. }
  844. if(this.tagNo1 === 2) {
  845. this.insertData.quoter = val.username
  846. this.insertData.quoterName = val.user_display
  847. }
  848. }
  849. if (this.tagNo === 104) {
  850. if(this.tagNo1 === 1) {
  851. this.insertData.projectId = val.project_id
  852. this.insertData.projectName = val.project_name
  853. }
  854. }
  855. },
  856. // 查询 内部报价单编号
  857. searchQuotationData(){
  858. searchQuotationByQuotationNo(this.quotationNoSearchData).then(({data})=>{
  859. this.quotationNoData = data.data;
  860. })
  861. },
  862. // 打开 内部报价单拟态框
  863. openQuotationNoDialog(){
  864. // 请求
  865. this.searchQuotationData();
  866. },
  867. // 关闭
  868. closeQuotationNoDialog(){
  869. this.quotationNoSearchData = {
  870. quotationNo:"",//单号
  871. site:this.$store.state.user.site,//工厂编号
  872. }
  873. },
  874. // 询价表双击事件
  875. dblclickQuotationNo(row){
  876. this.insertData.customerNo = row.customerNo;
  877. this.insertData.customerName=row.customerDesc;//客户名称
  878. this.insertData.projectId=row.projectId;//项目编码
  879. this.insertData.projectName=row.projectName;//项目名称
  880. this.insertData.tracker=row.tracker;//跟单员
  881. this.insertData.trackerName=row.trackerName;
  882. this.insertData.quoter=row.quoter;//销售编号
  883. this.insertData.quoterName=row.quoterName;//销售编号
  884. this.insertData.internalInquiryNo=row.quotationNo;//内部询价单号
  885. this.insertData.internalInquiryBatchNo=row.quotationBatchNo;//内部询价单号
  886. this.insertData.currency=row.customerCurrency;//内部询价单号
  887. // 关闭弹框
  888. this.quotationNoDialogFlag = false;
  889. },
  890. quotationAgain(row){
  891. quotationAgain(row).then(({data})=>{
  892. if (data && data.code === 0){
  893. this.$message.success(data.msg)
  894. this.initData();
  895. }else {
  896. this.$alert(data.msg, '错误', {
  897. confirmButtonText: '确定'
  898. })
  899. }
  900. }).catch((error)=>{
  901. this.$message.error(error)
  902. })
  903. },
  904. },
  905. computed:{
  906. },
  907. mounted () {
  908. this.$nextTick(() => {
  909. this.height = window.innerHeight / 2 - 240;
  910. })
  911. },
  912. activated () {
  913. this.initData();//初始化数据
  914. },
  915. }
  916. </script>
  917. <style scoped>
  918. /deep/ .el-range-editor--mini.el-input__inner {
  919. height: 20px;
  920. }
  921. /deep/ .el-range-editor.el-input__inner{
  922. padding: 0px 10px;
  923. }
  924. /deep/ .el-input--mini .el-input__icon{
  925. line-height: 20px;
  926. }
  927. </style>