index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475
  1. <template>
  2. <basic-container>
  3. <avue-crud :option="option" :data="dataList" ref="crud" v-model="form" :page.sync="page" :search.sync="search"
  4. :table-loading="loading" :cell-style="cellStyle" @search-change="searchChange" @search-reset="searchReset"
  5. @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
  6. @refresh-change="refreshChange" @on-load="onLoad">
  7. <template slot="corpIdSearch">
  8. <!-- <select-component v-model="search.corpId" :configuration="configuration"></select-component>-->
  9. <el-select v-model="search.corpId" clearable placeholder="请选择">
  10. <el-option
  11. v-for="item in corpsList"
  12. :key="item.id"
  13. :label="item.cname"
  14. :value="item.id">
  15. </el-option>
  16. </el-select>
  17. </template>
  18. <template slot-scope="scope" slot="checkType">
  19. <span v-if="scope.row.checkType == 'HYCK-FFSQ'">付费申请</span>
  20. <span v-if="scope.row.checkType == 'HYCK-FPSQ'">发票申请</span>
  21. <span v-else-if="scope.row.checkType == 'HYCK-DJ'">海运出口</span>
  22. <span v-else-if="scope.row.checkType == 'HYCK-FY'">海运出口费用</span>
  23. <span v-else-if="scope.row.checkType == 'HYJK-DJ'">海运进口</span>
  24. <span v-else-if="scope.row.checkType == 'HYJK-FY'">海运进口费用</span>
  25. </template>
  26. <template slot-scope="scope" slot="billNo">
  27. <span style="color: #1e9fff" @click="billNoDetails(scope.row)">{{scope.row.billNo}}</span>
  28. </template>
  29. <!-- <template slot="menuLeft">
  30. <el-button size="small" type="success" :disabled="selectionList.length == 0" @click.stop="batchCheck">批量审批
  31. </el-button>
  32. </template> -->
  33. <template slot-scope="scope" slot="menu">
  34. <!-- <el-button type="text" size="small" :disabled="scope.row.operate" @click.stop="jumpPage(scope.row)">查看-->
  35. <!-- </el-button>-->
  36. <el-button type="text" size="small" :disabled="scope.row.operate" @click.stop="jumpPage(scope.row)">查看
  37. </el-button>
  38. <el-button type="text" size="small" v-if="scope.row.checkType == 'HYCK-DJ'" :disabled="scope.row.auditStatus != 'S'" @click.stop="handleReportPreview(scope.row.url,scope.row)">
  39. 审批
  40. </el-button>
  41. <el-button type="text" size="small" v-else :disabled="scope.row.auditStatus != 'S'" @click.stop="openCheck(scope.row)">
  42. 审批
  43. </el-button>
  44. <el-button type="text" size="small" @click.stop="openCheckSchedule(scope.row)">审批流程
  45. </el-button>
  46. </template>
  47. </avue-crud>
  48. <el-dialog append-to-body title="审批进度" class="el-dialogDeep" :visible.sync="checkScheduleDialog" width="40%"
  49. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
  50. <check-schedule :checkId="checkId" :batchNo="batchNo" @choceScheduleFun="choceScheduleFun">
  51. </check-schedule>
  52. </el-dialog>
  53. <el-dialog append-to-body title="审批" class="el-dialogDeep" :visible.sync="checkDialog" width="50%"
  54. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
  55. <check :checkData="checkData" :checkDetail="true" :idList="idList" @operationType="operationTypeFFSQ"
  56. @choceCheckFun="choceCheckFFSQ">
  57. </check>
  58. </el-dialog>
  59. <reportContainerlos style="width: 100%; height: 100vh" ref="reportContainer">
  60. <check :checkData="checkData" :checkDetail="true" :idList="idList" @operationType="operationType"
  61. @choceCheckFun="choceCheckFun">
  62. </check>
  63. </reportContainerlos>
  64. </basic-container>
  65. </template>
  66. <script>
  67. import option from "./configuration/mainList.json";
  68. import option2 from "./configuration/mainList2.json";
  69. import option3 from "./configuration/mainList3.json";
  70. import option4 from "./configuration/mainList4.json";
  71. import { getList, approvePass, financingExcess } from "@/api/approveDataH/main";
  72. import checkSchedule from "@/components/checkH/checkSchedule";
  73. import check from "./check";
  74. import { getUserInfo } from "@/api/system/user";
  75. import { gainUser } from "@/api/basicData/customerInquiry";
  76. import {corpsDescListAll} from "../../api/tirePartsMall/salesManagement/saleOrder";
  77. import reportContainerlos from "@/views/iosBasicData/report-container/report-container-los.vue"
  78. import {finstlbillsDetail} from "../../api/iosBasicData/finstlbills";
  79. import {reportsGetReportData} from "@/api/iosBasicData/reports";
  80. let previousRouterName = "";
  81. let checkRefresh = "";
  82. export default {
  83. components: {
  84. check,
  85. checkSchedule,
  86. reportContainerlos
  87. },
  88. data() {
  89. return {
  90. reportlist:[], // 报表数据
  91. corpsList: [],
  92. loading: false,
  93. form: {},
  94. search: {},
  95. show: true,
  96. checkDialog: false,
  97. checkId: "",
  98. batchNo: "",
  99. checkScheduleDialog: false,
  100. detailData: {},
  101. option: {},
  102. parentId: 0,
  103. checkData: {},
  104. dataList: [],
  105. idList: [],
  106. selectionList: [],
  107. page: {
  108. pageSize: 10,
  109. pagerCount: 5,
  110. total: 0
  111. },
  112. query: {},
  113. configuration: {
  114. multipleChoices: false,
  115. multiple: false,
  116. disabled: false,
  117. searchShow: true,
  118. collapseTags: false,
  119. clearable: true,
  120. placeholder: "请点击右边按钮选择",
  121. dicData: []
  122. }
  123. };
  124. },
  125. created() {
  126. getUserInfo().then(res => {
  127. if (res.data.data.billType == 1) {
  128. this.option = option2;
  129. } else {
  130. if (this.$store.getters.userInfo.tenant_id === "681169") {
  131. this.option = option3;
  132. }else if (this.$store.getters.userInfo.tenant_id === "673511") {
  133. this.option = option4;
  134. }else if (this.$store.getters.userInfo.tenant_id === "064132") {
  135. this.option = option4;
  136. } else {
  137. this.option = option;
  138. }
  139. console.log(this.option);
  140. }
  141. this.getWorkDicts("auditStatus").then(res => {
  142. this.findObject(this.option.column, "auditStatus").dicData =
  143. res.data.data;
  144. });
  145. gainUser().then(res => {
  146. this.findObject(this.option.column, "sendUserId").dicData =
  147. res.data.data;
  148. });
  149. this.getWorkDicts("tire_audit").then(res => {
  150. this.findObject(this.option.column, "processType").dicData =
  151. res.data.data;
  152. });
  153. });
  154. // 供应商
  155. // corpsDescListAll({corpType: "GYS"}).then(res => {
  156. // this.corpsList = res.data.data
  157. // })
  158. },
  159. mounted() {
  160. // option.height = window.innerHeight - 200 ;
  161. },
  162. activated() {
  163. if (this.$route.query.check === "refresh") {
  164. this.onLoad(this.page, this.search);
  165. }
  166. },
  167. methods: {
  168. // 预览报表
  169. async handleReportPreview(url,row){
  170. this.checkData = row
  171. const res = await reportsGetReportData({
  172. billId:row.billId,
  173. reportCode:'FYSH',
  174. groupCode:2,
  175. })
  176. var data = res.data.data.data.map((item,index)=>{
  177. item.index = index
  178. item.feeCenterList.forEach(ite=>{
  179. ite.ppid = index
  180. })
  181. return item
  182. })
  183. this.reportlist = data // 存一下数据 打印的时候需要传
  184. console.log(data,220)
  185. // 报表取的是最后一项,把第一项的数据赋值给最后一项
  186. data[data.length - 1].amountDrUsd = data[0].amountDrUsd
  187. data[data.length - 1].amountDr = data[0].amountDr
  188. data[data.length - 1].amountCrUsd = data[0].amountCrUsd
  189. data[data.length - 1].amountCr = data[0].amountCr
  190. data[data.length - 1].amountProfitUsd = data[0].amountProfitUsd
  191. data[data.length - 1].amountProfit = data[0].amountProfit
  192. data[data.length - 1].amountProfitLoc = data[0].amountProfitLoc
  193. data[data.length - 1].rate = data[0].rate
  194. data[data.length - 1].grossMargin = data[0].grossMargin
  195. console.log(row,203)
  196. Stimulsoft.Base.StiLicense.key = '6vJhGtLLLz2GNviWmUTrhSqnOItdDwjBylQzQcAOiHn0s4g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33GWu7ZsPBeUdGu55R8w='
  198. Stimulsoft.Base.Localization.StiLocalization.addLocalizationFile( '/reports/stimulsoft/Localization/zh-CHS.xml', true, 'zh-CHS')
  199. Stimulsoft.Base.Localization.StiLocalization.setLocalizationFile('/reports/stimulsoft/Localization/zh-CHS.xml' )
  200. // 工具栏
  201. var options = new Stimulsoft.Viewer.StiViewerOptions()
  202. options.height = '100%'
  203. options.appearance.scrollbarsMode = true
  204. options.toolbar.showDesignButton = false
  205. options.toolbar.showAboutButton = false
  206. options.toolbar.showResourcesButton = false
  207. options.toolbar.showFullScreenButton = false
  208. options.toolbar.showOpenButton = false
  209. options.appearance.showTooltips = false
  210. options.appearance.showDialogsHelp = false
  211. options.exports.showExportToDocument = false
  212. options.toolbar.showParametersButton = true
  213. options.appearance.bookmarksPrint = true
  214. options.toolbar.printDestination = Stimulsoft.Viewer.StiPrintDestination.Direct
  215. options.appearance.htmlRenderMode = Stimulsoft.Report.Export.StiHtmlExportMode.Table
  216. let viewer = new Stimulsoft.Viewer.StiViewer(options, 'StiViewer', false)
  217. // 报表
  218. console.log("创建一个报表实例");
  219. let report = new window.Stimulsoft.Report.StiReport();
  220. // 加载文件
  221. console.log("从url加载报表");
  222. // report.loadFile("/reports/stimulsoft/demos/SimpleList.mrt");
  223. // report.load(row.url)
  224. report.load(res.data.data.url)
  225. // 加载数据
  226. var dataSet = new Stimulsoft.System.Data.DataSet(
  227. 'reportData'
  228. )
  229. dataSet.readJson(data)
  230. report.regData('reportData', 'reportData', dataSet)
  231. // 从模版和数据加载报表
  232. // loadReport(report, '', {})
  233. viewer.report = report;
  234. this.$refs.reportContainer.showContainer(
  235. ()=> {
  236. setTimeout(() => {
  237. viewer.renderHtml('reportContainer')
  238. this.createViewerButtons(viewer)
  239. }, 50)
  240. },
  241. ()=>{
  242. },
  243. )
  244. console.log(report,301)
  245. // var printButton = report.renderedPages[0].components.find(function(c) {
  246. // return c.name === 'printButton';
  247. // });
  248. // // 为按钮控件添加“PrintReport”事件
  249. // printButton.events.add('PrintReport', handlePrintReport);
  250. console.log("加载成功完成!");
  251. },
  252. // 报表的按钮
  253. createViewerButtons (viewer){
  254. viewer.jsObject.collections.images['myClose.png'] =
  255. 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAA0ElEQVQ4ja3TO05CQRQG4A8iOwAbtYWETndAaecK7NwCKmETtJZsSBNLobEz8ZFIJQ0UnOGSm3DnYviTybzO/895DQXGWGCVGQuMEqkRcwcfuMOLalziCaf4TIe9UG9nyMJmFRzNGoRK1BU4xxx9G7cfwostciGk+x8MqgySwDXe4tU53hVV+MNtTmAoX84JGv9NYgrHyR6DV8wUSW7hItZLm36ZVoVQxsFJLOMsPOrH/h7dQwR2cdxOTEn8DtUbPGc4V2H7Vb4Yqfedf/GYSGt8VUmxgyfuBAAAAABJRU5ErkJggg=='
  256. const closeBtn = viewer.jsObject.SmallButton(
  257. 'closeBtn',
  258. '关闭',
  259. 'myClose.png'
  260. )
  261. const toolbarTable = viewer.jsObject.controls.toolbar.firstChild.firstChild
  262. const buttonsTable = toolbarTable.rows[0].lastChild.lastChild
  263. const userButtonCell = buttonsTable.rows[0].insertCell(0)
  264. userButtonCell.className = 'stiJsViewerClearAllStyles'
  265. userButtonCell.appendChild(closeBtn)
  266. let that = this
  267. closeBtn.action = function() {
  268. console.log(that.$refs.ReportContainer)
  269. if (that.$refs.reportContainer)
  270. that.$refs.reportContainer.hideContainer()
  271. }
  272. },
  273. batchCheck() {
  274. for (let i = 0; i < this.selectionList.length; i++) {
  275. if (this.selectionList[i].auditStatus != "S") {
  276. return this.$message.error("审核状态必须都为待审核状态!");
  277. } else {
  278. this.idList.push(this.selectionList[i].id);
  279. }
  280. }
  281. //打开cheack
  282. this.checkDialog = true;
  283. },
  284. operationType() {
  285. // this.checkDialog = false;
  286. this.$refs.reportContainer.visible = false
  287. this.refreshChange();
  288. this.idList = [];
  289. },
  290. operationTypeFFSQ() {
  291. this.checkDialog = false;
  292. this.refreshChange();
  293. this.idList = [];
  294. },
  295. // 业务编号跳转详情
  296. billNoDetails(row){
  297. this.$router.push({
  298. path: '/iosBasicData/SeafreightExportF/bills/index',
  299. query: {
  300. id:row.billId
  301. }
  302. });
  303. },
  304. //跳转页面
  305. jumpPage(row) {
  306. console.log('row',row);
  307. console.log(eval("(" + row.pageStatus + ")"))
  308. if (row.url) {
  309. if (eval("(" + row.pageStatus + ")")) {
  310. this.$alert(
  311. "" +
  312. row.pageLabel +
  313. "页面已存在,请关闭" +
  314. row.pageLabel +
  315. "页面再进行操作",
  316. "温馨提示",
  317. {
  318. confirmButtonText: "确定",
  319. type: "warning",
  320. callback: action => { }
  321. }
  322. );
  323. } else {
  324. this.$router.$avueRouter.closeTag(row.url);
  325. this.$router.push({
  326. path: row.url,
  327. query: {
  328. billId:row.billId
  329. }
  330. });
  331. }
  332. }else {
  333. this.$message.warning('当前数据无法跳转')
  334. }
  335. },
  336. //审批通过
  337. pass(row, operate) {
  338. row.operate = operate;
  339. this.loading = true;
  340. approvePass(row)
  341. .then(res => {
  342. this.$message.success("操作成功!");
  343. this.refreshChange();
  344. })
  345. .finally(() => {
  346. this.loading = false;
  347. });
  348. },
  349. openCheck(row) {
  350. if (row.checkType == 'CK') {
  351. financingExcess({ id: row.corpId }).then(res => {
  352. if (res.data.data == '操作成功') {
  353. this.batch = false; //单条操作
  354. this.checkDialog = true;
  355. this.checkData = row;
  356. } else {
  357. this.$confirm(res.data.data, {
  358. confirmButtonText: "确定",
  359. cancelButtonText: "取消",
  360. type: "warning"
  361. }).then(() => {
  362. this.batch = false; //单条操作
  363. this.checkDialog = true;
  364. this.checkData = row;
  365. })
  366. }
  367. })
  368. } else {
  369. this.batch = false; //单条操作
  370. this.checkDialog = true;
  371. this.checkData = row;
  372. }
  373. },
  374. choceCheckFun() {
  375. // this.checkDialog = false;
  376. this.$refs.reportContainer.visible = false
  377. this.refreshChange();
  378. },
  379. choceCheckFFSQ() {
  380. this.checkDialog = false;
  381. this.refreshChange();
  382. },
  383. openCheckSchedule(row) {
  384. this.checkId = row.srcBillId;
  385. this.batchNo = row.batchNo;
  386. this.checkScheduleDialog = true;
  387. },
  388. //关闭审批流程页面
  389. choceScheduleFun() {
  390. this.checkScheduleDialog = false;
  391. },
  392. //新单打开
  393. addReceipt(row) { },
  394. //编辑打开
  395. editOpen(row, status) {
  396. this.detailData = {
  397. id: row.id,
  398. status: status
  399. };
  400. this.show = false;
  401. },
  402. //点击搜索按钮触发
  403. searchChange(params, done) {
  404. this.query = params;
  405. this.page.currentPage = 1;
  406. this.onLoad(this.page, params);
  407. done();
  408. },
  409. searchReset() {
  410. console.log("1");
  411. },
  412. selectionChange(list) {
  413. this.idList = []
  414. this.selectionList = list;
  415. },
  416. currentChange(val) {
  417. this.page.currentPage = val;
  418. },
  419. sizeChange() {
  420. console.log("1");
  421. },
  422. refreshChange(params) {
  423. this.onLoad(this.page, params);
  424. },
  425. paramsAdjustment(params) {
  426. params = Object.assign({}, this.search);
  427. if (!params.auditStatus && params.auditStatus !== "") {
  428. params.auditStatus = "S";
  429. }
  430. return params;
  431. },
  432. onLoad(page, params) {
  433. this.loading = true;
  434. params = this.paramsAdjustment(params);
  435. if (params.sendTime) {
  436. params.applybegintime = params.sendTime[0]
  437. params.applyendtime = params.sendTime[1]
  438. delete params.sendTime
  439. }
  440. getList(page.currentPage, page.pageSize, params).then(res => {
  441. this.dataList = res.data.data.records;
  442. this.page.total = res.data.data.total;
  443. }).finally(() => {
  444. this.loading = false;
  445. });
  446. },
  447. cellStyle() {
  448. return "padding:0;height:40px;";
  449. }
  450. }
  451. };
  452. </script>
  453. <style scoped>
  454. </style>