index.vue 42 KB

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