index.vue 19 KB

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