index.vue 52 KB

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