Approval.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. <template>
  2. <div>
  3. <FullPage :title="type==3?'测量单审批列表':type==1?'工装订单审批列表':type==2?'深化单审批列表':'审批列表'"
  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(2)"
  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 @click="singleApproved(1,row)"
  32. style="margin:0 5px;color:green"
  33. v-if="row.state == 0 ">通过</a>
  34. <a @click="singleApproved(2,row)"
  35. style="margin:0 5px;color:red"
  36. v-if="row.state == 1">驳回</a>
  37. </div>
  38. </template>
  39. </FullPage>
  40. </div>
  41. </template>
  42. <script>
  43. import { mapState } from 'vuex'
  44. export default {
  45. data () {
  46. return {
  47. list: [
  48. { title: '订单号', name: 'Input', value: '', serverName: 'order_no', placeholder: '请输入订单号' },
  49. {
  50. title: '审批状态', name: 'Select', placeholder: '请选择', value: '', serverName: 'state',
  51. option: [
  52. { label: '待审批', value: 0 },
  53. { label: '同意', value: 1 },
  54. { label: '驳回', value: 2 },
  55. // { label: '取消', value: 3 },
  56. ]
  57. },
  58. { title: '创建人员', name: 'Input', serverName: 'nickname', value: '', placeholder: '请输入创建人员' },
  59. { title: '手机号', name: 'Input', serverName: 'mobile', value: '', placeholder: '请输入手机号' },
  60. { title: '审批时间', start_server: 'start_time', end_server: 'end_time', name: 'Input', start_value: '', end_value: '', isDate: true, start_placeholder: '开始日期', end_placeholder: '结束日期', },
  61. ],
  62. tableColums: [
  63. { type: 'selection', align: 'center', fixed: 'left', minWidth: 100, },
  64. { title: '订单编号', align: 'center', key: 'order_no', width: '180' },
  65. { title: '订单流水号', align: 'center', key: 'oa_order_no', minWidth: 200 },
  66. { title: '客户', align: 'center', key: 'client_name', minWidth: 100 },
  67. { title: '手机号', align: 'center', key: 'mobile', minWidth: 150 },
  68. {
  69. title: '审批状态', align: 'center', key: 'show_state', minWidth: 100,
  70. render (h, params) {
  71. return h('span', {
  72. props: {},
  73. style: {
  74. color: params.row.state == 0 ? '#FFA141' : (params.row.state == 1 ? '#32C800' : '#FF5E5C')
  75. }
  76. }, params.row.state == 0 ? '待审批' : (params.row.state == 1 ? '同意' : (params.row.state == 2 ? '驳回' : '取消')))
  77. }
  78. },
  79. { title: '创建人员', align: 'center', key: 'nickname', minWidth: 100 },
  80. {
  81. title: '审批开始时间', align: 'center', key: 'start_time', minWidth: 200,
  82. render: (h, params) => h('span', {}, this.func.replaceDate(params.row.start_time * 1))
  83. },
  84. {
  85. title: '审批结束时间', align: 'center', key: 'end_time', minWidth: 200,
  86. render: (h, params) => h('span', {}, params.row.upd_time ? this.func.replaceDate(params.row.end_time * 1) : '')
  87. },
  88. { title: '备注', align: 'center', key: 'remark', minWidth: 200 },
  89. { title: '操作', align: 'center', slot: 'set', fixed: 'right', width: '220' },
  90. ],
  91. tableData: [],
  92. pageIndex: 1,
  93. total: 0,
  94. pageSize: 10,
  95. loading: false,
  96. proxyObj: {},
  97. selectIds: [],
  98. currency_type: null,
  99. type: null,
  100. currencyTag: 'name1',
  101. }
  102. },
  103. created () {
  104. //74工装单→深化 审批 78 测量单 80 深化单 82 生产拆单
  105. let id = this.$route.query.id
  106. this.type = id == 78 ? 3 : id == 74 ? 1 : id == 80 ? 2 : ''
  107. this.currency_type = this.$route.query.id
  108. },
  109. computed: {
  110. ...mapState(['persimissionData'])
  111. },
  112. methods: {
  113. init (row) {
  114. this.pageIndex = 1
  115. row.page_index = this.pageIndex;
  116. row.page_size = this.pageSize
  117. this.proxyObj = row;
  118. this.getData(row)
  119. },
  120. getData (row) {
  121. this.loading = true;
  122. this.axios('/api/order_price_oa_list', { params: { ...row, type: this.type } }).then(res => {
  123. this.loading = false;
  124. this.tableData = res.data.data;
  125. this.total = res.data.total;
  126. })
  127. },
  128. changePage (e) {
  129. this.pageIndex = e;
  130. this.proxyObj.page_index = this.pageIndex;
  131. this.getData(this.proxyObj);
  132. },
  133. goPage (row) {
  134. let path
  135. // 3 1 2
  136. switch (this.type) {
  137. //工装审批→深化
  138. case 1:
  139. path = '/cms/BidSystem/ContractList/approvalDetail'
  140. break;
  141. //深化审批→拆单
  142. case 2:
  143. path = '/cms/BidSystem/DeepeningOrder/approvalDetail'
  144. break;
  145. case 3:
  146. // 测量
  147. path = '/cms/BidSystem/ContractList/approvalDetail'
  148. break;
  149. default:
  150. break;
  151. }
  152. this.$router.push({
  153. path,
  154. query: {
  155. oa_order_no: row.oa_order_no,
  156. order_no: row.order_no,
  157. type: 'oa',
  158. currency_type: this.currency_type,
  159. }
  160. })
  161. },
  162. goDetails (row) {
  163. this.$router.push({
  164. path: '/cms/approval/examine',
  165. query: {
  166. oa_order_no: row.oa_order_no
  167. }
  168. })
  169. },
  170. changeSize (e) {
  171. this.pageSize = e;
  172. this.proxyObj.page_size = this.page_size;
  173. this.getData(this.proxyObj)
  174. },
  175. approved (n) {
  176. if (this.selectIds.length < 1) {
  177. return this.$Message.warning('请至少选择一项')
  178. }
  179. this.confirmDelete({
  180. content: n == 1 ? '是否通过此订单审核?' : '是否驳回此订单审核',
  181. title: n == 1 ? '审批通过' : '驳回审批',
  182. type: n == 1 ? 'primary' : 'error',
  183. then: () => {
  184. this.select_post(n, this.selectIds)
  185. },
  186. cancel: () => { }
  187. })
  188. },
  189. singleApproved (n, row) {
  190. this.selectIds = [row.oa_order_no]
  191. this.approved(n)
  192. },
  193. selectTable (e) {
  194. this.selectIds = e.reduce((pre, cur) => pre.concat([cur.oa_order_no]), [])
  195. console.log('selectIds :>> ', this.selectIds);
  196. },
  197. select_post (state, arr) {//state(1:通过|2:驳回)
  198. let params = { oa_order_no: arr.join(','), status: state, type: this.type }
  199. state == 2 ? params.remark = this.remark : '';
  200. this.axios.post('/api/order_price_oa_pull', params).then(res => {
  201. if (res.code == 200) {
  202. this.$Message.success(res.msg || '无提示')
  203. this.getData(this.proxyObj)
  204. }
  205. })
  206. },
  207. }
  208. }
  209. </script>
  210. <style lang="scss" scoped>
  211. .nav {
  212. display: flex;
  213. justify-content: space-between;
  214. align-items: center;
  215. }
  216. .item-attr {
  217. display: flex;
  218. align-items: center;
  219. margin-bottom: 10px;
  220. }
  221. </style>