index.vue 20 KB

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