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.

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