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.

816 lines
29 KiB

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