index.vue 41 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424
  1. <template>
  2. <div>
  3. <div v-if="pageDisplay" class="app-container">
  4. <formComponent
  5. v-if="searchWhether"
  6. :formOption="formOption"
  7. :dataList="dataList"
  8. :inDex="inDex"
  9. ref="avatar"
  10. @submitForm="submitForm"
  11. @returnToForm="returnToForm"
  12. />
  13. <listComponent
  14. :tableData="tableData"
  15. @selectionbox="selectionbox"
  16. @see="viewMethod"
  17. @modify="modification"
  18. @deletion="deletion"
  19. @buttonList="buttonList"
  20. @showSearch="showSearch"
  21. @feedback="feedback"
  22. @getList="getList"
  23. :hasPermi="hasPermi"
  24. :isItHidden="isItHidden"
  25. :customButton="customButton"
  26. :listStyle="listStyle"
  27. :queryList="queryList"
  28. :setRowList="setRowList"
  29. />
  30. <el-pagination
  31. style="float: right;margin-top: 10px"
  32. @size-change="handleSizeChange"
  33. @current-change="handleCurrentChange"
  34. :page-sizes="[10, 20, 30, 50]"
  35. :page-size="this.formDataList.pageSize"
  36. background
  37. layout="sizes, prev, pager, next"
  38. :total="total">
  39. </el-pagination>
  40. </div>
  41. <div v-else class="app-container">
  42. <formComponent
  43. v-if="searchWhether"
  44. :formOption="contentOption"
  45. :dataList="dataList"
  46. :inDex="inDex"
  47. ref="avatar"
  48. @writeOff="writeOff"
  49. @submitForm="submitForm"
  50. @returnToForm="returnToForm"
  51. @submitAndSave="submitAndSave"
  52. @selectTrigger="selectTrigger"
  53. />
  54. <listComponent
  55. ref="listComponent"
  56. :tableData="contentList"
  57. @selectionbox="selectionbox"
  58. @see="viewMethod"
  59. @modify="modification"
  60. @deletion="deletion"
  61. @buttonList="buttonList"
  62. @showSearch="showSearch"
  63. @feedback="feedback"
  64. @getList="getList"
  65. @deletRows="deletRows"
  66. @totalAmount="totalAmount"
  67. @change="change"
  68. :hasPermi="hasPermi"
  69. :tatolLabel="tatolLabel"
  70. :isItHidden="isItHidden"
  71. :customButton="contentButton"
  72. :listStyle="contentStyle"
  73. :queryList="purchaseList"
  74. :setRowList="setRowList"
  75. :listData="listData"
  76. />
  77. </div>
  78. <add-or-update
  79. v-if="addOrUpdateVisible"
  80. ref="addOrUpdate"
  81. @refreshDataList="getDataList"
  82. ></add-or-update>
  83. <approval-comments
  84. v-if="addOrUpdateVisib"
  85. ref="ApprovalComments"
  86. @refreshDataList="returnData"
  87. ></approval-comments>
  88. <el-dialog
  89. title="打印采购"
  90. :visible.sync="dialogVisible"
  91. :fullscreen="true"
  92. style="padding: 0;margin:0"
  93. width="70%">
  94. <div ref="print">
  95. <table class="table table-striped table-bordered" align="center" valign="center">
  96. <tr>
  97. <td style="font-size: 24px;font-weight:bold" class="column" colspan="6">采购表</td>
  98. </tr>
  99. <tr>
  100. <td class="column" style="width: 10%;">项目</td>
  101. <td class="column" style="width: 25%;">{{formList.projectName}}</td>
  102. <td class="column" style="width: 10%;">供应商</td>
  103. <td class="column" style="width: 25%;">{{ formList.corpName }}</td>
  104. <td class="column" style="width: 25%;" colspan="2">日期:{{formList.fBsdate}}</td>
  105. </tr>
  106. </table>
  107. <table class="table table-striped table-bordered" align="center" valign="center">
  108. <tr>
  109. <td class="column" style="width: 15%;border-top: none;">品名</td>
  110. <td class="column" style="width: 15%;border-top: none;">单价</td>
  111. <td class="column" style="width: 15%;border-top: none;">采购计划</td>
  112. <td class="column" style="width: 15%;border-top: none;">实际重量</td>
  113. <td class="column" style="width: 15%;border-top: none;">金额</td>
  114. <td class="column" style="width: 20%;border-top: none;">备注</td>
  115. </tr>
  116. <tr v-for="(item,index) in contentList" :key="index">
  117. <td class="column">{{item.feeName}}</td>
  118. <td class="column">{{item.fUnitprice}}</td>
  119. <td class="column">{{item.fPurchase}}({{item.fFeeunitName}})</td>
  120. <td class="column">{{item.fQty}}({{item.fFeeunitName}})</td>
  121. <td class="column">{{item.fAmount}}</td>
  122. <td class="column">{{item.remark}}</td>
  123. </tr>
  124. </table>
  125. <table class="table table-striped table-bordered" align="center" valign="center">
  126. <tr>
  127. <td colspan="6" style="border-top: none;" class="column"></td>
  128. </tr>
  129. <tr>
  130. <td class="column" style="width: 25%;">采购人签字</td>
  131. <td class="column" style="width: 25%;">厨房主管签字</td>
  132. <td class="column" style="width: 25%;">验收人签字</td>
  133. <td class="column" style="width: 25%;">主管签字</td>
  134. </tr>
  135. <tr>
  136. <td class="column" style="width: 25%;height: 37px;"></td>
  137. <td class="column" style="width: 25%;"></td>
  138. <td class="column" style="width: 25%;"></td>
  139. <td class="column" style="width: 25%;"></td>
  140. </tr>
  141. <tr>
  142. <td colspan="4" style="border-top: none;font-weight:bold;text-align: right;padding-right: 10%;font-size: 16px;" class="column">{{ formList.fsbuName }}</td>
  143. </tr>
  144. </table>
  145. </div>
  146. <span slot="footer" class="dialog-footer">
  147. <el-button @click="dialogVisible = false">取 消</el-button>
  148. <el-button type="primary" @click="Printing">打印</el-button>
  149. </span>
  150. </el-dialog>
  151. </div>
  152. </template>
  153. <script>
  154. import { select } from '@/api/system/set'
  155. import {
  156. listQuery,
  157. submit,
  158. viewSingle,
  159. deleteQuery,
  160. productName,
  161. queryItem,
  162. company,
  163. warehouse,
  164. listDelete,
  165. tableDeleteQuery,
  166. confirmDeletion,
  167. pleaseCheck,
  168. copyNew,
  169. revoke,
  170. withdrawBy
  171. } from '@/api/purchaseRequest/index'
  172. import Cookies from 'js-cookie'
  173. export default {
  174. name: 'index',
  175. data() {
  176. return {
  177. addOrUpdateVisible: false,
  178. addOrUpdateVisib: false,
  179. total:0,
  180. selection:[],
  181. formDataList:{
  182. fBilltype: 'SQ',
  183. pageSize:10,
  184. pageNum:1,
  185. },
  186. formList:{},
  187. tatolLabel:['金额'],
  188. dialogVisible: false,
  189. listData: {
  190. fFeeid: [],
  191. fFeeunitid: [],
  192. fStltypeid: []
  193. },
  194. hasPermi:{
  195. lookup:['anpin:stockControl:query'],
  196. disappear:['anpin:stockControl:remove']
  197. },
  198. setTimeout:'',
  199. searchWhether: true,
  200. pageDisplay: true,
  201. dataList: {
  202. fGoodsid: [],
  203. fSbu: [],
  204. fWarehouseid: [],
  205. fCorpid: []
  206. },
  207. contentList: [],
  208. inDex: 4,
  209. tableData: [],
  210. tableList: [],
  211. isItHidden: true,
  212. listStyle: [
  213. {
  214. surface: '1',
  215. label: 'serialNumber',
  216. name: '序号',
  217. checked: 0,
  218. width: 100,
  219. onabort: ''
  220. }, {
  221. surface: '2',
  222. label: 'fBillno',
  223. name: '申请编号',
  224. checked: 0,
  225. width: 100,
  226. onabort: ''
  227. }, {
  228. surface: '3',
  229. label: 'projectName',
  230. name: '项目名称',
  231. checked: 0,
  232. width: 100,
  233. onabort: ''
  234. }, {
  235. surface: '4',
  236. label: 'corpName',
  237. name: '客户名称',
  238. checked: 0,
  239. width: 100,
  240. onabort: ''
  241. }, {
  242. surface: '5',
  243. label: 'fMoney',
  244. name: '金额',
  245. checked: 0,
  246. width: 100,
  247. onabort: ''
  248. }, {
  249. surface: '6',
  250. label: 'createTime',
  251. name: '申请日期',
  252. checked: 0,
  253. width: 100,
  254. onabort: ''
  255. },{
  256. surface: '7',
  257. label: 'createBy',
  258. name: '申请人',
  259. checked: 0,
  260. width: 100,
  261. onabort: ''
  262. }, {
  263. surface: '8',
  264. label: 'fReviewDate',
  265. name: '审核日期',
  266. checked: 0,
  267. width: 100,
  268. onabort: ''
  269. },{
  270. surface: '9',
  271. label: 'remark',
  272. name: '备注',
  273. checked: 0,
  274. width: 100,
  275. onabort: ''
  276. },{
  277. surface: '10',
  278. label: 'fBillstatusName',
  279. name: '状态',
  280. checked: 0,
  281. width: 100,
  282. onabort: ''
  283. },{
  284. surface: '11',
  285. label: 'operation',
  286. name: '操作',
  287. checked: 0,
  288. width: 160,
  289. fixed:'right',
  290. operation: '1',
  291. onabort: ''
  292. }
  293. ],
  294. contentStyle: [
  295. {
  296. surface: '1',
  297. label: 'serialNumber',
  298. name: '序号',
  299. checked: 0,
  300. width: 100,
  301. disabled: false,
  302. onabort: ''
  303. }, {
  304. surface: '2',
  305. label: 'fFeeid',
  306. name: '品名',
  307. checked: 0,
  308. width: 100,
  309. onabort: '',
  310. disabled: false,
  311. changeable: 1
  312. }, {
  313. surface: '3',
  314. label: 'fUnitprice',
  315. name: '单价',
  316. checked: 0,
  317. width: 100,
  318. disabled: false,
  319. onabort: 'this.value=this.value.replace(/[^\\-?\\d.]/g,"").replace(/^(\\-)*(\\d+)\\.(\\d\\d).*$/, "$1$2.$3")',
  320. changeable: 2
  321. }, {
  322. surface: '4',
  323. label: 'fPurchase',
  324. name: '采购数量',
  325. checked: 0,
  326. width: 100,
  327. onabort: '',
  328. disabled: false,
  329. changeable: 2
  330. }, {
  331. surface: '5',
  332. label: 'fQty',
  333. name: '实际数量',
  334. checked: 0,
  335. width: 100,
  336. onabort: 'this.value=this.value.replace(/[^\\-?\\d.]/g,"").replace(/^(\\-)*(\\d+)\\.(\\d\\d).*$/, "$1$2.$3")',
  337. disabled: false,
  338. changeable: 2
  339. }, {
  340. surface: '6',
  341. label: 'fFeeunitid',
  342. name: '计量单位',
  343. checked: 0,
  344. width: 100,
  345. onabort: '',
  346. disabled: false,
  347. changeable: 1
  348. }, {
  349. surface: '7',
  350. label: 'fAmount',
  351. name: '金额',
  352. checked: 0,
  353. width: 100,
  354. onabort: 'this.value=this.value.replace(/[^\\-?\\d.]/g,"").replace(/^(\\-)*(\\d+)\\.(\\d\\d).*$/, "$1$2.$3")',
  355. disabled: false,
  356. changeable: 2
  357. }, {
  358. surface: '8',
  359. label: 'fStltypeid',
  360. name: '付费方式',
  361. checked: 0,
  362. width: 100,
  363. onabort: '',
  364. disabled: false,
  365. changeable: 1
  366. }, {
  367. surface: '9',
  368. label: 'remark',
  369. name: '备注',
  370. checked: 0,
  371. width: 100,
  372. onabort: '',
  373. disabled: false,
  374. changeable: 2
  375. }, {
  376. surface: '10',
  377. label: 'createTime',
  378. name: '申请日期',
  379. checked: 0,
  380. disabled: false,
  381. width: 100,
  382. onabort: ''
  383. }, {
  384. surface: '11',
  385. label: 'createBy',
  386. name: '申请人',
  387. disabled: false,
  388. checked: 0,
  389. width: 100,
  390. onabort: ''
  391. }, {
  392. surface: '12',
  393. label: 'fReviewDate',
  394. name: '审核日期',
  395. checked: 0,
  396. disabled: false,
  397. width: 100,
  398. onabort: ''
  399. }, {
  400. surface: '13',
  401. label: 'operation',
  402. name: '操作',
  403. checked: 0,
  404. disabled: false,
  405. width: 160,
  406. fixed:'right',
  407. operation: '2',
  408. onabort: ''
  409. }
  410. ],
  411. queryList: {
  412. tableName: '采购申请',
  413. columnList: []
  414. },
  415. purchaseList: {
  416. tableName: '采购申请详情',
  417. columnList: []
  418. },
  419. setRowList: [],
  420. customButton: [
  421. {
  422. type: 'primary',
  423. size: 'mini',
  424. icon: 'el-icon-edit',
  425. name: '新增',
  426. disabled: false,
  427. hasPermi:['anpin:stockControl:anPingApply']
  428. },
  429. // {
  430. // type:'warning',
  431. // size:'mini',
  432. // icon:'el-icon-edit',
  433. // name:'立即修改',
  434. // disabled:false,
  435. // },
  436. {
  437. type: 'warning',
  438. size: 'mini',
  439. icon: 'el-icon-upload2',
  440. name: '导出',
  441. disabled: false,
  442. hasPermi:['anpin:stockControl:export']
  443. }, {
  444. type: 'success',
  445. size: 'mini',
  446. icon: 'el-icon-c-scale-to-original',
  447. name: '复制新增',
  448. disabled: false,
  449. hasPermi:['anpin:stockControl:generateReceipts']
  450. }
  451. ],
  452. contentButton: [
  453. {
  454. type: 'danger',
  455. size: 'mini',
  456. icon: 'el-icon-arrow-left',
  457. name: '返回列表',
  458. disabled: false
  459. }, {
  460. type: 'primary',
  461. size: 'mini',
  462. icon: 'el-icon-plus',
  463. name: '录入',
  464. disabled: false
  465. }, {
  466. type: 'primary',
  467. size: 'mini',
  468. icon: 'el-icon-plus',
  469. name: '保存',
  470. plain: true,
  471. disabled: false
  472. }, {
  473. type: 'success',
  474. size: 'mini',
  475. icon: 'el-icon-edit',
  476. name: '修改',
  477. disabled: false
  478. }, {
  479. type: 'warning',
  480. size: 'mini',
  481. icon: 'el-icon-download',
  482. name: '导出',
  483. disabled: false
  484. },{
  485. type: 'info',
  486. size: 'mini',
  487. icon: 'el-icon-edit-outline',
  488. name: '打印',
  489. disabled: false
  490. },{
  491. type: 'primary',
  492. size: 'mini',
  493. icon: 'el-icon-edit-outline',
  494. name: '请核',
  495. disabled: false
  496. },{
  497. type: 'primary',
  498. size: 'mini',
  499. icon: 'el-icon-edit-outline',
  500. name: '查看审批',
  501. disabled: false
  502. },{
  503. type: 'info',
  504. size: 'mini',
  505. icon: 'el-icon-edit-outline',
  506. name: '生成入库单',
  507. disabled: false
  508. },{
  509. type: 'info',
  510. size: 'mini',
  511. icon: 'el-icon-edit-outline',
  512. name: '生成销售单',
  513. disabled: false
  514. },{
  515. type: 'info',
  516. size: 'mini',
  517. icon: 'el-icon-edit-outline',
  518. name: '生成出库单',
  519. disabled: false
  520. }
  521. ],
  522. formOption: [
  523. {
  524. span: 6,
  525. label: 'fBillno',
  526. name: '申请编号',
  527. inputType: 2,
  528. width: 200,
  529. labelSize: '80',
  530. rules: [{ required: false, message: ' ' }]
  531. }, {
  532. span: 6,
  533. label: 'fGoodsid',
  534. name: '项目名称',
  535. inputType: 1,
  536. width: 200,
  537. labelSize: '80',
  538. rules: [{ required: false, message: ' ' }]
  539. }, {
  540. span: 6,
  541. label: 'fCorpid',
  542. name: '供应商',
  543. inputType: 2,
  544. width: 200,
  545. labelSize: '80',
  546. rules: [{ required: false, message: ' ' }]
  547. }, {
  548. span: 6,
  549. label: 'createBy',
  550. name: '申请人',
  551. inputType: 2,
  552. width: 200,
  553. labelSize: '80',
  554. rules: [{ required: false, message: ' ' }]
  555. }, {
  556. span: 6,
  557. label: 'moneys',
  558. name: '金额',
  559. inputType: 5,
  560. width: 200,
  561. labelSize: '80',
  562. rules: [{ required: false, message: ' ' }]
  563. }, {
  564. span: 6,
  565. label: 'cLoadDate',
  566. name: '申请日期',
  567. inputType: 3,
  568. width: 300,
  569. labelSize: '80',
  570. rules: [{ required: false, message: ' ' }]
  571. }
  572. ],
  573. contentOption: [
  574. {
  575. index:'1',
  576. span: 6,
  577. label: 'fBillno',
  578. name: '系统编号',
  579. inputType: 2,
  580. width: 200,
  581. labelSize: '80',
  582. disabled: true,
  583. rules: [{ required: false, message: ' ' }]
  584. }, {
  585. index:'2',
  586. span: 6,
  587. label: 'fGoodsid',
  588. name: '项目名称',
  589. inputType: 1,
  590. width: 200,
  591. labelSize: '80',
  592. disabled: true,
  593. rules: [{ required: true, message: ' ' }]
  594. }, {
  595. index:'3',
  596. span: 6,
  597. label: 'personNaem',
  598. name: '项目主管',
  599. inputType: 2,
  600. width: 200,
  601. labelSize: '80',
  602. disabled: true,
  603. rules: [{ required: false, message: ' ' }]
  604. }, {
  605. index:'4',
  606. span: 6,
  607. label: 'corpsName',
  608. name: '客户',
  609. inputType: 2,
  610. width: 200,
  611. labelSize: '80',
  612. disabled: true,
  613. rules: [{ required: false, message: ' ' }]
  614. }, {
  615. index:'5',
  616. span: 6,
  617. label: 'fCorpid',
  618. name: '供应商',
  619. inputType: 1,
  620. width: 200,
  621. labelSize: '80',
  622. disabled: true,
  623. rules: [{ required: true, message: ' ' }]
  624. }, {
  625. index:'6',
  626. span: 6,
  627. label: 'fWarehouseid',
  628. name: '仓库',
  629. inputType: 1,
  630. width: 200,
  631. disabled: true,
  632. labelSize: '80',
  633. rules: [{ required: true, message: ' ' }]
  634. }, {
  635. index:'7',
  636. span: 6,
  637. label: 'fBsdate',
  638. name: '提货日期',
  639. inputType: 6,
  640. width: 200,
  641. disabled: true,
  642. labelSize: '80',
  643. rules: [{ required: true, message: ' ' }]
  644. }, {
  645. index:'8',
  646. span: 6,
  647. label: 'createBy',
  648. name: '申请人',
  649. inputType: 2,
  650. width: 200,
  651. disabled: true,
  652. labelSize: '80',
  653. rules: [{ required: false, message: ' ' }]
  654. },
  655. {
  656. index:'9',
  657. span: 6,
  658. label: 'fStudentsWeight',
  659. name: '学生人数',
  660. inputType: 2,
  661. onabort: 'this.value=this.value.replace(/[^0-9]/g,\'\')',
  662. width: 200,
  663. disabled: true,
  664. labelSize: '80',
  665. rules: [{ required: true, message: ' ' }]
  666. }, {
  667. index:'10',
  668. span: 6,
  669. label: 'fTeachersWeight',
  670. name: '教师人数',
  671. onabort: 'this.value=this.value.replace(/[^0-9]/g,\'\')',
  672. inputType: 2,
  673. width: 200,
  674. disabled: true,
  675. labelSize: '80',
  676. rules: [{ required: true, message: ' ' }]
  677. },
  678. {
  679. index:'11',
  680. span: 6,
  681. label: 'fSbu',
  682. name: '开票公司',
  683. inputType: 1,
  684. width: 200,
  685. disabled: true,
  686. labelSize: '80',
  687. rules: [{ required: true, message: ' ' }]
  688. }, {
  689. index:'12',
  690. span: 6,
  691. label: 'remark',
  692. name: '备注',
  693. inputType: 4,
  694. disabled: true,
  695. width: 200,
  696. labelSize: '80',
  697. rules: [{ required: false, message: ' ' }]
  698. }
  699. ]
  700. }
  701. },
  702. activated(){
  703. this.homePage()
  704. },
  705. created() {
  706. let data = {
  707. tableName: this.queryList.tableName,
  708. userId: Cookies.get('userName')
  709. }
  710. this.getRow(data)
  711. this.query(this.formDataList)
  712. productName().then(res => {
  713. console.log(res)
  714. if (res.code === 200) {
  715. for (let item in res.rows) {
  716. this.listData.fFeeid.push({
  717. label: res.rows[item].fName,
  718. value: res.rows[item].fId,
  719. fFeeunitid: res.rows[item].fFeeunitid
  720. })
  721. }
  722. }
  723. })
  724. this.getDicts('data_unitfees').then(res => {
  725. console.log(res.data)
  726. for (let item in res.data) {
  727. this.listData.fFeeunitid.push({
  728. label: res.data[item].dictLabel,
  729. value: JSON.parse(res.data[item].dictValue)
  730. })
  731. }
  732. })
  733. this.getDicts('f_paymode').then(res => {
  734. console.log(res)
  735. for (let item in res.data) {
  736. this.listData.fStltypeid.push({
  737. label: res.data[item].dictLabel,
  738. value: JSON.parse(res.data[item].dictValue)
  739. })
  740. }
  741. })
  742. queryItem().then(res => {
  743. console.log(res)
  744. for (let item in res.data) {
  745. this.dataList.fGoodsid.push({
  746. label: res.data[item].projectName,
  747. value: res.data[item].fId,
  748. personNaem: res.data[item].personNaem,
  749. corpsName: res.data[item].corpsName,
  750. fCorpid: res.data[item].fCorpid
  751. })
  752. }
  753. })
  754. //查询仓库
  755. warehouse().then(res => {
  756. console.log(res)
  757. for (let item in res.rows) {
  758. this.dataList.fWarehouseid.push({
  759. label: res.rows[item].fName,
  760. value: res.rows[item].fId
  761. })
  762. }
  763. })
  764. this.fCompany(1)
  765. this.fCompany(2)
  766. },
  767. methods: {
  768. change(scope){
  769. console.log(this.contentList)
  770. for(let item in this.contentList){
  771. for(let li in this.listData.fFeeid){
  772. if(this.contentList[item].fFeeid == this.listData.fFeeid[li].value){
  773. console.log("111")
  774. this.$set(this.contentList[item],'fFeeunitid',this.listData.fFeeid[li].fFeeunitid)
  775. }
  776. }
  777. }
  778. },
  779. homePage(){
  780. let date = this.$route.query
  781. console.log(date)
  782. if (this.$route.query.list){
  783. this.contentButton = this.$options.data().contentButton
  784. this.contentButton.push(JSON.parse(this.$route.query.list))
  785. console.log(this.contentButton)
  786. let scope = {
  787. row:{
  788. fId:JSON.parse(this.$route.query.data).billId
  789. }
  790. }
  791. this.viewMethod(scope)
  792. }
  793. },
  794. // 查看审批流
  795. getDataList() {
  796. this.addOrUpdateVisible = false;
  797. },
  798. returnData() {
  799. this.addOrUpdateVisib = false;
  800. this.open = false;
  801. this.cancelTwo();
  802. },
  803. addOrUpdateHandle() {
  804. this.addOrUpdateVisible = true;
  805. this.$nextTick(() => {
  806. this.$refs.addOrUpdate.init(this.$refs.avatar.form.fId,520);
  807. });
  808. },
  809. addOrUpdateHand() {
  810. this.addOrUpdateVisib = true;
  811. this.$nextTick(() => {
  812. this.$refs.ApprovalComments.init(this.$refs.avatar.form.fId,520);
  813. });
  814. },
  815. //首页审批跳转关闭返回首页
  816. cancelTwo() {
  817. let view = {
  818. fullPath: '/purchaseRequest',
  819. hash: '',
  820. matched: Array(2),
  821. meta: Object,
  822. name: 'PurchaseRequest',
  823. params: Object,
  824. path: '/purchaseRequest',
  825. query: Object,
  826. title: '采购申请'
  827. }
  828. this.$router.push({ path: '/index' })
  829. this.$store
  830. .dispatch('tagsView/delView', view)
  831. .then(({ visitedViews }) => {
  832. if (this.isActive(view)) {
  833. this.toLastView(visitedViews, view)
  834. }
  835. })
  836. Global.$emit('removeCache', 'closeSelectedTag', view)
  837. },
  838. //分页
  839. handleSizeChange(val) {
  840. // console.log(`每页 ${val} 条`);
  841. this.formDataList.pageSize = val
  842. this.query(this.formDataList)
  843. },
  844. handleCurrentChange(val) {
  845. // console.log(`当前页: ${val}`);
  846. this.formDataList.pageNum = val
  847. this.query(this.formDataList)
  848. },
  849. //计算金额
  850. totalAmount(scope) {
  851. console.log(scope)
  852. if (scope.row.fUnitprice && scope.row.fQty) {
  853. scope.row.fAmount = (scope.row.fUnitprice * scope.row.fQty).toFixed(2)
  854. }
  855. },
  856. //查询公司
  857. fCompany(name) {
  858. company(name).then(res => {
  859. console.log(res)
  860. if (name == 1) {
  861. this.dataList.fCorpid = []
  862. for (let item in res.data) {
  863. this.dataList.fCorpid.push({
  864. label: res.data[item].fName,
  865. value: res.data[item].fId
  866. })
  867. }
  868. } else if (name == 2) {
  869. this.dataList.fSbu = []
  870. for (let item in res.data) {
  871. this.dataList.fSbu.push({
  872. label: res.data[item].fName,
  873. value: res.data[item].fId
  874. })
  875. }
  876. }
  877. })
  878. },
  879. //查询主页列数据
  880. query(data) {
  881. listQuery(data).then(res => {
  882. this.tableData = res.rows
  883. this.total = res.total
  884. })
  885. },
  886. //查询列数据
  887. getRow(data,list) {
  888. select(data).then((res) => {
  889. console.log(res)
  890. if (data.tableName === '采购申请详情') {
  891. if (res.data.length != 0) {
  892. this.purchaseList.columnList = res.data.filter((e) => e.checked == 0)
  893. this.purchaseList.columnList = res.data
  894. this.setRowList = res.data
  895. this.purchaseList.columnList = this.purchaseList.columnList.filter((e) => e.checked == 0)
  896. // this.waitFor = true
  897. } else {
  898. // this.waitFor = true
  899. this.purchaseList.columnList = this.contentStyle
  900. this.setRowList = this.contentStyle
  901. }
  902. this.pageDisplay = false
  903. this.isItHidden = false
  904. this.inDex = this.contentOption.length
  905. } else {
  906. if (res.data.length != 0) {
  907. this.queryList.columnList = res.data.filter((e) => e.checked == 0)
  908. this.queryList.columnList = res.data
  909. this.setRowList = res.data
  910. this.queryList.columnList = this.queryList.columnList.filter((e) => e.checked == 0)
  911. // this.waitFor = true
  912. } else {
  913. // this.waitFor = true
  914. this.queryList.columnList = this.listStyle
  915. console.log(this.queryList.columnList.fFeeid)
  916. this.setRowList = this.listStyle
  917. }
  918. this.pageDisplay = true
  919. this.isItHidden = true
  920. this.inDex = 4
  921. }
  922. this.$refs.avatar.form = {}
  923. if (list){
  924. this.$refs.avatar.form = list.warehouseBills
  925. this.contentList = list.tWarehousebillsfees
  926. this.contentButton = this.$options.data().contentButton
  927. if (this.$refs.avatar.form.fBillstatus === 6){
  928. this.contentButton.push({
  929. type: 'danger',
  930. size: 'mini',
  931. icon: 'el-icon-edit-outline',
  932. name: '撤销采购',
  933. disabled: false
  934. })
  935. }else if(this.$refs.avatar.form.fBillstatus === 4){
  936. this.contentButton.push({
  937. type: 'danger',
  938. size: 'mini',
  939. icon: 'el-icon-edit-outline',
  940. name: '撤销审批',
  941. disabled: false
  942. })
  943. }
  944. this.contentButton.forEach(item =>{
  945. if (item.name == '返回列表' || item.name == '修改' || item.name == '打印'){
  946. item.disabled = false
  947. }else {
  948. item.disabled = true
  949. }
  950. })
  951. }
  952. })
  953. },
  954. returnToForm(row) {
  955. console.log(row, 111)
  956. },
  957. //查看
  958. viewMethod(scope) {
  959. console.log(scope)
  960. this.contentOption.forEach(item => item.disabled = true)
  961. this.contentStyle.forEach(item => item.disabled = true)
  962. this.contentButton.forEach(item =>{
  963. if (item.name == '返回列表' || item.name == '修改'){
  964. item.disabled = false
  965. }else {
  966. item.disabled = true
  967. }
  968. })
  969. viewSingle(scope.row.fId).then(res => {
  970. if (res.code === 200) {
  971. let data = {
  972. tableName: this.purchaseList.tableName,
  973. userId: Cookies.get('userName')
  974. }
  975. let list ={
  976. warehouseBills:res.data.warehouseBills,
  977. tWarehousebillsfees:res.data.tWarehousebillsfees
  978. }
  979. this.$refs.avatar.form = {}
  980. this.getRow(data,list)
  981. }
  982. })
  983. },
  984. //修改
  985. modification(scope) {
  986. console.log(scope)
  987. },
  988. //删除
  989. deletion(scope) {
  990. console.log(scope.row.fId)
  991. tableDeleteQuery(scope.row.fId).then(res => {
  992. console.log(res)
  993. this.$confirm(res.msg == 1 ? '主表数据为空' : (res.msg == 2 ? '主表有数据' : '未知状态') + '是否永久删除该条数据?', '提示', {
  994. confirmButtonText: '确定',
  995. cancelButtonText: '取消',
  996. type: 'warning'
  997. }).then(() => {
  998. confirmDeletion(scope.row.fId).then(data => {
  999. this.$message({
  1000. type: 'success',
  1001. message: '删除成功!'
  1002. })
  1003. this.query(this.formDataList)
  1004. })
  1005. }).catch(() => {
  1006. this.$message({
  1007. type: 'info',
  1008. message: '已取消删除'
  1009. })
  1010. })
  1011. })
  1012. },
  1013. //选择框
  1014. selectionbox(selection) {
  1015. if (selection.length > 1){
  1016. this.customButton.forEach(item =>{
  1017. if (item.name === '复制新增'){
  1018. item.disabled = true
  1019. }else {
  1020. item.disabled = false
  1021. }
  1022. })
  1023. }else {
  1024. this.customButton.forEach(item => item.disabled = false)
  1025. this.selection = selection
  1026. }
  1027. },
  1028. //详情内容保存
  1029. submitAndSave(item) {
  1030. let formData = new window.FormData()
  1031. this.$refs.avatar.form.fMoney = 0
  1032. this.contentList.forEach(item => this.$refs.avatar.form.fMoney += Number(item.fAmount))
  1033. formData.append('tWarehousebills', JSON.stringify(this.$refs.avatar.form))
  1034. formData.append('tWarehousebillsfees', JSON.stringify(this.contentList))
  1035. formData.append('fBilltype', 'SQ')
  1036. submit(formData).then(res => {
  1037. if (res.code == 200) {
  1038. this.$message.success('保存成功')
  1039. this.$refs.avatar.form = res.data.warehouseBills
  1040. this.contentList = res.data.tWarehousebillsCntrs
  1041. console.log(this.dataList, this.contentList)
  1042. if (item == 1){
  1043. this.dialogVisible = true
  1044. }else if (item === 2){
  1045. let data = {
  1046. tableName: this.queryList.tableName,
  1047. userId: Cookies.get('userName')
  1048. }
  1049. this.getRow(data)
  1050. this.query(this.formDataList)
  1051. }
  1052. }
  1053. })
  1054. },
  1055. //表单选中后触发
  1056. selectTrigger(name, list, id) {
  1057. console.log(list, id)
  1058. if (name == 'fGoodsid') {
  1059. for (let item in list) {
  1060. if (list[item].value == id) {
  1061. this.$refs.avatar.form.personNaem = list[item].personNaem
  1062. this.$refs.avatar.form.corpsName = list[item].corpsName
  1063. }
  1064. }
  1065. }
  1066. },
  1067. //确认打印
  1068. Printing(){
  1069. this.$print(this.$refs.print)
  1070. },
  1071. //所以按钮
  1072. buttonList(row) {
  1073. console.log(row)
  1074. let data
  1075. switch (row.name) {
  1076. case '新增':
  1077. this.contentList = []
  1078. data = {
  1079. tableName: this.purchaseList.tableName,
  1080. userId: Cookies.get('userName')
  1081. }
  1082. this.$refs.avatar.form = {}
  1083. this.getRow(data)
  1084. this.contentOption.forEach(item => {
  1085. if (item.label == 'personNaem' || item.label == 'corpsName' || item.label == 'createBy' || item.label == 'fBillno') {
  1086. item.disabled = true
  1087. } else {
  1088. item.disabled = false
  1089. }
  1090. })
  1091. this.contentButton.forEach(item => item.disabled = false)
  1092. this.contentStyle.forEach(item => item.disabled = false)
  1093. this.$refs.avatar.form.createBy = Cookies.get('userName')
  1094. break
  1095. case '保存':
  1096. this.$refs.avatar.submitForm('submit')
  1097. break
  1098. case '打印':
  1099. console.log(this.listData.fFeeid,this.contentList)
  1100. for (let item in this.contentList){
  1101. for (let li in this.listData.fFeeid){
  1102. if (this.contentList[item].fFeeid == this.listData.fFeeid[li].value){
  1103. this.contentList[item].feeName = this.listData.fFeeid[li].label
  1104. }
  1105. }
  1106. for(let i in this.listData.fFeeunitid){
  1107. if (this.contentList[item].fFeeunitid == this.listData.fFeeunitid[i].value){
  1108. this.contentList[item].fFeeunitName = this.listData.fFeeunitid[i].label
  1109. }
  1110. }
  1111. }
  1112. if (!this.$refs.avatar.form.fId){
  1113. this.$message.error('未保存,不允许打印');
  1114. }else if (this.$refs.avatar.form.fBillstatus >= 4){
  1115. this.formList = this.$refs.avatar.form
  1116. this.dialogVisible = true
  1117. }else {
  1118. this.formList = this.$refs.avatar.form
  1119. console.log(this.$refs.avatar.form.fBillstatus)
  1120. this.submitAndSave(1)
  1121. }
  1122. break
  1123. case '修改':
  1124. this.contentButton.forEach(item =>{
  1125. if (this.$refs.avatar.form.fBillstatus >= 4){
  1126. if (item.name === '返回列表' || item.name == '打印' || item.name === '修改' || item.name === '生成入库单' || item.name === '生成销售单'||item.name === '生成出库单' || item.name === '查看审批' || item.name === '审批' || item.name === '撤销采购' || item.name === '撤销审批'){
  1127. item.disabled = false
  1128. }else {
  1129. item.disabled = true
  1130. }
  1131. }else {
  1132. item.disabled = false
  1133. this.contentStyle.forEach(item => item.disabled = false)
  1134. this.contentOption.forEach(item => {
  1135. if (item.label == 'personNaem' || item.label == 'corpsName' || item.label == 'createBy' || item.label == 'fBillno') {
  1136. item.disabled = true
  1137. } else {
  1138. item.disabled = false
  1139. }
  1140. })
  1141. }
  1142. })
  1143. break
  1144. case '录入':
  1145. this.contentList.push({
  1146. fFeeid: '',
  1147. fUnitprice: '',
  1148. fPurchase: '',
  1149. fQty: '',
  1150. fFeeunitid: '',
  1151. fAmount: '',
  1152. fStltypeid: '',
  1153. remark: '',
  1154. createTime: '',
  1155. createBy: Cookies.get('userName'),
  1156. fReviewDate: '',
  1157. operation: '',
  1158. })
  1159. break
  1160. case '查看审批':
  1161. this.addOrUpdateHandle()
  1162. break
  1163. case '审批':
  1164. this.addOrUpdateHand()
  1165. break
  1166. case '返回列表':
  1167. console.log(this.$route.query.data)
  1168. if (!this.$refs.avatar.form.fId && this.contentList !== 0 || this.$refs.avatar.form.fBillstatus > 3 && !this.$route.query.data) {
  1169. data = {
  1170. tableName: this.queryList.tableName,
  1171. userId: Cookies.get('userName')
  1172. }
  1173. this.getRow(data)
  1174. this.query(this.formDataList)
  1175. } else if(this.$route.query.data){
  1176. this.cancelTwo();
  1177. this.$router.push({path:'/index'})
  1178. }else {
  1179. this.$confirm('当前数据未保存是否保存?', '提示', {
  1180. confirmButtonText: '保存',
  1181. cancelButtonText: '取消',
  1182. type: 'warning'
  1183. }).then(() => {
  1184. this.submitAndSave(2)
  1185. }).catch(() => {
  1186. data = {
  1187. tableName: this.queryList.tableName,
  1188. userId: Cookies.get('userName')
  1189. }
  1190. this.getRow(data)
  1191. this.query(this.formDataList)
  1192. })
  1193. }
  1194. break
  1195. case '请核':
  1196. if (this.$refs.avatar.form.fBillstatus < 4){
  1197. this.$refs.avatar.submitForm('check')
  1198. }else {
  1199. this.$message.error('请先保存');
  1200. }
  1201. break
  1202. case '生成入库单':
  1203. let listData = {
  1204. fId:this.$refs.avatar.form.fId,
  1205. fBilltype:'RK'
  1206. }
  1207. copyNew(listData).then(res=>{
  1208. this.$message({
  1209. message: '生成成功',
  1210. type: 'success',
  1211. showClose:true
  1212. });
  1213. })
  1214. break
  1215. case '生成销售单':
  1216. let liste = {
  1217. fId:this.$refs.avatar.form.fId,
  1218. fBilltype:'XS'
  1219. }
  1220. copyNew(liste).then(res=>{
  1221. this.$message({
  1222. message: '生成成功',
  1223. type: 'success',
  1224. showClose:true
  1225. });
  1226. })
  1227. break
  1228. case '生成出库单':
  1229. let listd = {
  1230. fId:this.$refs.avatar.form.fId,
  1231. fBilltype:'CK'
  1232. }
  1233. copyNew(listd).then(res=>{
  1234. this.$message({
  1235. message: '生成成功',
  1236. type: 'success',
  1237. showClose:true
  1238. });
  1239. })
  1240. break
  1241. case '复制新增':
  1242. if (this.selection.length > 0){
  1243. let datae = {
  1244. fId:this.selection[0].fId,
  1245. fBilltype:'SQ'
  1246. }
  1247. copyNew(datae).then(res=>{
  1248. this.$message({
  1249. message: '复制新增成功',
  1250. type: 'success',
  1251. showClose:true
  1252. });
  1253. this.query(this.formDataList)
  1254. })
  1255. }else {
  1256. this.$message.warning('未选择列表,请选择后再点击');
  1257. }
  1258. break
  1259. case '撤销审批':
  1260. let date = new Date()
  1261. let y = date.getFullYear()
  1262. let m = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1)
  1263. let d = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate())
  1264. data = {
  1265. actId:520,
  1266. id:this.$refs.avatar.form.fId,
  1267. billId:this.$refs.avatar.form.fId,
  1268. auditItem:y + '-' + m + '-' + d
  1269. }
  1270. console.log(data)
  1271. revoke(data).then(res=>{
  1272. if (res.code === 200){
  1273. this.$message({
  1274. showClose: true,
  1275. message: '撤销成功',
  1276. type: 'success'
  1277. })
  1278. data = {
  1279. tableName: this.queryList.tableName,
  1280. userId: Cookies.get('userName')
  1281. }
  1282. this.getRow(data)
  1283. this.query(this.formDataList)
  1284. }
  1285. })
  1286. break
  1287. case '撤销采购':
  1288. withdrawBy(this.$refs.avatar.form.fId).then(res=>{
  1289. if (res.code === 200){
  1290. this.$message({
  1291. showClose: true,
  1292. message: '撤销成功',
  1293. type: 'success'
  1294. })
  1295. data = {
  1296. tableName: this.queryList.tableName,
  1297. userId: Cookies.get('userName')
  1298. }
  1299. this.getRow(data)
  1300. this.query(this.formDataList)
  1301. }
  1302. })
  1303. break
  1304. default:
  1305. this.$message.error('该按钮暂无功能')
  1306. }
  1307. },
  1308. //请核
  1309. writeOff(){
  1310. let formData = new window.FormData()
  1311. formData.append('tWarehousebills', JSON.stringify(this.$refs.avatar.form))
  1312. formData.append('tWarehousebillsfees', JSON.stringify(this.contentList))
  1313. formData.append('fBilltype', 'SQ')
  1314. pleaseCheck(formData).then(res => {
  1315. if (res.code == 200) {
  1316. this.$message.success('请核成功')
  1317. this.contentOption.forEach(item => item.disabled = true)
  1318. this.contentStyle.forEach(item => item.disabled = true)
  1319. this.contentButton.forEach(item =>{
  1320. if (item.name == '返回列表' || item.name == '修改'){
  1321. item.disabled = false
  1322. }else {
  1323. item.disabled = true
  1324. }
  1325. })
  1326. // this.$refs.avatar.form = res.data.warehouseBills
  1327. // this.contentList = res.data.tWarehousebillsCntrs
  1328. let data = {
  1329. tableName: this.queryList.tableName,
  1330. userId: Cookies.get('userName')
  1331. }
  1332. this.getRow(data)
  1333. this.query(this.formDataList)
  1334. }
  1335. })
  1336. },
  1337. // 显示搜索条件、点击后会调用此方法
  1338. showSearch() {
  1339. console.log('到我了')
  1340. this.searchWhether = !this.searchWhether
  1341. },
  1342. //搜索、重置、展开
  1343. feedback(res) {
  1344. console.log(res)
  1345. if (res == '展开') {
  1346. if (this.inDex == 4) {
  1347. this.inDex = this.formOption.length
  1348. } else {
  1349. this.inDex = 4
  1350. }
  1351. } else if (res == '搜索') {
  1352. this.$refs.avatar.submitForm()
  1353. } else if (res == '重置') {
  1354. this.$refs.avatar.form = {}
  1355. this.$refs.avatar.submitForm()
  1356. }
  1357. },
  1358. //表单验证通过执行搜索
  1359. submitForm() {
  1360. let list = this.formDataList
  1361. console.log(this.$refs.avatar.form)
  1362. this.formDataList = this.$refs.avatar.form
  1363. this.formDataList.fBilltype = list.fBilltype
  1364. this.formDataList.pageSize = list.pageSize
  1365. this.formDataList.pageNum = list.pageNum
  1366. this.query(this.formDataList)
  1367. },
  1368. //点击刷新会调用此方法
  1369. getList() {
  1370. this.feedback('重置')
  1371. this.submitForm()
  1372. console.log('到我了2')
  1373. },
  1374. //详情表内容移出
  1375. deletRows(index, rows) {
  1376. console.log(index, rows)
  1377. if (rows[index].fId) {
  1378. deleteQuery(this.$refs.avatar.form.fId, this.$refs.avatar.form.fDateChanged).then(res => {
  1379. if (res.code === 200) {
  1380. listDelete(rows[index].fId).then(data => {
  1381. rows.splice(index, 1)
  1382. })
  1383. }
  1384. })
  1385. } else {
  1386. rows.splice(index, 1)
  1387. }
  1388. }
  1389. }
  1390. }
  1391. </script>
  1392. <style scoped>
  1393. .table {
  1394. border-collapse: collapse;
  1395. border-spacing: 0;
  1396. background-color: transparent;
  1397. display: table;
  1398. width: 100%;
  1399. max-width: 100%;
  1400. margin: 0 auto;
  1401. }
  1402. .table td {
  1403. text-align: center;
  1404. vertical-align: middle;
  1405. font-size: 14px;
  1406. color: #333333;
  1407. padding: 8px 12px;
  1408. }
  1409. .column {
  1410. border: 1px solid #000;
  1411. }
  1412. .app-container >>> .el-form-item{
  1413. margin-bottom: 0;
  1414. }
  1415. </style>