index.vue 66 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059
  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. :tatolLabel="['金额合计']"
  24. :hasPermi="hasPermi"
  25. :isItHidden="isItHidden"
  26. :customButton="customButton"
  27. :listStyle="listStyle"
  28. :queryList="queryList"
  29. :setRowList="setRowList"
  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. <!-- </el-pagination>-->
  41. <div style="float: right;margin-bottom: 10px">
  42. <pagination
  43. v-show="total > 0"
  44. :total="total"
  45. :page.sync="formDataList.pageNum"
  46. :limit.sync="formDataList.pageSize"
  47. :page-sizes="[10,100,200,500,1000]"
  48. @pagination="feedback('搜索')"
  49. />
  50. </div>
  51. </div>
  52. <div v-else class="app-container">
  53. <div style="display: flex;margin-bottom: 10px">
  54. <el-breadcrumb>
  55. <el-breadcrumb-item>
  56. <el-button
  57. size="mini"
  58. type="danger" plain
  59. @click="backToList"
  60. icon="el-icon-arrow-left"
  61. >
  62. 返回列表
  63. </el-button>
  64. </el-breadcrumb-item>
  65. <!-- <el-breadcrumb-item style="font-weight: 700">-->
  66. <!-- <el-button-group>-->
  67. <!-- <el-button type="primary" size="mini" icon="el-icon-arrow-left" :disabled="forward" @click="sequence(true)">向前</el-button>-->
  68. <!-- <el-button type="primary" size="mini" :disabled="backward" @click="sequence(true)">向后<i class="el-icon-arrow-right el-icon&#45;&#45;right"></i></el-button>-->
  69. <!-- </el-button-group>-->
  70. <!-- </el-breadcrumb-item>-->
  71. </el-breadcrumb>
  72. </div>
  73. <h1 style="text-align: center;margin-top: -42px">费用管理</h1>
  74. <formComponent
  75. v-if="searchWhether"
  76. :formOption="contentOption"
  77. :dataList="dataList"
  78. :inDex="inDex"
  79. ref="avatar"
  80. @writeOff="writeOff"
  81. @submitForm="submitForm"
  82. @returnToForm="returnToForm"
  83. @submitAndSave="submitAndSave"
  84. @selectTrigger="selectTrigger"
  85. />
  86. <listComponent
  87. ref="listComponent"
  88. :tableData="contentList"
  89. @selectionbox="selectionbox"
  90. @see="viewMethod"
  91. @modify="modification"
  92. @deletion="deletion"
  93. @buttonList="buttonList"
  94. @showSearch="showSearch"
  95. @feedback="feedback"
  96. @getList="getList"
  97. @deletRows="deletRows"
  98. @totalAmount="totalAmount"
  99. @change="change"
  100. :hasPermi="hasPermi"
  101. :tatolLabel="tatolLabel"
  102. :isItHidden="isItHidden"
  103. :customButton="contentButton"
  104. :listStyle="contentStyle"
  105. :queryList="purchaseList"
  106. :setRowList="setRowList"
  107. :listData="listData"
  108. />
  109. <el-collapse>
  110. <el-collapse-item title="附件管理" name="1">
  111. <div style="padding-right: 10px">
  112. <c-upload :list="tEnclosure" ref="cUpload" :disabled="disabled"></c-upload>
  113. </div>
  114. </el-collapse-item>
  115. </el-collapse>
  116. </div>
  117. <add-or-update
  118. v-if="addOrUpdateVisible"
  119. ref="addOrUpdate"
  120. @refreshDataList="getDataList"
  121. ></add-or-update>
  122. <approval-comments
  123. v-if="addOrUpdateVisib"
  124. ref="ApprovalComments"
  125. @refreshDataList="returnData"
  126. ></approval-comments>
  127. <el-dialog
  128. :title="`打印${reverse}`"
  129. :visible.sync="dialogVisible"
  130. :fullscreen="true"
  131. style="padding: 0;margin:0"
  132. width="70%"
  133. >
  134. <div ref="print">
  135. <div style="margin-bottom: 5px">
  136. 标题切换:
  137. <el-radio-group v-model="reverse">
  138. <el-radio label="报销单">报销单</el-radio>
  139. <el-radio label="付款单">付款单</el-radio>
  140. </el-radio-group>
  141. </div>
  142. <table class="table table-striped table-bordered" align="center" valign="center">
  143. <tr>
  144. <td colspan="6"></td>
  145. <td colspan="2">打印次数:{{ formList.printTime + 1 }}</td>
  146. <td colspan="4">打印日期:{{ formList.printDate }}</td>
  147. </tr>
  148. <tr>
  149. <td style="font-size: 24px;font-weight:bold" class="column" colspan="11">{{ reverse }}</td>
  150. </tr>
  151. <tr>
  152. <td class="column" style="width: 6%;">部门</td>
  153. <td class="column" colspan="2" style="width: 19%;">{{ formList.deptName }}</td>
  154. <td class="column" style="width: 9%;">报销方式</td>
  155. <td class="column" style="width: 9%;">{{ formList.expenseTypeName }}</td>
  156. <td class="column" style="width: 9.5%;">业务类型</td>
  157. <td class="column" style="width: 9.5%;">{{ formList.businessTypeName }}</td>
  158. <td class="column" style="width: 9.5%;">制单人</td>
  159. <td class="column" style="width: 9.5%;">{{ formList.createBy }}</td>
  160. <td class="column" style="width: 9.5%;">制单日期</td>
  161. <td class="column" style="width: 9.5%;">{{ formList.createTime ? formList.createTime.slice(0, 10) : '' }}
  162. </td>
  163. </tr>
  164. <tr>
  165. <td class="column">户头</td>
  166. <td class="column" colspan="3">{{ formList.account }}</td>
  167. <td class="column">开户行</td>
  168. <td class="column" colspan="3">{{ formList.openingBank }}</td>
  169. <td class="column">账号</td>
  170. <td class="column" colspan="2">{{ formList.openingBankAccount }}</td>
  171. </tr>
  172. <tr>
  173. <td class="column">备注</td>
  174. <td class="column" colspan="10" style="text-align: left">{{ formList.remark }}</td>
  175. </tr>
  176. </table>
  177. <table class="table table-striped table-bordered" align="center" valign="center">
  178. <tr>
  179. <td class="column" style="border-top: none;width: 6%">序号</td>
  180. <td class="column" style="border-top: none;width: 9.5%;">费用名称</td>
  181. <td class="column" style="border-top: none;width: 9.5%;">金额</td>
  182. <td class="column" style="border-top: none;width: 18%;">项目</td>
  183. <td class="column" style="border-top: none;width: 9.5%;">所属人员</td>
  184. <td class="column" style="border-top: none;width: 19%;" colspan="2">所属部门</td>
  185. <td class="column" style="border-top: none;width: 9.5%;">物料</td>
  186. <td class="column" style="border-top: none;width: 19%;" colspan="2">备注</td>
  187. </tr>
  188. <tr v-for="(item,index) in contentList" :key="index">
  189. <td class="column">{{ Number(index) + 1 }}</td>
  190. <td class="column">{{ item.expenseName }}</td>
  191. <td class="column">{{ item.amount ? Number(item.amount).toFixed(2) : item.amount }}</td>
  192. <td class="column">{{ item.belongsProjectName }}</td>
  193. <td class="column">{{ item.personnelName }}</td>
  194. <td class="column" colspan="2">{{ item.departmentName }}</td>
  195. <td class="column">{{ item.matterName }}</td>
  196. <td class="column" colspan="2">{{ item.remark }}</td>
  197. </tr>
  198. <tr>
  199. <td class="column" colspan="2" style="width: 15.5%;border-top: none">金额合计(小写):</td>
  200. <td class="column" colspan="2" style="text-align: left;border-top: none;">
  201. {{ formList.totalAmount ? formList.totalAmount.toFixed(2) : '' }}
  202. </td>
  203. <td class="column" colspan="3" style="width: 15%;border-top: none">金额合计(大写):</td>
  204. <td class="column" colspan="3" style="text-align: left;border-top: none;">
  205. {{ formList.totalAmount ? dealBigMoney(formList.totalAmount) : '' }}
  206. </td>
  207. </tr>
  208. </table>
  209. <table class="table table-striped table-bordered" align="center" valign="center">
  210. <tr>
  211. <td class="column" style="width: 15%;border: none">提交人:{{ formList.presenterName }}</td>
  212. <td class="column" colspan="2" style="text-align: left;border: none;width: 10%"></td>
  213. <td class="column" style="width: 15%;border: none">财务主管:{{ formList.firstLevelReviewerName }}</td>
  214. <td class="column" colspan="2" style="text-align: left;border: none;width: 10%"></td>
  215. <td class="column" style="width: 15%;border: none">财务经理:{{ formList.secondaryReviewerName }}</td>
  216. <td class="column" colspan="2" style="text-align: left;border: none;width: 10%"></td>
  217. <td class="column" style="text-align: left;border: none;width: 15%">总经理:</td>
  218. <td class="column" colspan="2" style="text-align: left;border: none;width: 10%"></td>
  219. </tr>
  220. <tr>
  221. <td class="column" style="width: 15%;border: none"></td>
  222. <td class="column" colspan="2" style="text-align: left;border: none;width: 10%"></td>
  223. <td class="column" style="width: 15%;border: none"></td>
  224. <td class="column" colspan="2" style="text-align: left;border: none;width: 10%"></td>
  225. <td class="column" style="width: 15%;border: none"></td>
  226. <td class="column" colspan="2" style="text-align: left;border: none;width: 10%"></td>
  227. <td class="column" style="text-align: left;border: none;width: 10%"></td>
  228. <td class="column" style="text-align: left;border: none;width: 15%">领款人:</td>
  229. <td class="column" style="text-align: left;border: none;width: 10%"></td>
  230. </tr>
  231. </table>
  232. </div>
  233. <span slot="footer" class="dialog-footer">
  234. <el-button @click="dialogVisible = false">取 消</el-button>
  235. <el-button type="primary" @click="Printing">打印</el-button>
  236. </span>
  237. </el-dialog>
  238. </div>
  239. </template>
  240. <script>
  241. import { select } from '@/api/system/set'
  242. import {
  243. listQuery,
  244. submit,
  245. viewSingle,
  246. deleteQuery,
  247. productName,
  248. queryItem,
  249. company,
  250. warehouse,
  251. listDelete,
  252. tableDeleteQuery,
  253. confirmDeletion,
  254. pleaseCheck,
  255. copyNew,
  256. revoke,
  257. withdrawBy,
  258. getName,
  259. queryUserVal, feesList, corpsList, exportContact, exportAllContact
  260. } from '@/api/costManagement/index'
  261. import Cookies from 'js-cookie'
  262. import Global from '@/layout/components/global'
  263. import moment from 'moment'
  264. import { listDept, treeselect } from '@/api/system/dept'
  265. import { getliable } from '@/api/project'
  266. import cUpload from '@/components/cUpload/index.vue'
  267. import { setPrintTime } from '@/api/costManagement/index'
  268. import { company as clientCompany} from '@/api/purchaseIssue/index'
  269. export default {
  270. name: 'index',
  271. components: {
  272. cUpload
  273. },
  274. data() {
  275. return {
  276. // 财务主管
  277. treasurer: '',
  278. // 财务经理
  279. financeManager: '',
  280. reverse: '报销单',
  281. before: '',
  282. lander: '',
  283. operator: '',
  284. disabled: true,
  285. forward: false,
  286. backward: false,
  287. addOrUpdateVisible: false,
  288. addOrUpdateVisib: false,
  289. total: 0,
  290. selection: [],
  291. formDataList: {
  292. fBilltype: 'FY',
  293. pageSize: 10,
  294. pageNum: 1
  295. },
  296. formList: {},
  297. tatolLabel: ['金额'],
  298. dialogVisible: false,
  299. listData: {
  300. itemExpenseId: [],
  301. businessType: [],
  302. expenseType: [],
  303. expenseId: [],
  304. belongsProjectId: [],
  305. departmentId: [],
  306. personnelId: []
  307. },
  308. hasPermi: {
  309. lookup: ['anpin:management:query'],
  310. disappear: ['anpin:management:remove']
  311. },
  312. setTimeout: '',
  313. searchWhether: true,
  314. pageDisplay: true,
  315. dataList: {
  316. itemExpenseId: [],
  317. businessType: [],
  318. expenseType: [],
  319. createDept: [],
  320. itemPersonnel: [],
  321. createById: [],
  322. itemDepartment: [],
  323. itemBelongsProjectId: [],
  324. openingBankAccount: []
  325. },
  326. tEnclosure: [],
  327. contentList: [],
  328. inDex: 4,
  329. tableData: [],
  330. tableList: [],
  331. isItHidden: true,
  332. listStyle: [
  333. {
  334. surface: '1',
  335. label: 'serialNumber',
  336. name: '序号',
  337. checked: 0,
  338. width: 100,
  339. onabort: ''
  340. }, {
  341. surface: '2',
  342. label: 'deptName',
  343. name: '部门',
  344. checked: 0,
  345. width: 100,
  346. onabort: ''
  347. }, {
  348. surface: '3',
  349. label: 'createBy',
  350. name: '制单人',
  351. checked: 0,
  352. width: 100,
  353. onabort: ''
  354. }, {
  355. surface: '4',
  356. label: 'createDeptName',
  357. name: '制单部门',
  358. checked: 0,
  359. width: 100,
  360. onabort: ''
  361. }, {
  362. surface: '5',
  363. label: 'businessTime',
  364. name: '业务日期',
  365. checked: 0,
  366. width: 100,
  367. onabort: ''
  368. }, {
  369. surface: '6',
  370. label: 'createTime',
  371. name: '制单日期',
  372. checked: 0,
  373. width: 100,
  374. onabort: ''
  375. }, {
  376. surface: '7',
  377. label: 'totalAmount',
  378. name: '金额合计',
  379. checked: 0,
  380. width: 100,
  381. onabort: ''
  382. },
  383. {
  384. surface: '8',
  385. label: 'businessType',
  386. name: '业务类型',
  387. checked: 0,
  388. width: 100,
  389. onabort: ''
  390. },
  391. {
  392. surface: '8',
  393. label: 'expenseType',
  394. name: '报销方式',
  395. checked: 0,
  396. width: 100,
  397. onabort: ''
  398. },
  399. {
  400. surface: '8',
  401. label: 'remark',
  402. name: '备注',
  403. checked: 0,
  404. width: 100,
  405. onabort: ''
  406. },
  407. {
  408. surface: '9',
  409. label: 'applicantName',
  410. name: '申请人',
  411. checked: 0,
  412. width: 200,
  413. operation: 1
  414. },
  415. {
  416. surface: '10',
  417. label: 'fStatusName',
  418. name: '状态',
  419. checked: 0,
  420. width: 200,
  421. operation: 1
  422. },
  423. {
  424. surface: '11',
  425. label: 'printTime',
  426. name: '打印次数',
  427. checked: 0,
  428. width: 200,
  429. operation: 1
  430. },
  431. {
  432. surface: '12',
  433. label: 'printDate',
  434. name: '打印时间',
  435. checked: 0,
  436. width: 200,
  437. operation: 1
  438. },
  439. {
  440. surface: '13',
  441. label: 'fReviewDate',
  442. name: '审核日期',
  443. checked: 0,
  444. width: 200,
  445. operation: 1
  446. },
  447. {
  448. surface: '14',
  449. label: 'operation',
  450. name: '操作',
  451. checked: 0,
  452. width: 160,
  453. fixed: 'right',
  454. operation: '1',
  455. onabort: ''
  456. }
  457. ],
  458. contentStyle: [
  459. {
  460. surface: '1',
  461. label: 'serialNumber',
  462. name: '序号',
  463. checked: 0,
  464. width: 100,
  465. disabled: false,
  466. onabort: ''
  467. }, {
  468. surface: '2',
  469. label: 'expenseId',
  470. name: '费用名称',
  471. checked: 0,
  472. width: 160,
  473. onabort: '',
  474. disabled: false,
  475. changeable: 1
  476. }, {
  477. surface: '3',
  478. label: 'amount',
  479. name: '金额',
  480. checked: 0,
  481. width: 120,
  482. disabled: false,
  483. onabort: 'this.value=this.value.replace(/[^\\-?\\d.]/g,"").replace(/^(\\-)*(\\d+)\\.(\\d\\d).*$/, "$1$2.$3")',
  484. changeable: 2
  485. }, {
  486. surface: '4',
  487. label: 'belongsProjectId',
  488. name: '项目',
  489. checked: 0,
  490. width: 200,
  491. onabort: '',
  492. disabled: false,
  493. changeable: 1
  494. }, {
  495. surface: '5',
  496. label: 'personnelId',
  497. name: '所属人员',
  498. checked: 0,
  499. width: 120,
  500. onabort: 'this.value=this.value.replace(/[^\\-?\\d.]/g,"").replace(/^(\\-)*(\\d+)\\.(\\d\\d).*$/, "$1$2.$3")',
  501. disabled: false,
  502. changeable: 1
  503. }, {
  504. surface: '6',
  505. label: 'departmentId',
  506. name: '所属部门',
  507. checked: 0,
  508. width: 200,
  509. onabort: '',
  510. disabled: false,
  511. changeable: 1
  512. }, {
  513. surface: '7',
  514. label: 'matterName',
  515. name: '物料',
  516. checked: 0,
  517. width: 100,
  518. disabled: false,
  519. changeable: 2
  520. }, {
  521. surface: '8',
  522. label: 'remark',
  523. name: '备注',
  524. checked: 0,
  525. width: 100,
  526. onabort: '',
  527. disabled: false,
  528. changeable: 2
  529. }, {
  530. surface: '9',
  531. label: 'operation',
  532. name: '操作',
  533. checked: 0,
  534. disabled: false,
  535. width: 160,
  536. fixed: 'right',
  537. operation: '2',
  538. onabort: ''
  539. }
  540. ],
  541. queryList: {
  542. tableName: '费用管理',
  543. columnList: []
  544. },
  545. purchaseList: {
  546. tableName: '费用管理详情',
  547. columnList: []
  548. },
  549. setRowList: [],
  550. customButton: [
  551. {
  552. type: 'primary',
  553. size: 'mini',
  554. icon: 'el-icon-edit',
  555. name: '新单',
  556. disabled: false
  557. },
  558. // {
  559. // type:'warning',
  560. // size:'mini',
  561. // icon:'el-icon-edit',
  562. // name:'立即修改',
  563. // disabled:false,
  564. // },
  565. //主页列表按钮
  566. // {
  567. // type: 'warning',
  568. // size: 'mini',
  569. // icon: 'el-icon-upload2',
  570. // name: '导出',
  571. // disabled: false,
  572. // hasPermi: ['anpin:stockControl:export']
  573. // },
  574. {
  575. type: 'success',
  576. size: 'mini',
  577. icon: 'el-icon-c-scale-to-original',
  578. name: '复制新单',
  579. disabled: false
  580. },
  581. {
  582. type: 'warning',
  583. size: 'mini',
  584. icon: 'el-icon-upload',
  585. name: '导出',
  586. disabled: false,
  587. hasPermi: ['anpin:stockControl:export']
  588. },
  589. {
  590. type: 'warning',
  591. size: 'mini',
  592. icon: 'el-icon-upload',
  593. name: '导出包含明细',
  594. disabled: false,
  595. hasPermi: ['anpin:stockControl:export']
  596. }
  597. ],
  598. contentButton: [
  599. {
  600. type: 'primary',
  601. size: 'mini',
  602. icon: 'el-icon-plus',
  603. name: '录入明细',
  604. disabled: false
  605. }, {
  606. type: 'primary',
  607. size: 'mini',
  608. icon: 'el-icon-check',
  609. name: '保存',
  610. plain: true,
  611. disabled: false
  612. }
  613. , {
  614. type: 'primary',
  615. size: 'mini',
  616. icon: 'el-icon-edit-outline',
  617. name: '请核',
  618. disabled: false
  619. }
  620. , {
  621. type: 'primary',
  622. size: 'mini',
  623. icon: 'el-icon-plus',
  624. name: '新单',
  625. nameTwo: '详情页',
  626. plain: true,
  627. disabled: false
  628. }, {
  629. type: 'primary',
  630. size: 'mini',
  631. icon: 'el-icon-plus',
  632. name: '复制新单',
  633. nameTwo: '详情页',
  634. plain: true,
  635. disabled: false
  636. }, {
  637. type: 'success',
  638. size: 'mini',
  639. icon: 'el-icon-edit',
  640. name: '修改',
  641. disabled: false
  642. }
  643. // , {
  644. // type: 'warning',
  645. // size: 'mini',
  646. // icon: 'el-icon-download',
  647. // name: '导出',
  648. // disabled: false
  649. // }
  650. , {
  651. type: 'info',
  652. size: 'mini',
  653. icon: 'el-icon-edit-outline',
  654. name: '打印',
  655. disabled: false
  656. }, {
  657. type: 'primary',
  658. size: 'mini',
  659. icon: 'el-icon-edit-outline',
  660. name: '查看审批',
  661. disabled: false
  662. }
  663. ],
  664. formOption: [{
  665. span: 6,
  666. label: 'businessTimeList',
  667. name: '业务日期',
  668. inputType: 3,
  669. width: 300,
  670. labelSize: '80',
  671. rules: [{ required: false, message: ' ' }]
  672. },
  673. {
  674. span: 6,
  675. label: 'businessType',
  676. name: '业务类型',
  677. inputType: 1,
  678. width: 200,
  679. labelSize: '80',
  680. rules: [{ required: false, message: ' ' }]
  681. },
  682. {
  683. span: 6,
  684. label: 'expenseType',
  685. name: '报销方式',
  686. inputType: 1,
  687. width: 200,
  688. labelSize: '80',
  689. rules: [{ required: false, message: ' ' }]
  690. },
  691. {
  692. span: 6,
  693. label: 'itemExpenseId',
  694. name: '费用名称',
  695. inputType: 1,
  696. width: 200,
  697. labelSize: '80',
  698. rules: [{ required: false, message: ' ' }]
  699. },
  700. {
  701. span: 6,
  702. label: 'deptId',
  703. name: '部门',
  704. inputType: 8,
  705. width: 200,
  706. labelSize: '80',
  707. rules: [{ required: false, message: ' ' }]
  708. },
  709. {
  710. span: 6,
  711. label: 'createDept',
  712. name: '制单部门',
  713. inputType: 1,
  714. width: 200,
  715. labelSize: '80',
  716. rules: [{ required: false, message: ' ' }]
  717. }, {
  718. span: 6,
  719. label: 'createById',
  720. name: '制单人',
  721. inputType: 1,
  722. width: 200,
  723. labelSize: '80',
  724. rules: [{ required: false, message: ' ' }]
  725. }, {
  726. span: 6,
  727. label: 'itemBelongsProjectId',
  728. name: '项目',
  729. inputType: 1,
  730. width: 200,
  731. labelSize: '80',
  732. rules: [{ required: false, message: ' ' }]
  733. },
  734. {
  735. span: 6,
  736. label: 'itemDepartment',
  737. name: '所属部门',
  738. inputType: 1,
  739. width: 200,
  740. labelSize: '80',
  741. rules: [{ required: false, message: ' ' }]
  742. }, {
  743. span: 6,
  744. label: 'itemPersonnel',
  745. name: '所属人员',
  746. inputType: 1,
  747. width: 200,
  748. labelSize: '80',
  749. rules: [{ required: false, message: ' ' }]
  750. }, {
  751. span: 6,
  752. label: 'itemMatterName',
  753. name: '物料',
  754. inputType: 2,
  755. width: 200,
  756. labelSize: '80',
  757. rules: [{ required: false, message: ' ' }]
  758. }, {
  759. span: 6,
  760. label: 'remark',
  761. name: '备注',
  762. inputType: 4,
  763. width: 200,
  764. labelSize: '80',
  765. rules: [{ required: false, message: ' ' }]
  766. }
  767. ],
  768. contentOption: [
  769. {
  770. index: '1',
  771. span: 6,
  772. label: 'deptId',
  773. name: '部门',
  774. inputType: 8,
  775. width: 200,
  776. disabled: true,
  777. labelSize: '80',
  778. rules: [{ required: true, message: ' ' }]
  779. }, {
  780. index: '2',
  781. span: 6,
  782. label: 'businessTime',
  783. name: '业务日期',
  784. inputType: 6,
  785. width: 200,
  786. disabled: true,
  787. labelSize: '80',
  788. rules: [{ required: true, message: ' ' }]
  789. }, {
  790. index: '3',
  791. span: 6,
  792. label: 'businessType',
  793. name: '业务类型',
  794. inputType: 1,
  795. width: 200,
  796. disabled: true,
  797. labelSize: '80',
  798. rules: [{ required: true, message: ' ' }]
  799. }, {
  800. index: '4',
  801. span: 6,
  802. label: 'expenseType',
  803. name: '报销方式',
  804. inputType: 1,
  805. width: 200,
  806. disabled: true,
  807. labelSize: '80',
  808. rules: [{ required: true, message: ' ' }]
  809. }, {
  810. index: '5',
  811. span: 6,
  812. label: 'createBy',
  813. name: '制单人',
  814. inputType: 2,
  815. width: 200,
  816. labelSize: '80',
  817. disabled: true
  818. }, {
  819. index: '6',
  820. span: 6,
  821. label: 'createDeptName',
  822. name: '制单部门',
  823. inputType: 2,
  824. width: 200,
  825. disabled: true,
  826. labelSize: '80'
  827. }, {
  828. index: '7',
  829. span: 6,
  830. label: 'createTime',
  831. name: '制单日期',
  832. inputType: 6,
  833. width: 200,
  834. disabled: true,
  835. labelSize: '80'
  836. }, {
  837. index: '8',
  838. span: 6,
  839. label: 'totalAmount',
  840. name: '金额合计',
  841. inputType: 2,
  842. width: 200,
  843. disabled: true,
  844. labelSize: '80'
  845. },
  846. {
  847. index: '9',
  848. span: 6,
  849. label: 'remark',
  850. name: '备注',
  851. inputType: 4,
  852. width: 200,
  853. disabled: true,
  854. labelSize: '80'
  855. }
  856. ],
  857. pushList: [{
  858. index: '10',
  859. span: 6,
  860. label: 'openingBankAccount',
  861. name: '账号',
  862. inputType: 1,
  863. width: 200,
  864. disabled: false,
  865. labelSize: '80'
  866. }, {
  867. index: '11',
  868. span: 6,
  869. label: 'openingBank',
  870. name: '开户行',
  871. inputType: 2,
  872. width: 200,
  873. disabled: false,
  874. labelSize: '80'
  875. }, {
  876. index: '12',
  877. span: 6,
  878. label: 'account',
  879. name: '户头',
  880. inputType: 2,
  881. width: 200,
  882. disabled: false,
  883. labelSize: '80'
  884. }],
  885. pendingPage: ''
  886. }
  887. },
  888. activated() {
  889. if (this.$route.query.list) {
  890. this.pendingPage = JSON.parse(this.$route.query.list)
  891. this.homePage()
  892. }
  893. },
  894. created() {
  895. //获取登陆人
  896. queryUserVal().then((response) => {
  897. this.lander = response.user.userName
  898. })
  899. let data = {
  900. tableName: this.queryList.tableName,
  901. userId: Cookies.get('userName')
  902. }
  903. let y = moment(Date.parse(new Date())).format('YYYY-MM-DD')
  904. // this.$set(this.formDataList, 'timeInterval', [y + ' 00:00:00', y + ' 23:59:59'])
  905. this.getRow(data)
  906. this.query(this.formDataList)
  907. treeselect().then(response => {
  908. this.dataList.deptId = response.data
  909. })
  910. listDept().then(res => {
  911. for (let item in res.data) {
  912. this.listData.departmentId.push({
  913. label: res.data[item].deptName,
  914. value: JSON.parse(res.data[item].deptId)
  915. })
  916. this.dataList.createDept.push({
  917. label: res.data[item].deptName,
  918. value: JSON.parse(res.data[item].deptId)
  919. })
  920. this.dataList.itemDepartment.push({
  921. label: res.data[item].deptName,
  922. value: JSON.parse(res.data[item].deptId)
  923. })
  924. }
  925. })
  926. getliable().then((res) => {
  927. for (let item in res.rows) {
  928. this.listData.personnelId.push({
  929. label: res.rows[item].userName,
  930. value: res.rows[item].userId
  931. })
  932. this.dataList.itemPersonnel.push({
  933. label: res.rows[item].userName,
  934. value: res.rows[item].userId
  935. })
  936. this.dataList.createById.push({
  937. label: res.rows[item].userName,
  938. value: res.rows[item].userId
  939. })
  940. }
  941. })
  942. corpsList({ fTypeid: 205 }).then(res => {
  943. for (let item in res.rows) {
  944. this.listData.belongsProjectId.push({
  945. label: res.rows[item].fName,
  946. value: JSON.parse(res.rows[item].fId)
  947. })
  948. this.dataList.itemBelongsProjectId.push({
  949. label: res.rows[item].fName,
  950. value: JSON.parse(res.rows[item].fId)
  951. })
  952. }
  953. })
  954. feesList().then(res => {
  955. for (let item in res.data) {
  956. this.listData.expenseId.push({
  957. label: res.data[item].fName,
  958. value: JSON.parse(res.data[item].fId)
  959. })
  960. this.dataList.itemExpenseId.push({
  961. label: res.data[item].fName,
  962. value: JSON.parse(res.data[item].fId)
  963. })
  964. }
  965. })
  966. this.getDicts('expense_business_type').then(res => {
  967. for (let item in res.data) {
  968. this.dataList.businessType.push({
  969. label: res.data[item].dictLabel,
  970. value: res.data[item].dictValue
  971. })
  972. }
  973. })
  974. this.getDicts('reimbursement_method').then(res => {
  975. for (let item in res.data) {
  976. this.dataList.expenseType.push({
  977. label: res.data[item].dictLabel,
  978. value: res.data[item].dictValue
  979. })
  980. }
  981. })
  982. clientCompany(6).then(res => {
  983. for (var item in res.data) {
  984. this.dataList.openingBankAccount.push({
  985. label: res.data[item].fBankno,
  986. value: res.data[item].fBankno,
  987. id: res.data[item].fId,
  988. data: res.data[item]
  989. })
  990. }
  991. console.log(res.data, 123321)
  992. })
  993. },
  994. methods: {
  995. /** 数字金额大写转换(可以处理整数,小数,负数) */
  996. dealBigMoney(n) {
  997. let fraction = ['角', '分']
  998. let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖']
  999. let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']]
  1000. let head = n < 0 ? '欠' : ''
  1001. n = Math.abs(n)
  1002. let s = ''
  1003. for (let i = 0; i < fraction.length; i++) {
  1004. s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '')
  1005. }
  1006. s = s || '整'
  1007. n = Math.floor(n)
  1008. for (let i = 0; i < unit[0].length && n > 0; i++) {
  1009. let p = ''
  1010. for (let j = 0; j < unit[1].length && n > 0; j++) {
  1011. p = digit[n % 10] + unit[1][j] + p
  1012. n = Math.floor(n / 10)
  1013. }
  1014. s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s
  1015. }
  1016. return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
  1017. },
  1018. change(scope) {
  1019. for (let item in this.contentList) {
  1020. for (let li in this.listData.fFeeid) {
  1021. if (this.contentList[item].fFeeid == this.listData.fFeeid[li].value) {
  1022. this.$set(this.contentList[item], 'fFeeunitid', this.listData.fFeeid[li].fFeeunitid)
  1023. this.$set(this.contentList[item], 'fCurrencyName', this.listData.fFeeid[li].fCurrency)
  1024. }
  1025. }
  1026. }
  1027. },
  1028. homePage() {
  1029. let date = this.$route.query
  1030. if (this.$route.query.list) {
  1031. // this.contentButton = this.$options.data().contentButton
  1032. // this.contentButton.push(JSON.parse(this.$route.query.list))
  1033. let scope = {
  1034. row: {
  1035. fId: JSON.parse(this.$route.query.data).billId
  1036. }
  1037. }
  1038. this.viewMethod(scope)
  1039. } else {
  1040. this.pageDisplay = true
  1041. }
  1042. },
  1043. // 查看审批流
  1044. getDataList() {
  1045. this.addOrUpdateVisible = false
  1046. },
  1047. returnData() {
  1048. this.addOrUpdateVisib = false
  1049. this.open = false
  1050. this.cancelTwo()
  1051. },
  1052. sequence(res) {
  1053. // let i = 0
  1054. // for ( i ; i <= this.tableData.length;i++){
  1055. // if (this.$refs.avatar.form.fId == this.tableData[i].fId) {
  1056. // console.log(i)
  1057. // if (i >= 0) this.forward = true
  1058. // if (this.tableData.length != Number(i+1)) this.backward = false
  1059. // if (i !== 0){
  1060. // console.log(this.tableData[--i].fId)
  1061. // }
  1062. // return
  1063. // }
  1064. // }
  1065. // if (res === true){
  1066. //
  1067. // }
  1068. },
  1069. addOrUpdateHandle() {
  1070. this.addOrUpdateVisible = true
  1071. this.$nextTick(() => {
  1072. this.$refs.addOrUpdate.init(this.$refs.avatar.form.fId, 560)
  1073. })
  1074. },
  1075. addOrUpdateHand() {
  1076. this.addOrUpdateVisib = true
  1077. this.$nextTick(() => {
  1078. this.$refs.ApprovalComments.init(this.$refs.avatar.form.fId, 560)
  1079. })
  1080. },
  1081. //首页审批跳转关闭返回首页
  1082. cancelTwo() {
  1083. let view = {}
  1084. if (this.pendingPage.pendingPage) {
  1085. view = {
  1086. fullPath: '/morePage/stock?open=true',
  1087. hash: '',
  1088. matched: Array(2),
  1089. meta: Object,
  1090. name: 'MorePage/stock',
  1091. params: Object,
  1092. path: '/morePage/stock',
  1093. query: Object,
  1094. title: '待审数据'
  1095. }
  1096. this.$router.push({ path: '/morePage/stock' })
  1097. } else {
  1098. view = {
  1099. fullPath: '/purchaseRequest',
  1100. hash: '',
  1101. matched: Array(2),
  1102. meta: Object,
  1103. name: 'PurchaseRequest',
  1104. params: Object,
  1105. path: '/purchaseRequest',
  1106. query: Object,
  1107. title: '采购申请'
  1108. }
  1109. this.$router.push({ path: '/index' })
  1110. }
  1111. this.$store
  1112. .dispatch('tagsView/delView', view)
  1113. .then(({ visitedViews }) => {
  1114. if (this.isActive(view)) {
  1115. this.toLastView(visitedViews, view)
  1116. }
  1117. })
  1118. Global.$emit('removeCache', 'closeSelectedTag', view)
  1119. },
  1120. //分页
  1121. handleSizeChange(val) {
  1122. // console.log(`每页 ${val} 条`);
  1123. this.formDataList.pageSize = val
  1124. this.query(this.formDataList)
  1125. },
  1126. handleCurrentChange(val) {
  1127. // console.log(`当前页: ${val}`);
  1128. this.formDataList.pageNum = val
  1129. this.query(this.formDataList)
  1130. },
  1131. //计算金额
  1132. totalAmount(scope, item, data) {
  1133. if (item.label === 'amount') {
  1134. let amount = 0
  1135. for (let item of data) {
  1136. amount += item.amount ? Number(item.amount) : 0
  1137. }
  1138. this.$set(this.$refs.avatar.form, 'totalAmount', amount.toFixed(2))
  1139. }
  1140. },
  1141. //查询主页列数据
  1142. query(data) {
  1143. console.log(data)
  1144. listQuery(data).then(res => {
  1145. this.tableData = res.rows
  1146. this.total = res.total
  1147. })
  1148. this.tEnclosure = []
  1149. this.disabled = true
  1150. },
  1151. //查询列数据
  1152. getRow(data, list, add, i) {
  1153. console.log(data, list, add)
  1154. for (let item in this.contentOption) {
  1155. for (let li in this.pushList) {
  1156. if (this.contentOption[item].label === this.pushList[li].label) {
  1157. this.contentOption.splice(item, 1)
  1158. }
  1159. }
  1160. }
  1161. select(data).then((res) => {
  1162. this.$refs.avatar.form = {}
  1163. if (data.tableName === '费用管理详情') {
  1164. if (res.data.length != 0) {
  1165. this.purchaseList.columnList = res.data.filter((e) => e.checked == 0)
  1166. this.purchaseList.columnList = res.data
  1167. this.setRowList = res.data
  1168. this.purchaseList.columnList = this.purchaseList.columnList.filter((e) => e.checked == 0)
  1169. // this.waitFor = true
  1170. } else {
  1171. this.$set(this.purchaseList, 'columnList', this.$options.data().contentStyle)
  1172. this.setRowList = this.$options.data().contentStyle
  1173. }
  1174. if (add) {
  1175. this.purchaseList.columnList.forEach(item => item.disabled = false)
  1176. this.disabled = false
  1177. } else {
  1178. this.purchaseList.columnList.forEach(item => item.disabled = true)
  1179. }
  1180. this.pageDisplay = false
  1181. this.isItHidden = false
  1182. this.inDex = this.contentOption.length
  1183. } else {
  1184. if (res.data.length != 0) {
  1185. this.queryList.columnList = res.data.filter((e) => e.checked == 0)
  1186. this.queryList.columnList = res.data
  1187. this.setRowList = res.data
  1188. this.queryList.columnList = this.queryList.columnList.filter((e) => e.checked == 0)
  1189. // this.waitFor = true
  1190. } else {
  1191. this.$set(this.queryList, 'columnList', this.$options.data().listStyle)
  1192. this.setRowList = this.$options.data().listStyle
  1193. }
  1194. this.pageDisplay = true
  1195. this.isItHidden = true
  1196. this.inDex = 4
  1197. this.$refs.avatar.assignmentTime(this.formDataList)
  1198. }
  1199. if (list) {
  1200. this.$refs.avatar.form = list.tCostManagement
  1201. this.contentList = list.tCostManagementItem
  1202. this.contentButton = this.$options.data().contentButton
  1203. this.tEnclosure = list.tEnclosure
  1204. if (this.pendingPage.name) {
  1205. this.contentButton.push(JSON.parse(this.$route.query.list))
  1206. if (JSON.parse(this.$route.query.list)) this.$router.push({ query: {} })
  1207. }
  1208. if (this.$refs.avatar.form.expenseType == 0) {
  1209. let dataTwo = []
  1210. for (let item of this.pushList) {
  1211. dataTwo.push({
  1212. ...item,
  1213. disabled: true
  1214. })
  1215. }
  1216. let item = this.contentOption.find(item => {
  1217. return item.name == '户头'
  1218. })
  1219. if (!item) {
  1220. this.contentOption = [...this.contentOption, ...dataTwo]
  1221. }
  1222. this.inDex = this.contentOption.length
  1223. } else {
  1224. for (let item in this.contentOption) {
  1225. for (let li in this.pushList) {
  1226. if (this.contentOption[item].label === this.pushList[li].label) {
  1227. this.contentOption.splice(item, 1)
  1228. }
  1229. }
  1230. }
  1231. }
  1232. let data = {
  1233. actId: 560,
  1234. id: this.$refs.avatar.form.fId
  1235. }
  1236. getName(data).then(response => {
  1237. console.log("data")
  1238. console.log(response)
  1239. if (response.data.length != 0) {
  1240. this.before = response.data[0].userName
  1241. let approvalList = response.data;
  1242. for (let key in approvalList) {
  1243. console.log("-----")
  1244. console.log(approvalList[key].auditStatus)
  1245. if (approvalList[key].auditStatus == "B") {
  1246. approvalList = approvalList.splice(Number(key) + 1, approvalList.length);
  1247. break;
  1248. }
  1249. }
  1250. this.treasurer = approvalList[1].nickName;
  1251. this.financeManager = approvalList[2].nickName;
  1252. // this.formList.firstLevelReviewerName = response.data[response.data.length - 2].nickName;
  1253. // this.formList.secondaryReviewerName = response.data[response.data.length - 1].nickName;
  1254. if (this.$refs.avatar.form.fBillstatus === 6 && this.before == this.lander) {
  1255. // this.contentButton.forEach(item =>{
  1256. // if (item.name === '审批'){
  1257. //
  1258. // }
  1259. // })
  1260. // this.contentButton.push({
  1261. // type: 'danger',
  1262. // size: 'mini',
  1263. // icon: 'el-icon-edit-outline',
  1264. // name: '撤销采购',
  1265. // disabled: false
  1266. // })
  1267. }
  1268. }
  1269. })
  1270. let operator = this.$refs.avatar.form.createBy
  1271. if (this.$refs.avatar.form.fStatus > 0 && (this.lander === operator || this.lander === 'admin')) {
  1272. this.contentButton.push({
  1273. type: 'danger',
  1274. size: 'mini',
  1275. icon: 'el-icon-edit-outline',
  1276. name: '撤销审批',
  1277. disabled: false
  1278. })
  1279. }
  1280. this.contentButton.forEach(item => {
  1281. if (this.$refs.avatar.form.fBillstatus < 4) {
  1282. if (item.name == '录入明细' || item.name == '保存') {
  1283. item.disabled = true
  1284. } else {
  1285. item.disabled = false
  1286. }
  1287. } else {
  1288. if (item.name == '修改' || item.name == '打印' || item.name == '审批') {
  1289. item.disabled = false
  1290. } else {
  1291. item.disabled = true
  1292. }
  1293. }
  1294. })
  1295. }
  1296. if (i == 1) this.submitAnd()
  1297. })
  1298. },
  1299. returnToForm(row) {
  1300. console.log(row, 111)
  1301. },
  1302. //查看-列表
  1303. viewMethod(scope, res, i) {
  1304. if (res) {
  1305. this.contentButton.forEach(item => {
  1306. item.disabled = false
  1307. this.purchaseList.columnList.forEach(item => item.disabled = false)
  1308. this.contentStyle.forEach(item => item.disabled = false)
  1309. this.contentOption.forEach(item => {
  1310. if (item.label == 'createDeptName' || item.label == 'createBy' || item.label == 'createTime' || item.label == 'totalAmount') {
  1311. item.disabled = true
  1312. } else {
  1313. item.disabled = false
  1314. }
  1315. })
  1316. })
  1317. } else {
  1318. // 部门,业务日期....设为禁用
  1319. this.contentOption.forEach(item => item.disabled = true)
  1320. // 明细设为禁用
  1321. this.contentStyle.forEach(item => item.disabled = true)
  1322. }
  1323. viewSingle(scope.row.fId).then(res => {
  1324. if (res.code === 200) {
  1325. let data = {
  1326. tableName: this.purchaseList.tableName,
  1327. userId: Cookies.get('userName')
  1328. }
  1329. // 上传附件是否打开判断
  1330. // if (scope.row.fStatusName === "完成" || scope.row.fStatusName === "录入") {
  1331. // this.disabled = false
  1332. // }
  1333. let list = {
  1334. tCostManagement: res.data.tCostManagement,
  1335. tCostManagementItem: res.data.tCostManagementItem,
  1336. tEnclosure: res.data.tEnclosure
  1337. }
  1338. // this.$refs.avatar.form = {}
  1339. this.getRow(data, list, '', i)
  1340. }
  1341. })
  1342. },
  1343. submitAnd() {
  1344. this.$refs.avatar.form.fId = ''
  1345. this.$refs.avatar.form.fBillno = ''
  1346. this.$refs.avatar.form.fCreateLog = ''
  1347. this.$refs.avatar.form.fPrintLog = ''
  1348. this.$refs.avatar.form.fReviewDate = ''
  1349. this.$refs.avatar.form.fBillstatus = 2
  1350. this.$refs.avatar.form.fPrint = 0
  1351. this.contentList.forEach(item => item.fId = '')
  1352. this.contentOption.forEach(item => {
  1353. if (item.label == 'createDeptName' || item.label == 'createBy' || item.label == 'createTime' || item.label == 'totalAmount') {
  1354. item.disabled = true
  1355. } else {
  1356. item.disabled = false
  1357. }
  1358. })
  1359. this.purchaseList.columnList.forEach(item => item.disabled = false)
  1360. this.contentButton.forEach(item => item.disabled = false)
  1361. this.contentStyle.forEach(item => item.disabled = false)
  1362. },
  1363. //修改
  1364. modification(scope) {
  1365. console.log(scope)
  1366. },
  1367. //删除
  1368. deletion(scope) {
  1369. console.log(scope.row.fId)
  1370. // tableDeleteQuery(scope.row.fId).then(res => {
  1371. //
  1372. // })
  1373. // this.$confirm(res.msg == 1 ? '主表数据为空' : (res.msg == 2 ? '主表有数据' : '未知状态') + '是否永久删除该条数据?', '提示', {
  1374. this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
  1375. confirmButtonText: '确定',
  1376. cancelButtonText: '取消',
  1377. type: 'warning'
  1378. }).then(() => {
  1379. confirmDeletion(scope.row.fId).then(data => {
  1380. this.$message({
  1381. type: 'success',
  1382. message: '删除成功!'
  1383. })
  1384. this.query(this.formDataList)
  1385. })
  1386. }).catch(() => {
  1387. this.$message({
  1388. type: 'info',
  1389. message: '已取消删除'
  1390. })
  1391. })
  1392. },
  1393. //选择框
  1394. selectionbox(selection) {
  1395. if (selection.length > 1) {
  1396. this.customButton.forEach(item => {
  1397. if (item.name === '复制新单') {
  1398. item.disabled = true
  1399. } else {
  1400. item.disabled = false
  1401. }
  1402. })
  1403. } else {
  1404. this.customButton.forEach(item => item.disabled = false)
  1405. this.selection = selection
  1406. }
  1407. },
  1408. //详情内容保存
  1409. submitAndSave(item, res) {
  1410. // if (this.$refs.avatar.form.fBillstatus <= 4 || this.$refs.avatar.form.fBillstatus > 5 || !this.$refs.avatar.form.fBillstatus) {
  1411. let formData = new window.FormData()
  1412. this.$refs.avatar.form.fMoney = 0
  1413. this.contentList.forEach(item => this.$refs.avatar.form.fMoney += Number(item.fAmount))
  1414. formData.append('tCostManagement', JSON.stringify(this.$refs.avatar.form))
  1415. formData.append('tCostManagementItem', JSON.stringify(this.contentList))
  1416. formData.append('tEnclosure', JSON.stringify(this.tEnclosure))
  1417. formData.append('fBilltype', 'FY')
  1418. if (item === 3) {
  1419. this.$refs.avatar.form.fId = ''
  1420. this.$refs.avatar.form.fBillno = ''
  1421. this.$refs.avatar.form.fCreateLog = ''
  1422. this.$refs.avatar.form.fPrintLog = ''
  1423. this.$refs.avatar.form.fBillstatus = 2
  1424. this.$refs.avatar.form.fPrint = 0
  1425. this.contentList.forEach(item => item.fId = '')
  1426. this.tEnclosure = []
  1427. this.contentOption.forEach(item => {
  1428. if (item.label == 'createDeptName' || item.label == 'createBy' || item.label == 'createTime' || item.label == 'totalAmount') {
  1429. item.disabled = true
  1430. } else {
  1431. item.disabled = false
  1432. }
  1433. })
  1434. this.disabled = false
  1435. this.$message.success('操作成功')
  1436. this.purchaseList.columnList.forEach(item => item.disabled = false)
  1437. this.contentButton.forEach(item => item.disabled = false)
  1438. this.contentStyle.forEach(item => item.disabled = false)
  1439. } else {
  1440. submit(formData).then(res => {
  1441. if (res.code == 200) {
  1442. if (res) {
  1443. this.$refs.avatar.form = res.data.tCostManagement
  1444. }
  1445. this.contentList = res.data.tCostManagementItem
  1446. this.tEnclosure = res.data.tEnclosure
  1447. this.$message.success('保存成功')
  1448. viewSingle(this.$refs.avatar.form.fId).then(res => {
  1449. if (res.code === 200) {
  1450. let list = {
  1451. tCostManagement: res.data.tCostManagement,
  1452. tCostManagementItem: res.data.tCostManagementItem,
  1453. tEnclosure: res.data.tEnclosure
  1454. }
  1455. this.$refs.avatar.form = list.tCostManagement
  1456. this.contentList = list.tCostManagementItem
  1457. this.tEnclosure = list.tEnclosure
  1458. }
  1459. })
  1460. }
  1461. })
  1462. }
  1463. // }
  1464. if (item == 1) {
  1465. this.dialogVisible = true
  1466. } else if (item === 2) {
  1467. let data = {
  1468. tableName: this.queryList.tableName,
  1469. userId: Cookies.get('userName')
  1470. }
  1471. this.getRow(data)
  1472. this.query(this.formDataList)
  1473. }
  1474. if (item === 3 && this.$refs.avatar.form.fBillstatus > 3) {
  1475. this.$refs.avatar.form.fId = ''
  1476. this.$refs.avatar.form.fBillno = ''
  1477. this.$refs.avatar.form.fCreateLog = ''
  1478. this.$refs.avatar.form.fReviewDate = ''
  1479. this.$refs.avatar.form.fReviewDate = ''
  1480. this.$refs.avatar.form.fPrintLog = ''
  1481. this.$refs.avatar.form.fBillstatus = 2
  1482. this.$refs.avatar.form.fPrint = 0
  1483. this.contentList.forEach(item => item.fId = '')
  1484. this.contentOption.forEach(item => {
  1485. if (item.label == 'createDeptName' || item.label == 'createBy' || item.label == 'createTime' || item.label == 'totalAmount') {
  1486. item.disabled = true
  1487. } else {
  1488. item.disabled = false
  1489. }
  1490. })
  1491. this.purchaseList.columnList.forEach(item => item.disabled = false)
  1492. this.contentButton.forEach(item => item.disabled = false)
  1493. this.contentStyle.forEach(item => item.disabled = false)
  1494. // let datae = {
  1495. // fId:this.$refs.avatar.form.fId,
  1496. // fBilltype:'FY'
  1497. // }
  1498. // copyNew(datae).then(res=> {
  1499. // this.$message({
  1500. // message: '复制新单成功',
  1501. // type: 'success',
  1502. // showClose: true
  1503. // });
  1504. // let scope = {
  1505. // row: {
  1506. // fId: res.data
  1507. // }
  1508. // }
  1509. // this.query(this.formDataList)
  1510. // this.viewMethod(scope,res)
  1511. // })
  1512. }
  1513. },
  1514. //表单选中后触发
  1515. selectTrigger(name, list, id) {
  1516. console.log(name, list, id)
  1517. if (name == 'openingBankAccount') {
  1518. for (const data of this.dataList.openingBankAccount) {
  1519. if (data.value == id) {
  1520. this.$refs.avatar.form.openingBank = data.data.fBankname
  1521. this.$refs.avatar.form.account = data.data.accountTitle
  1522. }
  1523. }
  1524. }
  1525. if (name == 'fGoodsid') {
  1526. for (let item in list) {
  1527. if (list[item].value == id) {
  1528. this.$refs.avatar.form.personNaem = list[item].personNaem
  1529. this.$refs.avatar.form.corpsName = list[item].corpsName
  1530. }
  1531. }
  1532. }
  1533. if (name === 'expenseType') {
  1534. if (id == 0) {
  1535. let item = this.contentOption.find(item => {
  1536. return item.name == '户头'
  1537. })
  1538. if (!item) {
  1539. this.contentOption = [...this.contentOption, ...this.pushList]
  1540. }
  1541. this.inDex = this.contentOption.length
  1542. } else {
  1543. for (let item in this.contentOption) {
  1544. for (let li in this.pushList) {
  1545. if (this.contentOption[item].label === this.pushList[li].label) {
  1546. this.contentOption.splice(item, 1)
  1547. }
  1548. }
  1549. }
  1550. this.inDex = this.contentOption.length
  1551. }
  1552. }
  1553. },
  1554. //确认打印
  1555. Printing() {
  1556. // 添加打印次数
  1557. let data = {
  1558. id : this.formList.fId + '',
  1559. printDate : this.formList.printDate
  1560. };
  1561. setPrintTime(data).then(res => {
  1562. if (res.code === 200) {
  1563. this.$print(this.$refs.print)
  1564. } else {
  1565. this.$message.error('修改打印此处出错');
  1566. }
  1567. })
  1568. },
  1569. //返回列表
  1570. backToList() {
  1571. let data
  1572. if (!this.$refs.avatar.form.fId && this.contentList !== 0 || this.$refs.avatar.form.fBillstatus > 3 && !this.$route.query.data) {
  1573. data = {
  1574. tableName: this.queryList.tableName,
  1575. userId: Cookies.get('userName')
  1576. }
  1577. this.getRow(data)
  1578. this.query(this.formDataList)
  1579. } else if (this.$route.query.data) {
  1580. this.cancelTwo()
  1581. // this.$router.push({path:'/index'})
  1582. } else {
  1583. this.$confirm('当前数据是否保存?', '提示', {
  1584. confirmButtonText: '保存',
  1585. cancelButtonText: '取消',
  1586. type: 'warning'
  1587. }).then(() => {
  1588. this.submitAndSave(2, 1)
  1589. }).catch(() => {
  1590. data = {
  1591. tableName: this.queryList.tableName,
  1592. userId: Cookies.get('userName')
  1593. }
  1594. this.getRow(data)
  1595. this.query(this.formDataList)
  1596. })
  1597. }
  1598. },
  1599. //所有按钮
  1600. buttonList(row) {
  1601. console.log(row)
  1602. let data
  1603. switch (row.name) {
  1604. case '新单':
  1605. if (row.nameTwo == '详情页') {
  1606. if (this.$refs.avatar.form.fId) {
  1607. this.contentList = []
  1608. data = {
  1609. tableName: this.purchaseList.tableName,
  1610. userId: Cookies.get('userName')
  1611. }
  1612. this.$refs.avatar.form = {}
  1613. this.getRow(data, '', 1)
  1614. this.contentOption.forEach(item => {
  1615. if (item.label == 'createDeptName' || item.label == 'createBy' || item.label == 'createTime' || item.label == 'totalAmount') {
  1616. item.disabled = true
  1617. } else {
  1618. item.disabled = false
  1619. }
  1620. })
  1621. this.contentButton.forEach(item => item.disabled = false)
  1622. this.contentStyle.forEach(item => item.disabled = false)
  1623. this.tEnclosure = []
  1624. // this.$set(this,'tEnclosure',[])
  1625. this.$refs.avatar.clearVerification()
  1626. this.$refs.avatar.form.createBy = Cookies.get('userName')
  1627. } else {
  1628. this.$message.error('当前数据未保存,请先保存')
  1629. }
  1630. } else {
  1631. this.contentList = []
  1632. data = {
  1633. tableName: this.purchaseList.tableName,
  1634. userId: Cookies.get('userName')
  1635. }
  1636. this.$refs.avatar.form = {}
  1637. this.getRow(data, '', 1)
  1638. //点击列表新单控制主表是否需要禁用项
  1639. this.contentOption.forEach(item => {
  1640. if (item.label == 'createDeptName' || item.label == 'createBy' || item.label == 'createTime' || item.label == 'totalAmount') {
  1641. item.disabled = true
  1642. } else {
  1643. item.disabled = false
  1644. }
  1645. })
  1646. this.contentButton.forEach(item => item.disabled = false)
  1647. this.contentStyle.forEach(item => item.disabled = false)
  1648. this.tEnclosure = []
  1649. this.$refs.avatar.clearVerification()
  1650. this.$refs.avatar.form.createBy = Cookies.get('userName')
  1651. }
  1652. break
  1653. case '保存':
  1654. this.$refs.avatar.submitForm('submit')
  1655. break
  1656. case '导出包含明细':
  1657. const exportData = this.formDataList;
  1658. this.$confirm('是否确认导出所有导出包含明细数据项?', "警告", {
  1659. confirmButtonText: "确定",
  1660. cancelButtonText: "取消",
  1661. type: "warning"
  1662. }).then(function() {
  1663. return exportContact(exportData);
  1664. }).then(response => {
  1665. this.download(response.msg);
  1666. })
  1667. break
  1668. case '导出':
  1669. const exportAll = this.formDataList;
  1670. this.$confirm('是否确认导出所有数据项?', "警告", {
  1671. confirmButtonText: "确定",
  1672. cancelButtonText: "取消",
  1673. type: "warning"
  1674. }).then(function() {
  1675. return exportAllContact(exportAll);
  1676. }).then(response => {
  1677. this.download(response.msg);
  1678. })
  1679. break
  1680. case '打印':
  1681. if (Number(this.$refs.avatar.form.fStatus) >= 3) {
  1682. for (let item in this.contentList) {
  1683. for (let li in this.listData.fFeeid) {
  1684. if (this.contentList[item].fFeeid == this.listData.fFeeid[li].value) {
  1685. this.contentList[item].feeName = this.listData.fFeeid[li].label
  1686. }
  1687. }
  1688. for (let i in this.listData.fFeeunitid) {
  1689. if (this.contentList[item].fFeeunitid == this.listData.fFeeunitid[i].value) {
  1690. this.contentList[item].fFeeunitName = this.listData.fFeeunitid[i].label
  1691. }
  1692. }
  1693. }
  1694. if (!this.$refs.avatar.form.fId) {
  1695. this.$message.error('未保存,不允许打印')
  1696. } else if (this.$refs.avatar.form.fBillstatus >= 4) {
  1697. this.formList = this.$refs.avatar.form
  1698. this.formList.firstLevelReviewerName = this.treasurer
  1699. this.formList.secondaryReviewerName = this.financeManager
  1700. let printDate = new Date();
  1701. this.formList.printDate = printDate.toLocaleString();
  1702. this.dialogVisible = true
  1703. } else {
  1704. this.formList = this.$refs.avatar.form
  1705. this.formList.firstLevelReviewerName = this.treasurer
  1706. this.formList.secondaryReviewerName = this.financeManager
  1707. let printDate = new Date();
  1708. this.formList.printDate = printDate.toLocaleString();
  1709. this.submitAndSave(1)
  1710. }
  1711. } else {
  1712. this.$message.warning('未审核或未通过审核')
  1713. }
  1714. break
  1715. case '修改':
  1716. this.contentButton.forEach(item => {
  1717. // if (this.$refs.avatar.form.fBillstatus == 6) {
  1718. // if (item.name === '返回列表' || item.name == '打印' || item.name === '修改' || item.name === '查看审批' || item.name === '审批' || item.name === '撤销采购' || item.name === '撤销审批' || item.name === '保存') {
  1719. // item.disabled = false
  1720. // } else {
  1721. // item.disabled = true
  1722. // }
  1723. // this.contentStyle.forEach(item => {
  1724. // if (item.label == 'fUnitprice' || item.label == 'fQty' || item.label == 'fAmount' || item.label == 'remark') {
  1725. // item.disabled = false
  1726. // } else {
  1727. // item.disabled = true
  1728. // }
  1729. // })
  1730. // this.purchaseList.columnList.forEach(item => {
  1731. // if (item.label == 'fUnitprice' || item.label == 'fQty' || item.label == 'fAmount' || item.label == 'remark') {
  1732. // item.disabled = false
  1733. // } else {
  1734. // item.disabled = true
  1735. // }
  1736. // })
  1737. // } else if (this.$refs.avatar.form.fBillstatus >= 4) {
  1738. // if (item.name === '返回列表' || item.name == '打印' || item.name === '修改' || item.name === '查看审批' || item.name === '审批' || item.name === '撤销采购' || item.name === '撤销审批' || item.name === '保存') {
  1739. // item.disabled = false
  1740. // } else {
  1741. // item.disabled = true
  1742. // }
  1743. // } else
  1744. if (this.$refs.avatar.form.fStatus > 0) {
  1745. if (item.name === '返回列表' || item.name == '打印' || item.name === '修改' || item.name === '查看审批' || item.name === '审批' || item.name === '撤销采购' || item.name === '撤销审批' || item.name === '保存') {
  1746. item.disabled = false
  1747. } else {
  1748. item.disabled = true
  1749. }
  1750. this.disabled = true
  1751. } else {
  1752. item.disabled = false
  1753. this.purchaseList.columnList.forEach(item => item.disabled = false)
  1754. this.contentStyle.forEach(item => item.disabled = false)
  1755. this.contentOption.forEach(item => {
  1756. if (item.label == 'createDeptName' || item.label == 'createBy' || item.label == 'createTime' || item.label == 'totalAmount') {
  1757. item.disabled = true
  1758. } else {
  1759. item.disabled = false
  1760. }
  1761. })
  1762. this.disabled = false
  1763. }
  1764. })
  1765. break
  1766. case '录入明细':
  1767. this.contentList.push({
  1768. fFeeid: '',
  1769. fPurchase: '',
  1770. fFeeunitid: '',
  1771. fStltypeid: '',
  1772. remark: '',
  1773. createTime: 0,
  1774. fAmount: 0,
  1775. fQty: 0,
  1776. fUnitprice: 0,
  1777. createBy: Cookies.get('userName'),
  1778. fReviewDate: '',
  1779. operation: ''
  1780. })
  1781. break
  1782. case '查看审批':
  1783. this.addOrUpdateHandle()
  1784. break
  1785. case '审批':
  1786. this.addOrUpdateHand()
  1787. break
  1788. case '请核':
  1789. if (this.$refs.avatar.form.fStatus < 1) {
  1790. this.$refs.avatar.submitForm('check')
  1791. } else {
  1792. this.$message.error('请先保存')
  1793. }
  1794. break
  1795. case '复制新单':
  1796. if (row.nameTwo === '详情页') {
  1797. this.$refs.avatar.submitForm('submit', 3)
  1798. } else {
  1799. if (this.selection.length > 0) {
  1800. let scope = {
  1801. row: {
  1802. fId: this.selection[0].fId
  1803. }
  1804. }
  1805. this.query(this.formDataList)
  1806. this.viewMethod(scope, '', 1)
  1807. } else {
  1808. this.$message.warning('未选择列表,请选择后再点击')
  1809. }
  1810. }
  1811. break
  1812. case '撤销审批':
  1813. let date = new Date()
  1814. let y = date.getFullYear()
  1815. let m = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1)
  1816. let d = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate())
  1817. data = {
  1818. actId: 560,
  1819. id: this.$refs.avatar.form.fId,
  1820. billId: this.$refs.avatar.form.fId,
  1821. auditItem: y + '-' + m + '-' + d
  1822. }
  1823. console.log(data)
  1824. revoke(data).then(res => {
  1825. if (res.code === 200) {
  1826. this.$message({
  1827. showClose: true,
  1828. message: '撤销成功',
  1829. type: 'success'
  1830. })
  1831. data = {
  1832. tableName: this.queryList.tableName,
  1833. userId: Cookies.get('userName')
  1834. }
  1835. this.getRow(data)
  1836. this.query(this.formDataList)
  1837. }
  1838. })
  1839. break
  1840. case '撤销采购':
  1841. if (this.$refs.avatar.form.fTakeOrders == 2) {
  1842. this.$confirm('该订单已接单, 是否继续?', '提示', {
  1843. confirmButtonText: '确定',
  1844. cancelButtonText: '取消',
  1845. type: 'warning'
  1846. }).then(() => {
  1847. withdrawBy(this.$refs.avatar.form.fId).then(res => {
  1848. if (res.code === 200) {
  1849. this.$message({
  1850. showClose: true,
  1851. message: '撤销成功',
  1852. type: 'success'
  1853. })
  1854. data = {
  1855. tableName: this.queryList.tableName,
  1856. userId: Cookies.get('userName')
  1857. }
  1858. this.getRow(data)
  1859. this.query(this.formDataList)
  1860. }
  1861. })
  1862. }).catch(() => {
  1863. this.$message({
  1864. type: 'info',
  1865. message: '已取消删除'
  1866. })
  1867. })
  1868. } else {
  1869. withdrawBy(this.$refs.avatar.form.fId).then(res => {
  1870. if (res.code === 200) {
  1871. this.$message({
  1872. showClose: true,
  1873. message: '撤销成功',
  1874. type: 'success'
  1875. })
  1876. data = {
  1877. tableName: this.queryList.tableName,
  1878. userId: Cookies.get('userName')
  1879. }
  1880. this.getRow(data)
  1881. this.query(this.formDataList)
  1882. }
  1883. })
  1884. }
  1885. break
  1886. default:
  1887. this.$message.error('该按钮暂无功能')
  1888. }
  1889. },
  1890. //请核
  1891. writeOff() {
  1892. let formData = new window.FormData()
  1893. formData.append('tCostManagement', JSON.stringify(this.$refs.avatar.form))
  1894. formData.append('tCostManagementItem', JSON.stringify(this.contentList))
  1895. formData.append('tEnclosure', JSON.stringify(this.tEnclosure))
  1896. formData.append('fBilltype', 'FY')
  1897. pleaseCheck(formData).then(res => {
  1898. if (res.code == 200) {
  1899. this.$message.success('请核成功')
  1900. this.contentOption.forEach(item => item.disabled = true)
  1901. this.contentStyle.forEach(item => item.disabled = true)
  1902. this.contentButton.forEach(item => {
  1903. if (item.name == '返回列表' || item.name == '修改' || item.name == '打印') {
  1904. item.disabled = false
  1905. } else {
  1906. item.disabled = true
  1907. }
  1908. })
  1909. // this.$refs.avatar.form = res.data.warehouseBills
  1910. // this.contentList = res.data.tWarehousebillsCntrs
  1911. let data = {
  1912. tableName: this.queryList.tableName,
  1913. userId: Cookies.get('userName')
  1914. }
  1915. this.getRow(data)
  1916. this.query(this.formDataList)
  1917. }
  1918. })
  1919. },
  1920. // 显示搜索条件、点击后会调用此方法
  1921. showSearch() {
  1922. console.log('到我了')
  1923. this.searchWhether = !this.searchWhether
  1924. },
  1925. //搜索、重置、展开
  1926. feedback(res) {
  1927. console.log(res)
  1928. if (res == '展开') {
  1929. if (this.inDex == 4) {
  1930. this.inDex = this.formOption.length
  1931. } else {
  1932. this.inDex = 4
  1933. }
  1934. } else if (res == '搜索') {
  1935. this.$refs.avatar.submitForm()
  1936. } else if (res == '重置') {
  1937. this.formDataList = {
  1938. pageNum: 1,
  1939. pageSize: 10,
  1940. timeInterval: null,
  1941. fBilltype: 'FY'
  1942. }
  1943. this.$refs.avatar.assignmentTime(this.formDataList)
  1944. this.$refs.avatar.submitForm()
  1945. }
  1946. },
  1947. //表单验证通过执行搜索
  1948. submitForm() {
  1949. let list = this.formDataList
  1950. // console.log(this.$refs.avatar.form)
  1951. this.formDataList = this.$refs.avatar.form
  1952. this.formDataList.fBilltype = list.fBilltype
  1953. this.formDataList.pageSize = list.pageSize
  1954. this.formDataList.pageNum = list.pageNum
  1955. // this.formDataList.timeInterval = list.timeInterval
  1956. this.query(this.formDataList)
  1957. },
  1958. //点击刷新会调用此方法
  1959. getList() {
  1960. this.feedback('重置')
  1961. this.submitForm()
  1962. console.log('到我了2')
  1963. },
  1964. //详情表内容移出
  1965. deletRows(index, rows) {
  1966. this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
  1967. confirmButtonText: '确定',
  1968. cancelButtonText: '取消',
  1969. type: 'warning'
  1970. }).then(() => {
  1971. if (rows[index].fId) {
  1972. listDelete(rows[index].fId).then(data => {
  1973. rows.splice(index, 1)
  1974. let amount = 0
  1975. for (let item of rows) {
  1976. amount += item.amount ? Number(item.amount) : 0
  1977. }
  1978. this.$set(this.$refs.avatar.form, 'totalAmount', amount.toFixed(2))
  1979. this.$message({
  1980. type: 'success',
  1981. message: '删除成功!'
  1982. })
  1983. })
  1984. } else {
  1985. rows.splice(index, 1)
  1986. let amount = 0
  1987. for (let item of rows) {
  1988. amount += item.amount ? Number(item.amount) : 0
  1989. }
  1990. this.$set(this.$refs.avatar.form, 'totalAmount', amount.toFixed(2))
  1991. this.$message({
  1992. type: 'success',
  1993. message: '删除成功!'
  1994. })
  1995. }
  1996. }).catch(() => {
  1997. this.$message({
  1998. type: 'info',
  1999. message: '已取消删除'
  2000. })
  2001. })
  2002. }
  2003. }
  2004. }
  2005. </script>
  2006. <style scoped>
  2007. .table {
  2008. border-collapse: collapse;
  2009. border-spacing: 0;
  2010. background-color: transparent;
  2011. display: table;
  2012. width: 100%;
  2013. max-width: 100%;
  2014. margin: 0 auto;
  2015. }
  2016. .table td {
  2017. text-align: center;
  2018. vertical-align: middle;
  2019. font-size: 14px;
  2020. color: #000000;
  2021. padding: 8px 12px;
  2022. }
  2023. .column {
  2024. border: 1px solid #000;
  2025. }
  2026. .app-container >>> .el-form-item {
  2027. margin-bottom: 0;
  2028. }
  2029. </style>