2
3

tmpsuppliercheck.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525
  1. <template>
  2. <div>
  3. <el-card class="box-card" shadow="never" style="height: calc(100vh - 115px);position:relative">
  4. <div slot="header">
  5. <span>
  6. <i class="icon icon-table2"></i> 对比列表
  7. </span>
  8. <el-form :model="searchForm" ref="searchformRef" :inline="true" style="float: right;position:absolute;right:15px;top:10.5px" >
  9. <el-form-item label="准入编码">
  10. <el-input size="mini" v-model="searchForm.AccessCardNo" placeholder="请输入内容"></el-input>
  11. </el-form-item>
  12. <el-form-item label="企业名称">
  13. <el-input size="mini" v-model="searchForm.SupplierName" placeholder="请输入内容"></el-input>
  14. </el-form-item>
  15. <el-form-item>
  16. <el-dropdown split-button type="primary" size="mini" @click="initDatas($event)" @command="searchCommand">
  17. 查询
  18. <el-dropdown-menu slot="dropdown">
  19. <el-dropdown-item command="search">高级查询</el-dropdown-item>
  20. <el-dropdown-item command="clear">查询重置</el-dropdown-item>
  21. </el-dropdown-menu>
  22. </el-dropdown>
  23. </el-form-item>
  24. <el-form-item>
  25. <el-button type="warning" size="mini" @click="exportExcel">导出</el-button>
  26. </el-form-item>
  27. </el-form>
  28. </div>
  29. <!--内框表格显示-->
  30. <el-table id="rebateSetTable1" highlight-current-row :data="conList" size="mini" v-loading="loading" border height="calc(100vh - 243px)"
  31. style="width: 100%" @sort-change="orderby" :row-class-name="tableRowClassName">
  32. <el-table-column label="操作" width="260px" align="center" fixed="right" show-overflow-tooltip>
  33. <template slot-scope="scope">
  34. <el-button type="text" @click="opencertsub(scope.row)" title="查看准入范围" size="mini" icon="el-icon-document" width="120px">准入范围</el-button>
  35. </template>
  36. </el-table-column>
  37. <!--内框表格剩余栏显示-->
  38. <el-table-column label="状态" prop="InFlag" width="100px" align="center">
  39. <template slot-scope="scope">
  40. <el-alert v-if="scope.row.InFlag=='1'" :closable="false" style="background:rgba(255,255,255,0.2)" title="准入" type="success" ></el-alert>
  41. <el-alert v-if="scope.row.InFlag=='2'" :closable="false" style="background:rgba(255,255,255,0.2)" title="暂停" type="warning" ></el-alert>
  42. <el-alert v-if="scope.row.InFlag=='3'" :closable="false" style="background:rgba(255,255,255,0.2)" title="取消" type="error"></el-alert>
  43. </template>
  44. </el-table-column>
  45. <el-table-column label="准入编码" width="100px" prop="AccessCardNo" sortable align="center">
  46. <template slot-scope="scope" >
  47. <span style="font-family:'黑体';font-size:13px">{{scope.row.AccessCardNo}}</span>
  48. </template>
  49. </el-table-column>
  50. <el-table-column label="企业名称" min-width="300px" prop="SupplierName" sortable align="center"></el-table-column>
  51. <el-table-column label="准入类别" prop="SupplierTypeCode" align="center">
  52. <template slot-scope="scope">
  53. {{transferStr(scope.row.SupplierTypeCode)}}
  54. </template>
  55. </el-table-column>
  56. <el-table-column label="法人代表" width="100px" prop="LegalPerson" align="center"></el-table-column>
  57. <el-table-column label="注册资金(万元)" width="170px" prop="RegCapital" sortable align="center"></el-table-column>
  58. <el-table-column label="移动电话" width="120px" prop="Mobile" align="center"></el-table-column>
  59. <el-table-column label="是否缺资质" width="130px" prop="Checked" sortable align="center">
  60. <template slot-scope="scope" >
  61. <span style="font-family:'黑体';font-size:13px">{{stringChecked(scope.row.Checked)}}</span>
  62. </template>
  63. </el-table-column>
  64. <!--<el-table-column label="最后一次年审" width="100px" prop="AuditDate" align="center">-->
  65. <!--<template slot-scope="scope">{{ jstimehandle(scope.row.AuditDate) }}</template>-->
  66. <!--</el-table-column>-->
  67. </el-table>
  68. <!-- 分页 -->
  69. <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[10, 15, 20, 25]" :page-size="size"
  70. layout="total, sizes, prev, pager, next, jumper" :total="currentItemCount"></el-pagination>
  71. </el-card>
  72. <el-dialog :visible.sync="dialogVisibleCertsSub" width="90%" append-to-body>
  73. <el-card class="box-card">
  74. <div slot="header" class="clearfix">
  75. <span style="font-weight: bold">准入范围</span>
  76. <span style="float: right;">
  77. <el-form ref="form" :inline="true" style="margin-top: -10px">
  78. <el-form-item label="编码">
  79. <el-input size="mini" v-model="searchFormSub.Code" placeholder="请输入内容" style="width: 100%"></el-input>
  80. </el-form-item>
  81. <el-form-item label="名称">
  82. <el-input size="mini" v-model="searchFormSub.Name" placeholder="请输入内容" style="width: 100%"></el-input>
  83. </el-form-item>
  84. <el-form-item>
  85. <el-button type="primary" size="mini" style="margin-left: 8px" @click="search">查询</el-button>
  86. <!-- <el-button type="primary" @click="toPdf" size="mini" style="margin-left: 25px">下载待删除准入范围</el-button>-->
  87. </el-form-item>
  88. </el-form>
  89. </span>
  90. </div>
  91. <el-table :data="certsubList" border size="mini" :row-class-name="subRowClassName" v-loading="certsubListLoading">
  92. <!-- <el-table-column label="操作" width="160px" align="center" fixed="right" show-overflow-tooltip>-->
  93. <!-- <template slot-scope="scope">-->
  94. <!-- <el-button type="text" style="color: #F56C6C" @click="delcertsubbyid(scope.row)" title="删除" size="mini" icon="el-icon-delete" width="90px">删除</el-button>-->
  95. <!-- </template>-->
  96. <!-- </el-table-column>-->
  97. <el-table-column prop="Code" label="分类编码" show-overflow-tooltip></el-table-column>
  98. <el-table-column prop="Name" label="分类名称" show-overflow-tooltip></el-table-column>
  99. <el-table-column prop="HeaderName" label="缺少资质" show-overflow-tooltip></el-table-column>
  100. <el-table-column prop="GoodsLevel" label="级别" width="80px" show-overflow-tooltip>
  101. <template slot-scope="scope">
  102. <span v-if="scope.row.GoodsLevel=='1'">一级</span>
  103. <span v-if="scope.row.GoodsLevel=='2'">二级</span>
  104. </template>
  105. </el-table-column>
  106. <el-table-column
  107. label="是否为制造商" width="100" v-if="SupplierTypeCode == '01'">
  108. <template slot-scope="scope">
  109. <el-tag type="info" v-if="scope.row.IsManufacturer == 2">非制造商</el-tag>
  110. <el-tag type="success" v-else-if="scope.row.IsManufacturer == 1">制造商</el-tag>
  111. <span v-else>——</span>
  112. </template>
  113. </el-table-column>
  114. <el-table-column label="状态"
  115. align="center"
  116. width="100px">
  117. <template slot-scope="scope">
  118. <span v-if="scope.row.CertSubStatus=='1'"
  119. style="color:#67C23A">准入</span>
  120. <span v-else-if="scope.row.CertSubStatus=='2'"
  121. style="color:#E6A23C">暂停</span>
  122. <span v-else>——</span>
  123. </template>
  124. </el-table-column>
  125. </el-table>
  126. <el-pagination
  127. @size-change="handleSizeChangeSub"
  128. @current-change="handleCurrentChangeSub"
  129. :current-page="currentPageSub"
  130. :page-sizes="[10, 50, 100, 200, 400]"
  131. :page-size="sizeSub"
  132. layout="total, sizes, prev, pager, next, jumper"
  133. :total="currentItemCountSub"
  134. ></el-pagination>
  135. </el-card>
  136. </el-dialog>
  137. </div>
  138. </template>
  139. <script>
  140. import api from '@/api/oilsupplier/goodsaptitude'
  141. import XLSX from "xlsx";
  142. export default {
  143. name: 'compareTmpSupplier',
  144. created () {
  145. // Object.assign(this.searchFormReset, this.searchForm)
  146. this.initDatas()
  147. },
  148. data () {
  149. return {
  150. // 分页参数
  151. size: 10,
  152. currentPage: 1,
  153. currentItemCount: 0,
  154. // 列表排序
  155. Column: {
  156. Order: '',
  157. Prop: ''
  158. },
  159. conList: [],
  160. loading: false,
  161. dialogVisibleCertsSub: false,
  162. certsubListLoading: false,
  163. searchForm: {
  164. AccessCardNo: '',
  165. SupplierName: '',
  166. SupplierTypeCode: '',
  167. InFlag: '',
  168. LegalPerson: '',
  169. ContactName: '',
  170. CommercialNo: '',
  171. RegCapital1: '',
  172. RegCapital2: '',
  173. CompanyType: '',
  174. Province: '',
  175. City: '',
  176. Street: '',
  177. Address: '',
  178. LinkProvince: '',
  179. LinkCity: '',
  180. LinkStreet: '',
  181. LinkAddress: '',
  182. DepositBank: '',
  183. BusinessScope: '',
  184. OldSupplierName: '',
  185. HseTraining: '',
  186. // NeedFileType: [],
  187. NeedFileType: '',
  188. CerSubName: '',
  189. FullName: '',
  190. CheckUserName: '',
  191. CheckUserId: ''
  192. },
  193. SupplierId: '',
  194. Id: '',
  195. SupplierCertId: '',
  196. SupplierTypeCode: '',
  197. SupplierName: '',
  198. searchFormSub: {
  199. Code: '',
  200. Name: ''
  201. },
  202. // 分页参数
  203. sizeSub: 10,
  204. currentPageSub: 1,
  205. currentItemCountSub: 0,
  206. certsubList: [],
  207. showcolumn: [],
  208. tableColumns: [
  209. {
  210. prop: 'InFlag',
  211. label: '状态',
  212. width: 120,
  213. sort: true
  214. },
  215. {
  216. prop: 'AccessCardNo',
  217. label: '准入编码',
  218. width: 150,
  219. sort: true
  220. },
  221. {
  222. prop: 'SupplierName',
  223. label: '企业名称',
  224. width: 120,
  225. sort: true
  226. },
  227. {
  228. prop: 'SupplierTypeCode',
  229. label: '准入类别',
  230. width: 150,
  231. sort: true
  232. },
  233. {
  234. prop: 'LegalPerson',
  235. label: '法人代表',
  236. width: 120,
  237. sort: true
  238. },
  239. {
  240. prop: 'RegCapital',
  241. label: '注册资金',
  242. width: 150,
  243. sort: true
  244. },
  245. {
  246. prop: 'Mobile',
  247. label: '移动电话',
  248. width: 120,
  249. sort: true
  250. }
  251. ],
  252. dynamicTableColumns: [],
  253. }
  254. },
  255. methods: {
  256. tableRowClassName({row, rowIndex}) {
  257. // console.log(row, 'row')
  258. console.log(row.Checked, 'row')
  259. if (row.Checked === "1") {
  260. return 'blue-row'
  261. } else{
  262. return 'yellow-row'
  263. }
  264. },
  265. subRowClassName({row, rowIndex}) {
  266. // console.log(row, 'row')
  267. console.log(row.Checked, 'row')
  268. if (row.Checked === 1) {
  269. return 'yellow-row'
  270. } else{
  271. return 'blue-row'
  272. }
  273. },
  274. searchCommand (command) {
  275. if (command === 'search') {
  276. this.dialogVisible = true
  277. } else if (command === 'clear') {
  278. this.clearSearch()
  279. }
  280. },
  281. // 列表排序功能
  282. orderby (column) {
  283. if (column.order === 'ascending') {
  284. this.Column.Order = 'asc'
  285. } else if (column.order === 'descending') {
  286. this.Column.Order = 'desc'
  287. }
  288. this.Column.Prop = column.prop
  289. this.initDatas()
  290. },
  291. clearSearch () {
  292. Object.assign(this.searchForm, this.searchFormReset)
  293. // this.searchForm = this.searchFormReset;
  294. this.CreateOn = ''
  295. this.initDatas()
  296. },
  297. handleSearch () {
  298. this.currentPage = 1
  299. this.dialogVisible = false
  300. this.initDatas()
  301. },
  302. handleCurrentChange (value) {
  303. this.currentPage = value
  304. this.initDatas()
  305. },
  306. handleSizeChange (value) {
  307. this.size = value
  308. this.currentPage = 1
  309. this.initDatas()
  310. },
  311. transferStr (val) {
  312. if (val === '01') {
  313. return '物资类'
  314. } else if (val === '02') {
  315. return '基建类'
  316. } else if (val === '03') {
  317. return '服务类'
  318. } else {
  319. return val
  320. }
  321. },
  322. stringChecked(val) {
  323. if (val === '1') {
  324. return '否'
  325. } else {
  326. return '是'
  327. }
  328. },
  329. initDatas () {
  330. this.loading = true
  331. // 分页及列表条件
  332. let params = {
  333. _currentPage: this.currentPage,
  334. _size: this.size,
  335. Order: this.Column.Order,
  336. Prop: this.Column.Prop,
  337. Edition: '1'
  338. }
  339. let myCreateOn = []
  340. // 解析时间
  341. if (this.CreateOn != null && this.CreateOn.length === 2) {
  342. this.CreateOn[1].setHours(23)
  343. this.CreateOn[1].setMinutes(59)
  344. this.CreateOn[1].setSeconds(59)
  345. myCreateOn.push(this.formatDateTime(this.CreateOn[0]))
  346. myCreateOn.push(this.formatDateTime(this.CreateOn[1]))
  347. }
  348. // 查询条件
  349. Object.assign(params, this.searchForm)
  350. // 访问接口
  351. api.getCompareTmpSupplier(params, this.$axios).then(res => {
  352. this.conList = res.data.items
  353. this.currentItemCount = res.data.currentItemCount
  354. this.loading = false
  355. }).catch(err => {
  356. console.error(err)
  357. })
  358. },
  359. opencertsub (row) {
  360. this.currentPageSub = 1
  361. this.certsubList = []
  362. this.dialogVisibleCertsSub = true
  363. this.certsubListLoading = true
  364. this.Id = row.Id
  365. this.SupplierCertId = row.CertId
  366. this.SupplierTypeCode = row.SupplierTypeCode
  367. this.SupplierName = row.SupplierName
  368. this.getCertSub(row)
  369. },
  370. getCertSub (row) {
  371. let _this = this
  372. const params = {
  373. SupplierCertId: this.SupplierCertId,
  374. SupplierTypeCode: this.SupplierTypeCode,
  375. _currentPage: this.currentPageSub,
  376. _size: this.sizeSub
  377. }
  378. Object.assign(params, this.searchFormSub)
  379. this.$axios.get('goodsaptitude/delcertsublist', {
  380. params
  381. })
  382. .then(res => {
  383. _this.certsubList = res.data.items
  384. _this.currentItemCountSub = res.data.currentItemCount
  385. this.certsubListLoading = false
  386. })
  387. .catch(err => {
  388. console.error(err)
  389. })
  390. },
  391. // 分页方法
  392. handleCurrentChangeSub (value) {
  393. this.currentPageSub = value
  394. this.getCertSub()
  395. },
  396. handleSizeChangeSub (value) {
  397. this.sizeSub = value
  398. this.currentPageSub = 1
  399. this.getCertSub()
  400. },
  401. // 导出准入范围到pdf
  402. toPdf () {
  403. api.pdfexport(this.Id, this.SupplierTypeCode, this.$axios)
  404. .then(res => {
  405. // response
  406. if (res.data.code === 0) {
  407. // this.$message({
  408. // type: 'success'
  409. // message: res.data.message
  410. // })
  411. let docurl = res.data.item
  412. let pdfurl
  413. // 内网服务器专用
  414. if (process.client && docurl.indexOf('upfile') === 0) {
  415. const myDomain = window.location.host
  416. // location.href = 'http://' + myDomain + '/' + docurl
  417. pdfurl = 'http://' + process.env.LOCAL_IP + '/' + docurl
  418. let requestParams = {
  419. pdfUrl: pdfurl,
  420. watermark: this.SupplierName
  421. }
  422. this.$axios.post('supplierdataentry/word-to-pdf-watermark', requestParams)
  423. .then(function (res) {
  424. window.open('http://' + myDomain + '/' + res.data)
  425. })
  426. } else {
  427. // location.href = 'http://' + docurl
  428. pdfurl = 'http://' + docurl
  429. let requestParams = {
  430. pdfUrl: pdfurl,
  431. watermark: this.SupplierName
  432. }
  433. this.$axios.post('supplierdataentry/word-to-pdf-watermark', requestParams)
  434. .then(function (res) {
  435. window.open('http://' + res.data)
  436. })
  437. }
  438. }
  439. }).catch(err => {
  440. console.error(err)
  441. })
  442. },
  443. search () {
  444. this.getCertSub()
  445. },
  446. delcertsubbyid (row) {
  447. console.log(row)
  448. this.$confirm('是否删除准入项?', '提示', {
  449. confirmButtonText: '确定',
  450. cancelButtonText: '取消',
  451. type: 'warning'
  452. }).then(() => {
  453. let params = {
  454. Id: row.Id
  455. }
  456. console.log(params)
  457. api.delTmpSupplierCertSub(params, this.$axios).then(res => {
  458. console.log(res)
  459. if (res.data.code === 0) {
  460. this.$message({
  461. type: 'success',
  462. message: res.data.message
  463. })
  464. this.getCertSub()
  465. } else {
  466. this.$message({
  467. type: 'warning',
  468. message: res.data.message
  469. })
  470. }
  471. })
  472. })
  473. },
  474. exportExcel () {
  475. console.log('111111导出')
  476. this.loading = true
  477. api.execlexport(this.$axios)
  478. .then(res => {
  479. // response
  480. if (res.data.code === 0) {
  481. // this.$message({
  482. // type: 'success'
  483. // message: res.data.message
  484. // })
  485. let docurl = res.data.item
  486. // 内网服务器专用
  487. if (process.client && docurl.indexOf('upfile') === 0) {
  488. const myDomain = window.location.host
  489. location.href = 'http://' + myDomain + '/' + docurl
  490. } else {
  491. location.href = 'http://' + docurl
  492. }
  493. }
  494. }).catch(err => {
  495. console.error(err)
  496. })
  497. this.loading = false
  498. },
  499. }
  500. }
  501. </script>
  502. <style>
  503. .el-table .blue-row {
  504. background: lightblue;
  505. }
  506. .el-table .yellow-row {
  507. background: lightyellow;
  508. }
  509. </style>