index.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592
  1. <template>
  2. <div>
  3. <div v-if="IsCompanyUser == 0 || (IsCompanyUser == 1 && suplen > 0)">
  4. <el-breadcrumb class="heading">
  5. <el-breadcrumb-item :to="{ path: '/' }">平台首页</el-breadcrumb-item>
  6. <el-breadcrumb-item :to="{ path: '/oilsupplier/infochange' }">企业信息表</el-breadcrumb-item>
  7. </el-breadcrumb>
  8. <el-card class="box-card" style="height: calc(100vh - 115px);">
  9. <div slot="header">
  10. <span>
  11. <i class="icon icon-table2"></i> 企业信息表
  12. </span>
  13. <el-form ref="form" :inline="true" style="float: right; margin-top: -10px">
  14. <el-form-item label="申请日期">
  15. <el-date-picker size="mini" style="width: 220px" v-model="CreateOn" type="daterange" range-separator="至"
  16. start-placeholder="生成日期" end-placeholder="结束日期"></el-date-picker>
  17. </el-form-item>
  18. <el-form-item label="企业名称">
  19. <el-input size="mini" v-model="searchForm.SupplierName" style="width:100%" placeholder="请输入"></el-input>
  20. </el-form-item>
  21. <!-- <el-form-item label="准入类别">
  22. <el-select size="mini" style="width:100px" v-model="searchForm.SupplierTypeName" placeholder="准入类别">
  23. <el-option label="物资类" value="01"></el-option>
  24. <el-option label="技术服务类" value="03"></el-option>
  25. <el-option label="基建类" value="02"></el-option>
  26. </el-select>
  27. </el-form-item> -->
  28. <el-form-item>
  29. <el-dropdown split-button type="primary" size="mini" @click="handleSearch" @command="searchCommand">
  30. 查询
  31. <el-dropdown-menu slot="dropdown">
  32. <!-- <el-dropdown-item command="search">高级查询</el-dropdown-item> -->
  33. <el-dropdown-item command="clear">查询重置</el-dropdown-item>
  34. </el-dropdown-menu>
  35. </el-dropdown>
  36. </el-form-item>
  37. <el-form-item>
  38. <el-button type="primary" size="mini" @click="addinfochange">
  39. 添加变更
  40. </el-button>
  41. </el-form-item>
  42. </el-form>
  43. </div>
  44. <el-table :data="entityList" size="mini" border height="calc(100vh - 243px)" style="width: 100%"
  45. @sort-change="orderby">
  46. <el-table-column label="操作" min-width="90" align="center" fixed="right">
  47. <template slot-scope="scope">
  48. <router-link
  49. :to="'/oilsupplier/infochangech/' + scope.row.Id + '/operation?InfoStatus='+ scope.row.Status +'&infoId='+scope.row.InfoId">
  50. <el-button type="primary" plain title="信息变更" style="margin-right: 10px" size="mini">变更</el-button>
  51. </router-link>
  52. <el-button type="danger" plain title="信息变更" size="mini" @click="delInfoChangech(scope.row.InfoId)" :disabled="scope.row.Status > 0">删除</el-button>
  53. </template>
  54. </el-table-column>
  55. <el-table-column sortable min-width="110" align="center" prop="Status" label="审核状态">
  56. <template slot-scope="scope">
  57. <span v-if="scope.row.Status=='0'" style="color:#E6A23C">待提交</span>
  58. <span v-if="scope.row.Status=='1'" style="color:#E6A23C">待初审</span>
  59. <span v-if="scope.row.Status=='-1'" style="color:#F56C6C">初审未通过</span>
  60. <span v-if="scope.row.Status=='2'" style="color:#E6A23C">待复审</span>
  61. <span v-if="scope.row.Status=='-2'" style="color:#F56C6C">复审未通过</span>
  62. <span v-if="scope.row.Status=='5'" style="color:#E6A23C">待法规处审核</span>
  63. <span v-if="scope.row.Status=='-5'" style="color:#F56C6C">审核未通过</span>
  64. <span v-if="scope.row.Status=='10'" style="color:#E6A23C">待二级单位分办</span>
  65. <span v-if="scope.row.Status=='-10'" style="color:#F56C6C">分办未通过</span>
  66. <span v-if="scope.row.Status=='11'" style="color:#67C23A">审核通过</span>
  67. </template>
  68. </el-table-column>
  69. <el-table-column v-for="column in tableColumns" :key="column.Id" :prop="column.prop" sortable min-width="100"
  70. :label="column.label" align="center" show-overflow-tooltip>
  71. </el-table-column>
  72. <el-table-column prop="ConmmitTime" sortable min-width="100" label="申请日期" align="center"
  73. show-overflow-tooltip>
  74. <template slot-scope="scope">
  75. {{ jstimehandle(scope.row.ConmmitTime+'') }}
  76. </template>
  77. </el-table-column>
  78. </el-table>
  79. <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
  80. :page-sizes="[10, 15, 20, 25]" :page-size="size" layout="total, sizes, prev, pager, next, jumper"
  81. :total="currentItemCount">
  82. </el-pagination>
  83. </el-card>
  84. <!--
  85. <el-dialog title="高级查询" :visible.sync="dialogVisible" width="720px">
  86. <el-form ref="searchForm" label-width="110px">
  87. <el-row> -->
  88. <!-- <el-col :span="12">
  89. <el-form-item label="生成时间">
  90. <el-date-picker size="mini" v-model="CreateOn" type="daterange" style="width:100%" range-separator="至"
  91. start-placeholder="生成日期" end-placeholder="结束日期"></el-date-picker>
  92. </el-form-item>
  93. </el-col> -->
  94. <!--
  95. <el-col :span="12">
  96. <el-form-item label="">
  97. <el-input size="mini" v-model="searchForm.Id" style="width:100%" placeholder="请输入"></el-input>
  98. </el-form-item>
  99. </el-col> -->
  100. <!--
  101. <el-col :span="12">
  102. <el-form-item label="推荐单位编码">
  103. <el-input size="mini" v-model="searchForm.RecUnitId" style="width:100%" placeholder="请输入"></el-input>
  104. </el-form-item>
  105. </el-col>
  106. <el-col :span="12">
  107. <el-form-item label="准入编码">
  108. <el-input size="mini" v-model="searchForm.AccessCardNo" style="width:100%" placeholder="请输入">
  109. </el-input>
  110. </el-form-item>
  111. </el-col>
  112. <el-col :span="12">
  113. <el-form-item label="准入类别">
  114. <el-input size="mini" v-model="searchForm.SupplierTypeName" style="width:100%" placeholder="请输入">
  115. </el-input>
  116. </el-form-item>
  117. </el-col>
  118. <el-col :span="12">
  119. <el-form-item label="企业名称">
  120. <el-input size="mini" v-model="searchForm.SupplierName" style="width:100%" placeholder="请输入"></el-input>
  121. </el-form-item>
  122. </el-col>
  123. </el-row>
  124. </el-form>
  125. <span slot="footer" class="dialog-footer">
  126. <el-button size="mini" @click="dialogVisible = false">取 消</el-button>
  127. <el-button size="mini" type="primary" @click="handleSearch">查 询</el-button>
  128. </span>
  129. </el-dialog> -->
  130. <el-dialog title="信息变更添加" :visible.sync="addshow" width="360px">
  131. <el-form label-width="90px" :model="entityForm" ref="EntityFormref">
  132. <el-row>
  133. <el-col :span="24">
  134. <el-form-item label="企业名称" prop="SupplierId" required>
  135. <el-select filterable default-first-option ref="supselect" v-model="entityForm.SupplierId" required
  136. placeholder="请选择" style="width: 100%">
  137. <el-option v-for="item in selectsupplierlist" :key="item.Id" :label="item.Realname" :value="item.Id">
  138. </el-option>
  139. </el-select>
  140. </el-form-item>
  141. </el-col>
  142. </el-row>
  143. <el-row>
  144. <el-col :span="24">
  145. <el-form-item label="备注">
  146. <el-input v-model="entityForm.Remark" type="textarea" placeholder="请输入备注内容">
  147. </el-input>
  148. </el-form-item>
  149. </el-col>
  150. </el-row>
  151. </el-form>
  152. <span style="float: right;margin-top:-10px;">
  153. <el-button size="small" @click="addshow = false">取 消</el-button>
  154. <el-button type="primary" size="small" @click="addInfoChange()">确 定</el-button>
  155. </span>
  156. <br>
  157. </el-dialog>
  158. </div>
  159. <page401 v-if="IsCompanyUser == 1 && suplen == 0"></page401>
  160. </div>
  161. </template>
  162. <script>
  163. import {
  164. mapGetters
  165. } from 'vuex';
  166. import supplierapi from '@/api/oilsupplier/supplier';
  167. import api from '@/api/oilsupplier/infochange';
  168. import annapi from '@/api/oilsupplier/annualaudit'
  169. import page401 from '@/components/error/401.vue'
  170. export default {
  171. components: {
  172. page401
  173. },
  174. computed: {
  175. ...mapGetters({
  176. authUser: 'authUser'
  177. })
  178. },
  179. name: 'annualaudit',
  180. data() {
  181. return {
  182. addshow: false,
  183. dialogVisible: false,
  184. delevisble: false,
  185. //列表数据
  186. selectsupplierlist: [],
  187. entityList: [],
  188. //分页参数
  189. size: 10,
  190. currentPage: 1,
  191. currentItemCount: 0,
  192. //列表排序
  193. Column: {
  194. Order: '',
  195. Prop: ''
  196. },
  197. //查询时间
  198. CreateOn: '',
  199. //查询项
  200. searchFormReset: {},
  201. entityForm: {
  202. Id: '',
  203. SupplierId: '',
  204. },
  205. searchForm: {
  206. Id: '',
  207. RecUnitId: '',
  208. AccessCardNo: '',
  209. SupplierTypeName: '',
  210. SupplierName: '',
  211. Num: '',
  212. ProjectName: '',
  213. Performance: '',
  214. WorkRange: '',
  215. Status: '',
  216. BackReason: '',
  217. ApplyTime: '',
  218. AuditDate: '',
  219. EnterUserId: '',
  220. EnterUserName: '',
  221. EnterUserTel: '',
  222. SCR: '',
  223. SCRQ: '',
  224. SCYJ: '',
  225. SCJG: '',
  226. SPR: '',
  227. SPRQ: '',
  228. SPYJ: '',
  229. SPJG: '',
  230. CreateOn: '',
  231. CreateUserId: '',
  232. CreateBy: '',
  233. ModifiedOn: '',
  234. ModifiedUserId: '',
  235. ModifiedBy: '',
  236. },
  237. tableColumns: [
  238. // {
  239. // prop: "RecUnitId",
  240. // label: '推荐单位编码',
  241. // width: 100,
  242. // sort: true
  243. // },
  244. {
  245. prop: "SupplierName",
  246. label: '企业名称',
  247. width: 100,
  248. sort: true
  249. },
  250. {
  251. prop: "PACNumber",
  252. label: '中石油准入证编号',
  253. width: 200,
  254. sort: true
  255. },
  256. // {
  257. // prop: "Grade",
  258. // label: '级别',
  259. // width: 100,
  260. // sort: true
  261. // },
  262. // {
  263. // prop: "MgrUnit",
  264. // label: '管理单位',
  265. // width: 100,
  266. // sort: true
  267. // },
  268. // {
  269. // prop: "OperType",
  270. // label: '经营方式',
  271. // width: 100,
  272. // sort: true
  273. // },
  274. // {
  275. // prop: "Country",
  276. // label: '国家',
  277. // width: 100,
  278. // sort: true
  279. // },
  280. // {
  281. // prop: "MaunAgent",
  282. // label: '所代理制造商名称',
  283. // width: 200,
  284. // sort: true
  285. // },
  286. // {
  287. // prop: "ConstructTeam",
  288. // label: '施工队伍名称',
  289. // width: 100,
  290. // sort: true
  291. // },
  292. {
  293. prop: "CommercialNo",
  294. label: '工商注册号',
  295. width: 100,
  296. sort: true
  297. },
  298. ],
  299. IsCompanyUser: 0,
  300. supplierList: [],
  301. suplen: 1,
  302. }
  303. },
  304. created() {
  305. this.IsCompanyUser = this.authUser.Profile.IsCompanyUser
  306. //查询条件初始值备份
  307. Object.assign(this.searchFormReset, this.searchForm)
  308. //查询列表
  309. this.initDatas()
  310. this.getselectsupplier()
  311. //this.getDictOptions()
  312. this.getSupplierList()
  313. },
  314. methods: {
  315. initDatas() {
  316. //分页及列表条件
  317. let params = {
  318. _currentPage: this.currentPage,
  319. _size: this.size,
  320. Order: this.Column.Order,
  321. Prop: this.Column.Prop,
  322. }
  323. let myCreateOn = []
  324. // 解析时间
  325. if (this.CreateOn && this.CreateOn.length == 2) {
  326. this.CreateOn[1].setHours(23)
  327. this.CreateOn[1].setMinutes(59)
  328. this.CreateOn[1].setSeconds(59)
  329. myCreateOn.push(this.formatDateTime(this.CreateOn[0]))
  330. myCreateOn.push(this.formatDateTime(this.CreateOn[1]))
  331. }
  332. //查询条件
  333. Object.assign(params, this.searchForm)
  334. //访问接口
  335. api.getSuppList(myCreateOn.join(','), params, this.$axios).then(res => {
  336. this.entityList = res.data.items
  337. this.currentItemCount = res.data.currentItemCount
  338. }).catch(err => {
  339. console.error(err)
  340. })
  341. },
  342. getSupplierList() {
  343. let _this = this
  344. _this.supplierList = []
  345. let params = {
  346. SuppTypeCode: '',
  347. }
  348. _this.$axios.get('/annualaudit/getsupplierforchange', {
  349. params
  350. })
  351. .then(res => {
  352. _this.supplierList = res.data
  353. if (_this.supplierList) {
  354. _this.suplen = _this.supplierList.length
  355. } else {
  356. _this.suplen = 0
  357. }
  358. if (_this.IsCompanyUser == 1 && _this.supplierList) {
  359. _this.entityForm.SupplierId = _this.supplierList[0].SupplierId
  360. }
  361. })
  362. .catch(err => {
  363. console.error(err)
  364. })
  365. },
  366. getselectsupplier () {
  367. api.getAddSupList(this.$axios).then(res => {
  368. if (res.data.items != null && res.data.items.length != 0) {
  369. for (var i = 0; i < res.data.items.length; i++) {
  370. this.selectsupplierlist.push({
  371. Id: res.data.items[i].Id,
  372. Realname: res.data.items[i].SupplierName
  373. })
  374. }
  375. }
  376. }).catch(err => {
  377. console.error(err)
  378. })
  379. },
  380. addinfochange() {
  381. if (this.IsCompanyUser === 1) {
  382. this.addInfoChangeCom()
  383. } else {
  384. this.addshow = true
  385. }
  386. },
  387. addInfoChangeCom() {
  388. this.$confirm("确定添加变更申请, 是否继续?", "提示", {
  389. confirmButtonText: "确定",
  390. cancelButtonText: "取消",
  391. type: "warning"
  392. })
  393. .then(() => {
  394. api.addInfoChMain(this.entityForm, this.$axios).then(res => {
  395. if (res.data.code === 0) {
  396. //保存成功后,初始化数据,变成修改
  397. this.entityForm.Id = res.data.item;
  398. this.$router.push({
  399. path: '/oilsupplier/infochangech/' + this.entityForm.SupplierId + '/operation',
  400. query: {
  401. InfoStatus: 0,
  402. infoId: this.entityForm.Id,
  403. }
  404. })
  405. this.$message({
  406. type: 'success',
  407. message: res.data.message
  408. });
  409. } else {
  410. this.$message({
  411. type: 'warning',
  412. message: res.data.message
  413. });
  414. }
  415. }).catch(err => {
  416. console.error(err)
  417. });
  418. })
  419. .catch(() => {});
  420. },
  421. addInfoChange() {
  422. this.$refs['EntityFormref'].validate((valid) => {
  423. if (valid) {
  424. this.entityForm.SupplierId = this.entityForm.SupplierId + ""
  425. api.addInfoChMain(this.entityForm, this.$axios).then(res => {
  426. if (res.data.code === 0) {
  427. //保存成功后,初始化数据,变成修改
  428. this.entityForm.Id = res.data.item;
  429. this.initDatas();
  430. this.addshow = false
  431. this.$message({
  432. type: 'success',
  433. message: res.data.message
  434. });
  435. } else {
  436. this.$message({
  437. type: 'warning',
  438. message: res.data.message
  439. });
  440. }
  441. }).catch(err => {
  442. console.error(err)
  443. });
  444. }
  445. })
  446. },
  447. delInfoChangech (Id) {
  448. this.$confirm('该操作将彻底删除的数据,是否继续?', '提示', {
  449. confirmButtonText: '确定',
  450. cancelButtonText: '取消',
  451. type: 'warning'
  452. }).then(() => {
  453. api.delInfoChangech(Id, this.$axios).then(res => {
  454. if (res.data.code === 0) {
  455. this.initDatas()
  456. this.$message({
  457. type: 'success',
  458. message: res.data.message
  459. })
  460. } else {
  461. this.$message({
  462. type: 'warning',
  463. message: res.data.message
  464. })
  465. }
  466. })
  467. })
  468. },
  469. getDictOptions() {
  470. api.getDictList(this.$axios).then(res => {
  471. //this.dictOptions.customerList = res.data.items['customerList']
  472. //this.dictOptions.projectList = res.data.items['projectList']
  473. }).catch(err => {
  474. console.error(err)
  475. })
  476. },
  477. searchCommand(command) {
  478. if (command == 'search') {
  479. this.dialogVisible = true
  480. } else if (command == 'clear') {
  481. this.clearSearch()
  482. }
  483. },
  484. //列表排序功能
  485. orderby(column) {
  486. if (column.order == 'ascending') {
  487. this.Column.Order = 'asc'
  488. } else if (column.order == 'descending') {
  489. this.Column.Order = 'desc'
  490. }
  491. this.Column.Prop = column.prop
  492. this.initDatas()
  493. },
  494. clearSearch() {
  495. Object.assign(this.searchForm, this.searchFormReset);
  496. //this.searchForm = this.searchFormReset;
  497. this.CreateOn = ''
  498. this.initDatas()
  499. },
  500. handleSearch() {
  501. this.currentPage = 1;
  502. this.dialogVisible = false;
  503. this.initDatas();
  504. },
  505. handleCurrentChange(value) {
  506. this.currentPage = value
  507. this.initDatas()
  508. },
  509. handleSizeChange(value) {
  510. this.size = value
  511. this.currentPage = 1
  512. this.initDatas()
  513. },
  514. deleteEntity(row) {
  515. api.deleteEntity(row.Id, this.$axios).then(res => {
  516. if (res.data.code === 0) {
  517. this.initDatas();
  518. this.$message({
  519. type: 'success',
  520. message: res.data.message
  521. });
  522. } else {
  523. this.$message({
  524. type: 'warning',
  525. message: res.data.message
  526. });
  527. }
  528. }).catch(err => {
  529. console.error(err)
  530. });
  531. },
  532. jstimehandle(val) {
  533. if (val === '') {
  534. return '----'
  535. } else if (val === '0001-01-01T00:00:00Z') {
  536. return '----'
  537. } else if (val === '0001-01-01T08:00:00+08:00') {
  538. return '----'
  539. } else if (val === '5000-01-01T23:59:59+08:00') {
  540. return '永久'
  541. } else {
  542. val = val.replace('T', ' ')
  543. return val.substring(0, 10)
  544. }
  545. },
  546. formatDateTime(date) {
  547. var y = date.getFullYear();
  548. var m = date.getMonth() + 1;
  549. m = m < 10 ? ('0' + m) : m;
  550. var d = date.getDate();
  551. d = d < 10 ? ('0' + d) : d;
  552. var h = date.getHours();
  553. var minute = date.getMinutes();
  554. minute = minute < 10 ? ('0' + minute) : minute;
  555. return y + '-' + m + '-' + d + ' ' + h + ':' + minute;
  556. }
  557. }
  558. }
  559. </script>
  560. <style lang="scss">
  561. </style>