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.

808 lines
28 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
  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.internalInquiryNo" 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-button type="primary" style="padding: 3px 12px" @click="searchQuotationData">查询</el-button>
  338. </el-form-item>
  339. </el-form>
  340. <el-table :data="quotationNoData" stripe border @cell-dblclick="dblclickQuotationNo">
  341. <el-table-column prop="quotationNo" label="询价单号">
  342. </el-table-column>
  343. <el-table-column prop="projectName" label="项目名称">
  344. </el-table-column>
  345. </el-table>
  346. <el-footer style="height:30px;margin-top: 20px;text-align:center">
  347. <el-button type="primary" @click="quotationNoDialogFlag = false">关闭</el-button>
  348. </el-footer>
  349. </el-dialog>
  350. <!-- chooseList模态框 -->
  351. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  352. </div>
  353. </template>
  354. <script>
  355. import quotationDetail from "./sellForQuotation/quotationDetail.vue";
  356. import quotationExamineAndApprove from "./sellForQuotation/quotationExamineAndApprove.vue";
  357. import quotationProjectInformation from "./sellForQuotation/quotationProjectInformation.vue";
  358. import quotationCustomerInformation from "./sellForQuotation/quotationCustomerInformation.vue";
  359. import quotationCustomerContact from "./sellForQuotation/quotationCustomerContact.vue";
  360. import Chooselist from '@/views/modules/common/Chooselist';
  361. import {
  362. getQuotationHeaderByPage,
  363. saveQuotationHeader,
  364. deleteByQuotationHeaderId,
  365. } from '@/api/quotation/quotationHeader.js';
  366. import {
  367. searchQuotationByQuotationNo,
  368. } from '@/api/quotation/quotationInformation.js';
  369. export default {
  370. components:{
  371. Chooselist,
  372. quotationDetail,
  373. quotationExamineAndApprove,
  374. quotationProjectInformation,
  375. quotationCustomerInformation,
  376. quotationCustomerContact,
  377. },
  378. data () {
  379. return {
  380. searchFlag:false,
  381. // 搜索条件对象
  382. searchData:{
  383. site:this.$store.state.user.site,// 工厂编号
  384. customerNo:"", // 客户编码
  385. customer:"", // 客户名称
  386. tracker:"", // 跟单员
  387. quotationStatus:"", //状态
  388. projectId:"", // 项目编码
  389. projectName:"", // 项目名称
  390. quoterName:"", // 销售员
  391. startDate:"", // 开始日期
  392. endDate:"", // 结束日期
  393. dateValue:[],// 开始时间结束时间数组
  394. },
  395. tableData: [],// 查询的数据
  396. initQuotationHeaderLoading:false,//表格加载状态
  397. // 分页信息
  398. no:1,//页码
  399. size:20,//每页条数
  400. total:0,//总页数
  401. // 表格高度
  402. height:400,
  403. // 标签页
  404. activeTabName:"quotation_detail",
  405. //dialog 控制开关
  406. insertDiaLogFlag:false,
  407. quotationNoDialogFlag:false,
  408. // 新增对象
  409. insertData:{
  410. site:this.$store.state.user.site,
  411. quotationNo:"",//客户报价单号
  412. quotationDate:new Date(),//报价日期
  413. customerNo:"", // 客户编号
  414. customerName:"",//客户名称
  415. versionCode:"001",
  416. projectId:"",//项目编码
  417. projectName:"",//项目名称
  418. tracker:"",//跟单员
  419. quoter:"",//销售编号
  420. quoterName:"",//销售员
  421. trackerName:"",//跟单员
  422. currency:"",//货币
  423. quotationStatus:"草稿",//状态
  424. remark:"",//备注
  425. customerInquiryNo:"",//客户询价单号
  426. internalInquiryNo:"",//内部询价单号
  427. requireApproval:"",//需要审批
  428. approvalStatus:"",//审批状态
  429. createBy:this.$store.state.user.id,//当前登录账号
  430. createTime:new Date(),//当前时间
  431. },
  432. quotationHeaderColumns:[
  433. {label:"quotationNo",value:"客户报价单号"},
  434. {label:"quotationDate",value:"报价日期"},
  435. {label:"customerNo",value:"客户编码"},
  436. {label:"customerName",value:"客户名称"},
  437. {label:"versionCode",value:"版本号"},
  438. {label:"projectId",value:"项目编码"},
  439. {label:"projectName",value:"项目名称"},
  440. {label:"quoterName",value:"销售员"},
  441. {label:"trackerName",value:"跟单员"},
  442. {label:"currency",value:"货币"},
  443. {label:"quotationStatus",value:"状态"},
  444. {label:"remark",value:"备注"},
  445. {label:"customerInquiryNo",value:"客户询价单号"},
  446. {label:"internalInquiryNo",value:"内部询价单号"},
  447. {label:"requireApproval",value:"需要审批"},
  448. {label:"approvalStatus",value:"审批状态"},
  449. {label:"createBy",value:"创建人"},
  450. {label:"createDate",value:"创建时间"},
  451. {label:"updateBy",value:"更新人"},
  452. {label:"updateDate",value:"更新时间"},
  453. ],
  454. // 规则
  455. rules: {
  456. customerNo: [
  457. { required: true,message:' '},
  458. ],
  459. customerName: [
  460. { required: true,message:' '},
  461. ],
  462. projectId:[
  463. { required: true,message:' '}
  464. ],
  465. projectName:[
  466. { required: true,message:' '}
  467. ],
  468. tracker:[
  469. { required: true,message:' '}
  470. ],
  471. trackerName:[
  472. { required: true,message:' '}
  473. ],
  474. currency:[
  475. { required: true,message:' '}
  476. ],
  477. quoter:[
  478. { required: true,message:' '}
  479. ],
  480. quoterName:[
  481. { required: true,message:' '}
  482. ],
  483. quotationStatus:[
  484. { required: true,message:' '}
  485. ],
  486. quotationDate:[
  487. { required: true,message:' '}
  488. ],
  489. },
  490. // 参数 选择框
  491. tagNo1:"",
  492. tagNo:"",
  493. // 内部报价单搜索表单对象
  494. quotationNoSearchData:{
  495. quotationNo:"",//单号
  496. site:this.$store.state.user.site,//工厂编号
  497. },
  498. //内部报价单搜索表格数据对象
  499. quotationNoData:[],
  500. // 行对象
  501. quotationHeader:{},
  502. // 按钮防重复
  503. insertQuotationHeaderBtn:false,
  504. }
  505. },
  506. methods: {
  507. // 点击quotation行事件
  508. rowClickQuotation(row,column,event){
  509. if (column.label != '操作'){
  510. this.quotationHeader = row;
  511. }
  512. },
  513. // 搜索条件中的时间输入框 change事件
  514. changeDateRange(){
  515. if (this.searchData.dateValue){
  516. this.searchData.startDate = this.searchData.dateValue[0];
  517. this.searchData.endDate = this.searchData.dateValue[1];
  518. }else {
  519. this.searchData.startDate="";
  520. this.searchData.endDate="";
  521. }
  522. },
  523. // 查询
  524. initDataBtn(){
  525. this.$route.params.ids = null;
  526. this.initData();
  527. },
  528. // 初始化数据
  529. initData(){
  530. let ids = ""
  531. if (this.$route.params.ids){
  532. ids = "?"
  533. for (let i = 0; i < this.$route.params.ids.length; i++) {
  534. ids+='ids='+this.$route.params.ids[i]+'&'
  535. }
  536. ids = ids.substring(0,ids.length-1);
  537. }
  538. let params = {
  539. no:this.no,
  540. size:this.size,
  541. site:this.$store.state.user.site,
  542. customerNo:this.searchData.customerNo,
  543. customerName:this.searchData.customerName,
  544. trackerName:this.searchData.trackerName,
  545. quotationNo:this.searchData.quotationNo,
  546. customerInquiryNo:this.searchData.customerInquiryNo,
  547. internalInquiryNo:this.searchData.internalInquiryNo,
  548. quotationStatus:this.searchData.quotationStatus,
  549. projectId:this.searchData.projectId,
  550. projectName:this.searchData.projectName,
  551. quoterName:this.searchData.quoterName,
  552. startDate:this.searchData.startDate,
  553. endDate: this.searchData.endDate,
  554. }
  555. this.init(params,ids)
  556. },
  557. init(params,ids){
  558. this.initQuotationHeaderLoading = true;
  559. getQuotationHeaderByPage(params,ids).then(({data})=>{
  560. this.tableData = data.data.records;
  561. this.total = data.data.total;
  562. if (this.tableData.length > 0){
  563. this.quotationHeader = this.tableData[0];
  564. }else {
  565. this.quotationHeader = null;
  566. }
  567. this.initQuotationHeaderLoading = false;
  568. }).catch((error)=>{
  569. this.initQuotationHeaderLoading = false;
  570. })
  571. },
  572. // 删除方法
  573. deleteQuotationHeader(row){
  574. this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
  575. confirmButtonText: '确定',
  576. cancelButtonText: '取消',
  577. type: 'warning'
  578. }).then(() => {
  579. deleteByQuotationHeaderId(row).then(({data})=>{
  580. if (data.code == 200){
  581. this.$message.success(data.msg);
  582. this.initData();
  583. }else {
  584. this.$message.error(data.msg);
  585. }
  586. })
  587. })
  588. },
  589. // 修改方法
  590. editQuotationHeader(row){
  591. this.insertData = JSON.parse(JSON.stringify(row));
  592. this.insertDiaLogFlag = true;
  593. },
  594. // size 发送改变
  595. quotationHeaderSizeChange(val){
  596. this.size = val;
  597. this.initData();
  598. },
  599. // no发生改变
  600. quotationHeaderCurrentChange(val){
  601. this.no = val;
  602. this.initData();
  603. },
  604. // 新增QuotationHeader
  605. saveQuotationHeader(){
  606. // 校验
  607. this.$refs['insertQuotationForm'].validate((valid,objects)=>{
  608. if (valid){
  609. this.insertQuotationHeaderBtn = true;
  610. // 请求
  611. saveQuotationHeader(this.insertData).then(({data})=>{
  612. // 返回提示
  613. if (data.code === 200){
  614. this.initData();
  615. this.insertQuotationHeaderBtn = false;
  616. this.insertDiaLogFlag = false;
  617. }
  618. this.$message.success(data.msg);
  619. })
  620. }else {
  621. this.rulesValidateLabel(objects,this.quotationHeaderColumns);
  622. }
  623. })
  624. },
  625. // 校验处理
  626. rulesValidateLabel(objects, labels) {
  627. for (let filed in objects) {
  628. for (let i = 0; i < labels.length; i++) {
  629. let quotationToolColumn = labels[i];
  630. if (quotationToolColumn.label === filed) {
  631. this.$message.warning(quotationToolColumn.value+"填写不正确");
  632. return
  633. }
  634. }
  635. }
  636. },
  637. // resetInsertData 重置新增对象
  638. resetInsertData(){
  639. this.insertData = {
  640. site:this.$store.state.user.site,
  641. quotationNo:"",//客户报价单号
  642. quotationDate:new Date(),//报价日期
  643. customerNo:"", // 客户编号
  644. customerName:"",//客户名称
  645. versionCode:"001",
  646. projectId:"",//项目编码
  647. projectName:"",//项目名称
  648. tracker:"",//跟单员
  649. quoter:"",//销售编号
  650. quoterName:"",//销售员
  651. trackerName:"",//跟单员
  652. currency:"",//货币
  653. quotationStatus:"草稿",//状态
  654. remark:"",//备注
  655. customerInquiryNo:"",//客户询价单号
  656. internalInquiryNo:"",//内部询价单号
  657. requireApproval:"",//需要审批
  658. approvalStatus:"",//审批状态
  659. createBy:this.$store.state.user.id,//当前登录账号
  660. createDate:new Date(),//当前时间
  661. }
  662. },
  663. // 销售员输入框清除事件
  664. clearQuoter(){
  665. this.insertData.quoter = "";
  666. this.insertData.quoterName = "";
  667. },
  668. // 跟单员输入框清除事件
  669. clearTracker(){
  670. this.insertData.tracker = "";
  671. this.insertData.trackerName = "";
  672. },
  673. // 新增弹框关闭事件
  674. closeInsertDialog(){
  675. this.resetInsertData();
  676. this.$refs['insertQuotationForm'].resetFields();
  677. },
  678. // 点击标签页
  679. handleClickTab(tab, event){
  680. },
  681. // ======== chooseList相关方法 ========
  682. /**
  683. * 获取基础数据列表S
  684. * @param val
  685. * @param type
  686. */
  687. getBaseList (val, type) {
  688. this.tagNo = val
  689. this.tagNo1 = type
  690. this.$nextTick(() => {
  691. let strVal = ''
  692. if (val === 102) {
  693. if(type === 1) {
  694. strVal = this.insertData.customerNo
  695. }
  696. }
  697. if (val === 103) {
  698. if(type === 1) {
  699. strVal = this.insertData.tracker
  700. }
  701. if(type === 2) {
  702. strVal = this.insertData.quoter
  703. }
  704. }
  705. if (val === 104) {
  706. if(type === 1) {
  707. strVal = this.insertData.projectId
  708. }
  709. }
  710. this.$refs.baseList.init(val, strVal)
  711. })
  712. },
  713. /**
  714. * 列表方法的回调
  715. * @param val
  716. */
  717. getBaseData (val) {
  718. if (this.tagNo === 102) {
  719. if(this.tagNo1 === 1) {
  720. this.insertData.customerNo = val.Customer_no
  721. this.insertData.customerName = val.Customer_desc
  722. }
  723. }
  724. if (this.tagNo === 103) {
  725. if(this.tagNo1 === 1) {
  726. this.insertData.tracker = val.username
  727. this.insertData.trackerName = val.user_display
  728. }
  729. if(this.tagNo1 === 2) {
  730. this.insertData.quoter = val.username
  731. this.insertData.quoterName = val.user_display
  732. }
  733. }
  734. if (this.tagNo === 104) {
  735. if(this.tagNo1 === 1) {
  736. this.insertData.projectId = val.project_id
  737. this.insertData.projectName = val.project_name
  738. }
  739. }
  740. },
  741. // 查询 内部报价单编号
  742. searchQuotationData(){
  743. searchQuotationByQuotationNo(this.quotationNoSearchData).then(({data})=>{
  744. this.quotationNoData = data.data;
  745. })
  746. },
  747. // 打开 内部报价单拟态框
  748. openQuotationNoDialog(){
  749. // 请求
  750. this.searchQuotationData();
  751. },
  752. // 关闭
  753. closeQuotationNoDialog(){
  754. this.quotationNoSearchData = {
  755. quotationNo:"",//单号
  756. site:this.$store.state.user.site,//工厂编号
  757. }
  758. },
  759. // 询价表双击事件
  760. dblclickQuotationNo(row){
  761. this.insertData.customerNo = row.customerNo;
  762. this.insertData.customerName=row.customerDesc;//客户名称
  763. this.insertData.projectId=row.projectId;//项目编码
  764. this.insertData.projectName=row.projectName;//项目名称
  765. this.insertData.tracker=row.tracker;//跟单员
  766. this.insertData.trackerName=row.trackerName;
  767. this.insertData.quoter=row.quoter;//销售编号
  768. this.insertData.internalInquiryNo=row.quotationNo;//内部询价单号
  769. this.insertData.currency=row.customerCurrency;//内部询价单号
  770. // 关闭弹框
  771. this.quotationNoDialogFlag = false;
  772. }
  773. },
  774. computed:{
  775. },
  776. mounted () {
  777. this.$nextTick(() => {
  778. this.height = window.innerHeight / 2 - 240;
  779. })
  780. },
  781. activated () {
  782. this.initData();//初始化数据
  783. },
  784. }
  785. </script>
  786. <style scoped>
  787. /deep/ .el-range-editor--mini.el-input__inner {
  788. height: 20px;
  789. }
  790. /deep/ .el-range-editor.el-input__inner{
  791. padding: 0px 10px;
  792. }
  793. /deep/ .el-input--mini .el-input__icon{
  794. line-height: 20px;
  795. }
  796. </style>