index.vue 50 KB

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