index.vue 46 KB

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