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.

810 lines
27 KiB

1 year ago
1 year ago
1 year ago
  1. <template>
  2. <div class="mod-config">
  3. <!-- 工具申请界面-->
  4. <el-form label-position="top" :model="searchData">
  5. <el-row :gutter="18">
  6. <el-col :span="2">
  7. <el-form-item label="客户编码">
  8. <el-input v-model="searchData.customerNo" clearable />
  9. </el-form-item>
  10. </el-col>
  11. <el-col :span="2">
  12. <el-form-item label="客户名称">
  13. <el-input v-model="searchData.customerName" clearable />
  14. </el-form-item>
  15. </el-col>
  16. <el-col :span="2">
  17. <el-form-item label="跟单员">
  18. <el-input v-model="searchData.trackerName" clearable/>
  19. </el-form-item>
  20. </el-col>
  21. <el-col :span="2">
  22. <el-form-item label="报价单号">
  23. <el-input v-model="searchData.quotationNo" clearable />
  24. </el-form-item>
  25. </el-col>
  26. <el-col :span="2">
  27. <el-form-item label="客户询价单号">
  28. <el-input v-model="searchData.customerInquiryNo" clearable />
  29. </el-form-item>
  30. </el-col>
  31. <el-col :span="2">
  32. <el-form-item label="内部询价单号">
  33. <el-input v-model="searchData.internalInquiryNo" clearable/>
  34. </el-form-item>
  35. </el-col>
  36. </el-row>
  37. <el-row :gutter="18">
  38. <el-col :span="2">
  39. <el-form-item label="项目编码">
  40. <el-input v-model="searchData.projectId" clearable />
  41. </el-form-item>
  42. </el-col>
  43. <el-col :span="2">
  44. <el-form-item label="项目名称">
  45. <el-input v-model="searchData.projectName" clearable/>
  46. </el-form-item>
  47. </el-col>
  48. <el-col :span="2">
  49. <el-form-item label="报价专员">
  50. <el-input v-model="searchData.quoterName" size="large" clearable/>
  51. </el-form-item>
  52. </el-col>
  53. <el-col :span="4">
  54. <el-row>
  55. <el-col :span="11">
  56. <el-form-item label="开始日期">
  57. <el-date-picker
  58. value-format="yyyy-MM-dd"
  59. style="width: 100%"
  60. v-model="searchData.startDate"
  61. type="date"
  62. placeholder="开始日期">
  63. </el-date-picker>
  64. </el-form-item>
  65. </el-col>
  66. <el-col :span="2">
  67. <el-form-item label=" ">
  68. <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>
  69. </el-form-item>
  70. </el-col>
  71. <el-col :span="11">
  72. <el-form-item label="结束日期">
  73. <el-date-picker
  74. value-format="yyyy-MM-dd"
  75. style="width: 100%"
  76. v-model="searchData.endDate"
  77. type="date"
  78. placeholder="结束日期">
  79. </el-date-picker>
  80. </el-form-item>
  81. </el-col>
  82. </el-row>
  83. </el-col>
  84. <el-col :span="4">
  85. <el-form-item label=" ">
  86. <el-button plain type="primary" @click="initDataBtn" @keyup.enter.native="initDataBtn"> </el-button>
  87. <el-button type="primary" @click="applyModel">刀模申请</el-button>
  88. </el-form-item>
  89. </el-col>
  90. </el-row>
  91. </el-form>
  92. <el-table
  93. :data="dataList"
  94. :height="height"
  95. border
  96. @selection-change="selectionChangeHandle"
  97. v-loading="dataListLoading"
  98. style="width: 100%; ">
  99. <el-table-column
  100. type="selection"
  101. align="center"
  102. width="30">
  103. </el-table-column>
  104. <!-- <el-table-column-->
  105. <!-- v-for="(item,index) in columnList1" :key="index"-->
  106. <!-- :sortable="item.columnSortable"-->
  107. <!-- :prop="item.columnProp"-->
  108. <!-- :header-align="item.headerAlign"-->
  109. <!-- :show-overflow-tooltip="item.showOverflowTooltip"-->
  110. <!-- :align="item.align"-->
  111. <!-- :fixed="item.fixed==''?false:item.fixed"-->
  112. <!-- :min-width="item.columnWidth"-->
  113. <!-- :label="item.columnLabel">-->
  114. <!-- <template slot-scope="scope">-->
  115. <!-- <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>-->
  116. <!-- <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"-->
  117. <!-- style="width: 100px; height: 80px"/></span>-->
  118. <!-- </template>-->
  119. <!-- </el-table-column>-->
  120. <el-table-column
  121. align="center"
  122. prop="quotationNo"
  123. label="报价单号"
  124. min-width="110"
  125. show-overflow-tooltip>
  126. <template slot-scope="{row,$index}">
  127. {{row.quotationNo+'-'+row.versionCode}}
  128. </template>
  129. </el-table-column>
  130. <el-table-column
  131. align="center"
  132. prop="quotationDate"
  133. min-width="90"
  134. label="报价日期"
  135. show-overflow-tooltip>
  136. </el-table-column>
  137. <el-table-column
  138. align="center"
  139. prop="customerNo"
  140. min-width="80"
  141. show-overflow-tooltip
  142. label="客户编码">
  143. </el-table-column>
  144. <el-table-column
  145. align="left"
  146. prop="customerName"
  147. min-width="120"
  148. show-overflow-tooltip
  149. label="客户名称">
  150. </el-table-column>
  151. <el-table-column
  152. align="center"
  153. prop="projectId"
  154. min-width="90"
  155. show-overflow-tooltip
  156. label="项目编码">
  157. </el-table-column>
  158. <el-table-column
  159. align="left"
  160. prop="projectName"
  161. min-width="120"
  162. show-overflow-tooltip
  163. label="项目名称">
  164. </el-table-column>
  165. <el-table-column
  166. align="left"
  167. prop="quoterName"
  168. min-width="80"
  169. show-overflow-tooltip
  170. label="报价专员">
  171. </el-table-column>
  172. <el-table-column
  173. align="left"
  174. prop="trackerName"
  175. min-width="80"
  176. show-overflow-tooltip
  177. label="跟单员">
  178. </el-table-column>
  179. <el-table-column
  180. align="left"
  181. prop="currency"
  182. min-width="60"
  183. show-overflow-tooltip
  184. label="货币">
  185. </el-table-column>
  186. <el-table-column
  187. align="center"
  188. prop="quotationStatus"
  189. min-width="60"
  190. show-overflow-tooltip
  191. label="状态">
  192. </el-table-column>
  193. <el-table-column
  194. align="left"
  195. prop="remark"
  196. show-overflow-tooltip
  197. min-width="120"
  198. label="备注">
  199. </el-table-column>
  200. <el-table-column
  201. align="center"
  202. prop="customerInquiryNo"
  203. show-overflow-tooltip
  204. min-width="80"
  205. label="客户询价单号">
  206. </el-table-column>
  207. <el-table-column
  208. align="center"
  209. prop="internalInquiryNo"
  210. show-overflow-tooltip
  211. min-width="80"
  212. label="内部询价单号">
  213. </el-table-column>
  214. <!-- <el-table-column-->
  215. <!-- header-align="center"-->
  216. <!-- align="center"-->
  217. <!-- width="150"-->
  218. <!-- fixed="right"-->
  219. <!-- label="操作">-->
  220. <!-- <template slot-scope="scope">-->
  221. <!-- <a type="text" size="small" @click="updateModel(scope.row)">修改</a>-->
  222. <!-- <a type="text" size="small" @click="deleteData(scope.row)">删除</a>-->
  223. <!-- </template>-->
  224. <!-- </el-table-column>-->
  225. </el-table>
  226. <el-pagination
  227. @size-change="sizeChangeHandle"
  228. @current-change="currentChangeHandle"
  229. :current-page="pageIndex"
  230. :page-sizes="[20, 50, 100, 1000]"
  231. :page-size="pageSize"
  232. :total="totalPage"
  233. layout="total, sizes, prev, pager, next, jumper">
  234. </el-pagination>
  235. <el-dialog
  236. width="800px" v-drag
  237. :title="'刀模申请'"
  238. :close-on-click-modal="false"
  239. :visible.sync="visible">
  240. <el-form :inline="true" label-position="top" label-width="100px" >
  241. <el-form-item :label="'申请编号'">
  242. <el-input v-model="dataForm.applyNo" style="width: 130px" disabled></el-input>
  243. </el-form-item>
  244. <el-form-item :label="'申请人'" required="required">
  245. <el-input v-model="dataForm.applyBy" style="width: 130px" ></el-input>
  246. </el-form-item>
  247. <el-form-item :label="'申请日期'" required="required">
  248. <el-date-picker
  249. value-format="yyyy-MM-dd"
  250. style="width: 100%"
  251. v-model="dataForm.applyDate"
  252. type="date"
  253. placeholder="结束日期">
  254. </el-date-picker>
  255. </el-form-item>
  256. <el-form-item :label="'申请总数'">
  257. <el-input v-model="dataForm.applySumQty" style="width: 130px" disabled></el-input>
  258. </el-form-item>
  259. </el-form>
  260. <el-form :inline="true" label-position="top" label-width="100px" >
  261. <el-form-item :label="'申请原因'">
  262. <el-input v-model="dataForm.applyReason" style="width: 770px" ></el-input>
  263. </el-form-item>
  264. </el-form>
  265. <el-form :inline="true" label-position="top" label-width="100px" >
  266. <el-form-item :label="'备注'">
  267. <el-input v-model="dataForm.remark" style="width: 770px" ></el-input>
  268. </el-form-item>
  269. </el-form>
  270. <div class="rq">
  271. <el-table
  272. height="250"
  273. :data="toolData"
  274. border
  275. ref="toolTable"
  276. v-loading="dataListLoading"
  277. style="width: 100%;">
  278. <el-table-column label="报价单号" width="90" prop="quotationNo" show-overflow-tooltip/>
  279. <el-table-column label="产品编码" width="150" prop="productNo" show-overflow-tooltip/>
  280. <el-table-column label="工具编码" width="90" prop="toolNo" show-overflow-tooltip/>
  281. <el-table-column label="工具描述" width="120" prop="toolDescription" show-overflow-tooltip/>
  282. <el-table-column label="工具数量" width="60" prop="toolQuantity" show-overflow-tooltip/>
  283. <el-table-column label="申请数量" width="70" prop="applyQty" show-overflow-tooltip>
  284. <template slot-scope="scope">
  285. <el-input v-model="scope.row.applyQty" type="number" @change="changeSum(scope.row)" placeholder="请输入数量" onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')"
  286. style="width:98%"></el-input>
  287. </template>
  288. </el-table-column>
  289. <el-table-column label="产品名称" width="120" prop="productDesc" show-overflow-tooltip/>
  290. <el-table-column label="工具成本" width="60" prop="unitCost" show-overflow-tooltip/>
  291. <el-table-column label="单位报价成本" width="90" prop="quotationUnitCost" show-overflow-tooltip/>
  292. <el-table-column label="预计使用寿命" width="90" prop="expectedServiceLife" show-overflow-tooltip/>
  293. </el-table>
  294. </div>
  295. <span slot="footer" class="dialog-footer">
  296. <el-button type="primary" @click="saveData()">{{'保存'}}</el-button>
  297. <el-button type="primary" @click="visible = false">{{'取消'}}</el-button>
  298. </span>
  299. </el-dialog>
  300. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  301. </div>
  302. </template>
  303. <script>
  304. import {
  305. getQuotationHeaderForToolingInfo,
  306. getQuotationToolForApply,
  307. saveToolApply,
  308. } from "@/api/project/toolingInfo.js"
  309. import Chooselist from '@/views/modules/common/Chooselist'
  310. export default {
  311. components: {
  312. Chooselist
  313. },
  314. data() {
  315. return {
  316. height: 200,
  317. dataList: [],
  318. searchFlag:false,
  319. // 搜索条件对象
  320. searchData:{
  321. site:this.$store.state.user.site,// 工厂编号
  322. customerNo:"", // 客户编码
  323. customer:"", // 客户名称
  324. tracker:"", // 跟单员
  325. quotationStatus:"", //状态
  326. projectId:"", // 项目编码
  327. projectName:"", // 项目名称
  328. quoterName:"", // 报价专员
  329. startDate:"", // 开始日期
  330. endDate:"", // 结束日期
  331. dateValue:[],// 开始时间结束时间数组
  332. },
  333. exportList:[],
  334. pageIndex: 1,
  335. pageSize: 100,
  336. totalPage: 0,
  337. visible:false,
  338. dataListLoading: false,
  339. currentRow:'',
  340. columnList1:[
  341. {
  342. userId: this.$store.state.user.name,
  343. functionId: 106001,
  344. serialNumber: '106001Table4TestPartNo',
  345. tableId: "106001Table4",
  346. tableName: "项目物料",
  347. columnProp: "testPartNo",
  348. headerAlign: "center",
  349. align: "left",
  350. columnLabel: "物料编码",
  351. columnHidden: false,
  352. columnImage: false,
  353. columnSortable: false,
  354. sortLv: 0,
  355. status: true,
  356. fixed: '',
  357. columnWidth: 80
  358. },{
  359. userId: this.$store.state.user.name,
  360. functionId: 106001,
  361. serialNumber: '106001Table4PartType',
  362. tableId: "106001Table4",
  363. tableName: "项目物料",
  364. columnProp: "partType",
  365. headerAlign: "center",
  366. align: "left",
  367. columnLabel: "物料分类",
  368. columnHidden: false,
  369. columnImage: false,
  370. columnSortable: false,
  371. sortLv: 0,
  372. status: true,
  373. fixed: '',
  374. columnWidth: 60
  375. },{
  376. userId: this.$store.state.user.name,
  377. functionId: 106001,
  378. serialNumber: '106001Table4PartTypeDesc',
  379. tableId: "106001Table4",
  380. tableName: "项目物料",
  381. columnProp: "partTypeDesc",
  382. headerAlign: "center",
  383. align: "left",
  384. columnLabel: "物料分类名称",
  385. columnHidden: false,
  386. columnImage: false,
  387. columnSortable: false,
  388. sortLv: 0,
  389. status: true,
  390. fixed: '',
  391. columnWidth: 80
  392. },{
  393. userId: this.$store.state.user.name,
  394. functionId: 106001,
  395. serialNumber: '106001Table4PartName',
  396. tableId: "106001Table4",
  397. tableName: "项目物料",
  398. columnProp: "partName",
  399. headerAlign: "center",
  400. align: "left",
  401. columnLabel: "物料名称",
  402. columnHidden: false,
  403. columnImage: false,
  404. columnSortable: false,
  405. sortLv: 0,
  406. status: true,
  407. fixed: '',
  408. columnWidth: 120
  409. },{
  410. userId: this.$store.state.user.name,
  411. functionId: 106001,
  412. serialNumber: '106001Table4PartDesc',
  413. tableId: "106001Table4",
  414. tableName: "项目物料",
  415. columnProp: "partDesc",
  416. headerAlign: "center",
  417. align: "left",
  418. columnLabel: "物料描述",
  419. columnHidden: false,
  420. columnImage: false,
  421. columnSortable: false,
  422. sortLv: 0,
  423. status: true,
  424. fixed: '',
  425. columnWidth: 120
  426. },{
  427. userId: this.$store.state.user.name,
  428. functionId: 106001,
  429. serialNumber: '106001Table4PartSpec',
  430. tableId: "106001Table4",
  431. tableName: "项目物料",
  432. columnProp: "partSpec",
  433. headerAlign: "center",
  434. align: "left",
  435. columnLabel: "规格型号",
  436. columnHidden: false,
  437. columnImage: false,
  438. columnSortable: false,
  439. sortLv: 0,
  440. status: true,
  441. fixed: '',
  442. columnWidth: 120
  443. },{
  444. userId: this.$store.state.user.name,
  445. functionId: 106001,
  446. serialNumber: '106001Table4MaterialNumber',
  447. tableId: "106001Table4",
  448. tableName: "项目物料",
  449. columnProp: "materialNumber",
  450. headerAlign: "center",
  451. align: "left",
  452. columnLabel: "物料图号",
  453. columnHidden: false,
  454. columnImage: false,
  455. columnSortable: false,
  456. sortLv: 0,
  457. status: true,
  458. fixed: '',
  459. columnWidth: 120
  460. },{
  461. userId: this.$store.state.user.name,
  462. functionId: 106001,
  463. serialNumber: '106001Table4Remark',
  464. tableId: "106001Table4",
  465. tableName: "项目物料",
  466. columnProp: "remark",
  467. headerAlign: "center",
  468. align: "left",
  469. columnLabel: "备注",
  470. columnHidden: false,
  471. columnImage: false,
  472. columnSortable: false,
  473. sortLv: 0,
  474. status: true,
  475. fixed: '',
  476. columnWidth: 120
  477. },{
  478. userId: this.$store.state.user.name,
  479. functionId: 106001,
  480. serialNumber: '106001Table4CreateDate',
  481. tableId: "106001Table4",
  482. tableName: "项目物料",
  483. columnProp: "createDate",
  484. headerAlign: "center",
  485. align: "left",
  486. columnLabel: "创建时间",
  487. columnHidden: false,
  488. columnImage: false,
  489. columnSortable: false,
  490. sortLv: 0,
  491. status: true,
  492. fixed: '',
  493. columnWidth: 160
  494. },{
  495. userId: this.$store.state.user.name,
  496. functionId: 106001,
  497. serialNumber: '106001Table4CreateBy',
  498. tableId: "106001Table4",
  499. tableName: "项目物料",
  500. columnProp: "createBy",
  501. headerAlign: "center",
  502. align: "left",
  503. columnLabel: "创建人",
  504. columnHidden: false,
  505. columnImage: false,
  506. columnSortable: false,
  507. sortLv: 0,
  508. status: true,
  509. fixed: '',
  510. columnWidth: 80
  511. },{
  512. userId: this.$store.state.user.name,
  513. functionId: 106001,
  514. serialNumber: '106001Table4UpdateDate',
  515. tableId: "106001Table4",
  516. tableName: "项目物料",
  517. columnProp: "updateDate",
  518. headerAlign: "center",
  519. align: "left",
  520. columnLabel: "上次修改日期",
  521. columnHidden: false,
  522. columnImage: false,
  523. columnSortable: false,
  524. sortLv: 0,
  525. status: true,
  526. fixed: '',
  527. columnWidth: 160
  528. },{
  529. userId: this.$store.state.user.name,
  530. functionId: 106001,
  531. serialNumber: '106001Table4UpdateBy',
  532. tableId: "106001Table4",
  533. tableName: "项目物料",
  534. columnProp: "updateBy",
  535. headerAlign: "center",
  536. align: "left",
  537. columnLabel: "修改人",
  538. columnHidden: false,
  539. columnImage: false,
  540. columnSortable: false,
  541. sortLv: 0,
  542. status: true,
  543. fixed: '',
  544. columnWidth: 80
  545. },
  546. ],
  547. dataForm:{
  548. site: '',
  549. applyNo: '',
  550. applyBy:'',
  551. applyDate:'',
  552. applySumQty:'',
  553. applyReason:'',
  554. remark:'',
  555. createBy:'',
  556. detailList:[],
  557. },
  558. toolData:[],
  559. dataListSelections:[],
  560. dataRole: {
  561. partTypeDesc: [
  562. {
  563. required: true,
  564. message: ' ',
  565. trigger: 'change'
  566. }
  567. ],
  568. partName: [
  569. {
  570. required: true,
  571. message: ' ',
  572. trigger: 'change'
  573. }
  574. ],
  575. },
  576. // 导出 start
  577. exportData: [],
  578. exportName: '项目物料'+this.dayjs().format('YYYYMMDDHHmmss'),
  579. exportHeader: ["项目物料"],
  580. exportFooter: [],
  581. // 导出 end
  582. }
  583. },
  584. mounted() {
  585. this.$nextTick(() => {
  586. this.height = window.innerHeight - 230;
  587. })
  588. },
  589. methods: {
  590. // 获取基础数据列表S
  591. getBaseList (val, type) {
  592. this.tagNo = val
  593. this.tagNo1 = type
  594. this.$nextTick(() => {
  595. let strVal = ''
  596. if (val === 1013) {
  597. if(type==1) {
  598. strVal = this.dataForm.partType
  599. }
  600. }
  601. this.$refs.baseList.init(val, strVal)
  602. })
  603. },
  604. /* 列表方法的回调 */
  605. getBaseData (val) {
  606. if (this.tagNo === 1013) {
  607. if(this.tagNo1==1) {
  608. this.dataForm.partType = val.Base_id
  609. this.dataForm.partTypeDesc = val.Base_desc
  610. }
  611. }
  612. },
  613. selectionChangeHandle (val) {
  614. this.dataListSelections = val
  615. },
  616. // 每页数
  617. sizeChangeHandle (val) {
  618. this.pageSize = val
  619. this.pageIndex = 1
  620. this.search()
  621. },
  622. // 当前页
  623. currentChangeHandle (val) {
  624. this.pageIndex = val
  625. this.search()
  626. },
  627. initDataBtn(){
  628. this.$route.params.ids = null;
  629. this.initData();
  630. },
  631. // 初始化数据
  632. initData(){
  633. let ids = ""
  634. if (this.$route.params.ids){
  635. ids = "?"
  636. for (let i = 0; i < this.$route.params.ids.length; i++) {
  637. ids+='ids='+this.$route.params.ids[i]+'&'
  638. }
  639. ids = ids.substring(0,ids.length-1);
  640. }
  641. let params = {
  642. no:this.no,
  643. size:this.size,
  644. site:this.$store.state.user.site,
  645. customerNo:this.searchData.customerNo,
  646. customerName:this.searchData.customerName,
  647. trackerName:this.searchData.trackerName,
  648. quotationNo:this.searchData.quotationNo,
  649. customerInquiryNo:this.searchData.customerInquiryNo,
  650. internalInquiryNo:this.searchData.internalInquiryNo,
  651. quotationStatus:this.searchData.quotationStatus,
  652. projectId:this.searchData.projectId,
  653. projectName:this.searchData.projectName,
  654. quoterName:this.searchData.quoterName,
  655. startDate:this.searchData.startDate,
  656. endDate: this.searchData.endDate,
  657. }
  658. this.init(params,ids)
  659. },
  660. init(params,ids){
  661. this.initQuotationHeaderLoading = true;
  662. getQuotationHeaderForToolingInfo(params,ids).then(({data})=>{
  663. this.dataList = data.data.records;
  664. this.total = data.data.total;
  665. if (this.tableData.length > 0){
  666. this.quotationHeader = this.tableData[0];
  667. }else {
  668. this.quotationHeader = null;
  669. }
  670. this.initQuotationHeaderLoading = false;
  671. }).catch((error)=>{
  672. this.initQuotationHeaderLoading = false;
  673. })
  674. },
  675. applyModel() {
  676. if(this.dataListSelections.length===0){
  677. this.$alert('请选择项目!', '错误', {
  678. confirmButtonText: '确定'
  679. })
  680. return false;
  681. }
  682. getQuotationToolForApply(this.dataListSelections).then(({data}) => {
  683. if (data.code == 0) {
  684. this.toolData=data.rows
  685. }
  686. })
  687. this.dataForm={
  688. site: this.$store.state.user.site,
  689. applyNo: '',
  690. applyBy:this.$store.state.user.name,
  691. applyDate:new Date(),
  692. applySumQty:0,
  693. applyReason:'',
  694. remark:'',
  695. createBy:this.$store.state.user.name,
  696. detailList:[],
  697. };
  698. this.visible=true;
  699. },
  700. changeSum(row){
  701. // if(row.applyQty!=null&&row.applyQty!==''&& row.toolQuantity<row.applyQty){
  702. // row.applyQty=''
  703. // this.$alert(data.msg, '错误', {
  704. // confirmButtonText: '确定'
  705. // })
  706. //
  707. // }
  708. this.dataForm.applySumQty =0
  709. for (const item of this.toolData) {
  710. // 累加之前先确保值存在,并将 null 或 undefined 转换为0
  711. this.dataForm.applySumQty += Number(item.applyQty != null && item.applyQty !== '' ? item.applyQty : 0);
  712. }
  713. },
  714. saveData(){
  715. // for (let i = 0; i < this.toolData.length; i++) {
  716. // if(this.toolData[i].toolQuantity<this.toolData[i].applyQty){
  717. // this.$alert( '工具:'+this.toolData[i].toolNo +' 实际申请数量大于表单工具数量!', '错误', {
  718. // confirmButtonText: '确定'
  719. // })
  720. // return false;
  721. // }
  722. // }
  723. if(this.dataForm.applySumQty===0){
  724. this.$alert('未填写申请数量!', '错误', {
  725. confirmButtonText: '确定'
  726. })
  727. return false;
  728. }
  729. if(this.dataForm.applyBy===''||this.dataForm.applyBy==null){
  730. this.$alert('未选择申请人!', '错误', {
  731. confirmButtonText: '确定'
  732. })
  733. return false;
  734. }
  735. if(this.dataForm.applyDate===''||this.dataForm.applyDate==null){
  736. this.$alert('未选择申请日期!', '错误', {
  737. confirmButtonText: '确定'
  738. })
  739. return false;
  740. }
  741. this.$confirm('确定要保存?', '提示', {
  742. confirmButtonText: '确定',
  743. cancelButtonText: '取消',
  744. type: 'warning'
  745. }).then(() => {
  746. for (let i = 0; i < this.toolData.length; i++) {
  747. if (this.toolData[i].applyQty===''||this.toolData[i].applyQty==null){
  748. this.toolData[i].applyQty=0
  749. }
  750. }
  751. this.dataForm.detailList=JSON.parse(JSON.stringify(this.toolData))
  752. saveToolApply(this.dataForm).then(({data}) => {
  753. if (data && data.code == 0) {
  754. this.visible=false;
  755. this.initDataBtn();
  756. this.$message({
  757. message: '操作成功',
  758. type: 'success',
  759. duration: 1500,
  760. onClose: () => {
  761. }
  762. })
  763. } else {
  764. this.$alert(data.msg, '错误', {
  765. confirmButtonText: '确定'
  766. })
  767. }
  768. })
  769. }).catch(() => {
  770. })
  771. },
  772. //导出excel
  773. //导出excel
  774. async createExportData() {
  775. // this.searchData.limit = -1
  776. // this.searchData.page = 1
  777. // await projectInfoSearch(this.searchData).then(({data}) => {
  778. // this.exportList= data.page.list;
  779. // })
  780. //
  781. // return this.exportList;
  782. },
  783. startDownload() {
  784. // this.exportData = this.dataList
  785. },
  786. finishDownload() {
  787. },
  788. fields() {
  789. let json = "{"
  790. this.columnList1.forEach((item, index) => {
  791. if (index == this.columnList1.length - 1) {
  792. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  793. } else {
  794. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  795. }
  796. })
  797. json += "}"
  798. let s = eval("(" + json + ")")
  799. return s
  800. },
  801. },
  802. }
  803. </script>
  804. <style scoped>
  805. </style>