list.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. <template>
  2. <div>
  3. <FullPage title='审批列表'
  4. :list='list'
  5. @init='init'
  6. :loading='loading'
  7. @searchData='init'
  8. @changePage='changePage'
  9. @changeSize='changeSize'
  10. @selectTable='selectTable'
  11. :tableColums='tableColums'
  12. :tableData='tableData'
  13. :pageIndex='pageIndex'
  14. :total='total'>
  15. <div slot='titleButton'>
  16. <Button type="error"
  17. @click="approved(0)"
  18. style="margin-right:10px;"
  19. ghost>批量驳回审批</Button>
  20. <Button type="success"
  21. @click="approved(1)"
  22. style="margin-right:10px;"
  23. ghost>批量通过审批</Button>
  24. </div>
  25. <template slot='set'
  26. slot-scope='{row}'>
  27. <div>
  28. <a v-if='persimissionData["订单详情"]||persimissionData.all'
  29. @click="goPage(row)"
  30. style="margin:0 5px">详情</a>
  31. <!-- <a v-if='persimissionData["审批详情"]||persimissionData.all'
  32. @click="goDetails(row)"
  33. style="margin:0 5px">审批详情</a> -->
  34. <a @click="singleApproved(2,row)"
  35. style="margin:0 5px;color:red"
  36. v-if="row.state == 0">驳回</a>
  37. <a @click="singleApproved(1,row)"
  38. style="margin:0 5px;color:green"
  39. v-if="row.state == 0 ">通过</a>
  40. </div>
  41. </template>
  42. </FullPage>
  43. </div>
  44. </template>
  45. <script>
  46. import { mapState } from 'vuex'
  47. export default {
  48. data () {
  49. return {
  50. list: [
  51. { title: '订单号', name: 'Input', value: '', serverName: 'oa_order_no', placeholder: '请输入订单号' },
  52. { title: '项目名称', name: 'Input', serverName: 'residential_name', value: '', placeholder: '请输入项目名称' },
  53. { title: '提交人', name: 'Input', serverName: 'nickname', value: '', placeholder: '请选择提交人' },
  54. {
  55. title: '审批状态', name: 'Select', placeholder: '请选择', value: 0, serverName: 'state',
  56. option: [
  57. { label: '审核中', value: 0 },
  58. { label: '通过', value: 1 },
  59. { label: '驳回', value: 2 },
  60. // { label: '取消', value: 3 },
  61. ]
  62. },
  63. {
  64. title: '审批类型', name: 'Select', serverName: 'type', placeholder: '请选择', value: '',
  65. option: [
  66. { label: '请购', value: 1 },
  67. { label: '采购', value: 2 },
  68. { label: '到货', value: 3 },
  69. { label: '质检', value: 4 }
  70. ]
  71. },
  72. { title: '提交时间', start_server: 'start_time', end_server: 'end_time', name: 'Input', start_value: '', end_value: '', isDate: true, start_placeholder: '开始日期', end_placeholder: '结束日期', },
  73. ],
  74. tableColums: [
  75. { type: 'selection', align: 'center', fixed: 'left', minWidth: 100, },
  76. { title: '订单号', align: 'center', key: 'oa_order_no', width: '180' },
  77. { title: '项目名称', align: 'center', key: 'residential_name', minWidth: 100 },
  78. // { title: '订单流水号', align: 'center', key: 'oa_order_no', minWidth: 200 },
  79. // {title:'订单类型',align:'center',key:'show_order_type',minWidth:100,
  80. // render:(h,params)=>h('span',{},params.row.order_type == 1 ? '工装' : '家装')
  81. // },
  82. // { title: '客户', align: 'center', key: 'client_name', minWidth: 100 },
  83. // { title: '手机号', align: 'center', key: 'mobile', minWidth: 150 },
  84. {
  85. title: '审批类型', align: 'center', minWidth: 100,
  86. render (h, params) {
  87. return h('span', {}, params.row.type == 1 ? '请购' : params.row.type == 2 ? '采购': params.row.type == 3 ? '到货': '质检')
  88. }
  89. },
  90. { title: '提交人', align: 'center', key: 'nickname', minWidth: 100 },
  91. {
  92. title: '审批状态', align: 'center', key: 'show_state', minWidth: 100,
  93. render (h, params) {
  94. return h('span', {
  95. props: {},
  96. style: {
  97. color: params.row.state == 0 ? '#FFA141' : (params.row.state == 1 ? '#32C800' : '#FF5E5C')
  98. }
  99. }, params.row.state == 0 ? '审核中' : (params.row.state == 1 ? '通过' : (params.row.state == 2 ? '驳回' : '取消')))
  100. }
  101. },
  102. {
  103. title: '提交日期', align: 'center', key: 'show_crt_time', minWidth: 200,
  104. render: (h, params) => h('span', {}, this.func.replaceDate(params.row.crt_time * 1))
  105. },
  106. // { title: '创建人员', align: 'center', key: 'nickname', minWidth: 100 },
  107. // {
  108. // title: '审批开始时间', align: 'center', key: 'show_crt_time', minWidth: 200,
  109. // render: (h, params) => h('span', {}, this.func.replaceDate(params.row.crt_time * 1))
  110. // },
  111. // {
  112. // title: '审批结束时间', align: 'center', key: 'show_upd_time', minWidth: 200,
  113. // render: (h, params) => h('span', {}, params.row.upd_time ? this.func.replaceDate(params.row.upd_time * 1) : '')
  114. // },
  115. // { title: '备注', align: 'center', key: 'remark', minWidth: 200 },
  116. { title: '操作', align: 'center', slot: 'set', fixed: 'right', width: '220' },
  117. ],
  118. tableData: [],
  119. pageIndex: 1,
  120. total: 0,
  121. pageSize: 10,
  122. loading: false,
  123. proxyObj: {},
  124. selectIds: [],
  125. currency_type: null,
  126. }
  127. },
  128. created () {
  129. this.currency_type = this.$route.query.id;
  130. },
  131. computed: {
  132. ...mapState(['persimissionData'])
  133. },
  134. watch: {
  135. $route (to) {
  136. this.id = to.query.id;
  137. this.proxyObj.id = this.id
  138. this.getData(this.proxyObj)
  139. this.currency_type = to.query.id
  140. }
  141. },
  142. methods: {
  143. init (row) {
  144. this.pageIndex = 1
  145. row.page_index = this.pageIndex;
  146. row.page_size = this.pageSize
  147. this.proxyObj = row;
  148. this.getData(row)
  149. },
  150. getData (row) {
  151. this.loading = true;
  152. this.axios('/api/order_oa_list', { params: row }).then(res => {
  153. this.loading = false;
  154. this.tableData = res.data.data;
  155. this.total = res.data.total;
  156. console.log(res);
  157. })
  158. },
  159. changePage (e) {
  160. this.pageIndex = e;
  161. this.proxyObj.page_index = this.pageIndex;
  162. this.getData(this.proxyObj);
  163. },
  164. goPage (row) {
  165. row.type == 1 ? this.$router.push({
  166. // /cms/ordermannage/businessorderlist/details
  167. // path:'/cms/ordermannage/businessorderlist/decorationlist',
  168. path: '/cms/BidSystem/ContractList/requisitionDetail',
  169. query: {
  170. oa_order_no: row.oa_order_no,
  171. order_no: row.order_no,
  172. type: row.type,
  173. state: row.state,
  174. }
  175. }) :row.type == 2 ? this.$router.push({
  176. path: '/cms/BidSystem/ContractList/purchaseDetail',
  177. query: {
  178. oa_order_no: row.oa_order_no,
  179. order_no: row.order_no,
  180. type: row.type,
  181. state: row.state,
  182. }
  183. }) : row.type == 3 ? this.$router.push({
  184. path: '/cms/BidSystem/ContractList/arrivalDetail',
  185. query: {
  186. oa_order_no: row.oa_order_no,
  187. order_no: row.order_no,
  188. type: row.type,
  189. state: row.state,
  190. }
  191. }) : this.$router.push({
  192. path: '/cms/BidSystem/ContractList/qualitytestingDetail',
  193. query: {
  194. oa_order_no: row.oa_order_no,
  195. order_no: row.order_no,
  196. type: row.type,
  197. state: row.state,
  198. }
  199. })
  200. },
  201. goDetails (row) {
  202. this.$router.push({
  203. path: '/cms/approval/examine',
  204. query: {
  205. oa_order_no: row.oa_order_no
  206. }
  207. })
  208. },
  209. changeSize (e) {
  210. this.pageSize = e;
  211. this.proxyObj.page_size = this.page_size;
  212. this.getData(this.proxyObj)
  213. },
  214. approved (n) {
  215. if (this.selectIds.length < 1) {
  216. return this.$Message.warning('请至少选择一项')
  217. }
  218. this.confirmDelete({
  219. content: n == 1 ? '是否通过此订单审核?' : '是否驳回此订单审核',
  220. title: n == 1 ? '审批通过' : '驳回审批',
  221. type: n == 1 ? 'primary' : 'error',
  222. then: () => {
  223. this.select_post(n, this.selectIds)
  224. },
  225. cancel: () => { }
  226. })
  227. },
  228. singleApproved (n, row) {
  229. console.log(row)
  230. this.selectIds = [row.oa_order_no]
  231. this.approved(n)
  232. },
  233. selectTable (e) {
  234. this.selectIds = e.reduce((pre, cur) => pre.concat([cur.oa_order_no]), [])
  235. console.log('selectIds :>> ', this.selectIds);
  236. },
  237. select_post (state, arr) {//state(1:通过|2:驳回)
  238. let params = { oa_order_no: arr.join(','), state: state }
  239. state == 2 ? params.remark = this.remark : '';
  240. this.axios.post('/api/order_oa_check', params).then(res => {
  241. if (res.code == 200) {
  242. this.$Message.success(res.msg || '无提示')
  243. this.getData(this.proxyObj)
  244. }
  245. })
  246. },
  247. }
  248. }
  249. </script>
  250. <style lang="scss" scoped>
  251. .nav {
  252. display: flex;
  253. justify-content: space-between;
  254. align-items: center;
  255. }
  256. .item-attr {
  257. display: flex;
  258. align-items: center;
  259. margin-bottom: 10px;
  260. }
  261. </style>