index.vue 47 KB

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