checkUnusual.vue 9.0 KB

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