checkUnusual.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  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="goback"
  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. goback(){
  138. this.$router.go(-1);
  139. },
  140. init (row) {
  141. this.pageIndex = 1
  142. row.page_index = this.pageIndex;
  143. row.page_size = this.pageSize
  144. this.proxyObj = row;
  145. this.getData(row)
  146. },
  147. getData (row) {
  148. this.loading = true;
  149. this.axios('/api/order_oa_list', { params: row }).then(res => {
  150. this.loading = false;
  151. this.tableData = res.data.data;
  152. this.total = res.data.total;
  153. console.log(res);
  154. })
  155. },
  156. changePage (e) {
  157. this.pageIndex = e;
  158. this.proxyObj.page_index = this.pageIndex;
  159. this.getData(this.proxyObj);
  160. },
  161. goPage (row) {
  162. row.type == 1 ? this.$router.push({
  163. // /cms/ordermannage/businessorderlist/details
  164. // path:'/cms/ordermannage/businessorderlist/decorationlist',
  165. path: '/cms/BidSystem/ContractList/requisitionDetail',
  166. query: {
  167. oa_order_no: row.oa_order_no,
  168. order_no: row.order_no,
  169. type: row.type,
  170. state: row.state,
  171. }
  172. }) :row.type == 2 ? this.$router.push({
  173. path: '/cms/BidSystem/ContractList/purchaseDetail',
  174. query: {
  175. oa_order_no: row.oa_order_no,
  176. order_no: row.order_no,
  177. type: row.type,
  178. state: row.state,
  179. }
  180. }) : row.type == 3 ? this.$router.push({
  181. path: '/cms/BidSystem/ContractList/arrivalDetail',
  182. query: {
  183. oa_order_no: row.oa_order_no,
  184. order_no: row.order_no,
  185. type: row.type,
  186. state: row.state,
  187. }
  188. }) : this.$router.push({
  189. path: '/cms/BidSystem/ContractList/qualitytestingDetail',
  190. query: {
  191. oa_order_no: row.oa_order_no,
  192. order_no: row.order_no,
  193. type: row.type,
  194. state: row.state,
  195. }
  196. })
  197. },
  198. goDetails (row) {
  199. this.$router.push({
  200. path: '/cms/approval/examine',
  201. query: {
  202. oa_order_no: row.oa_order_no
  203. }
  204. })
  205. },
  206. changeSize (e) {
  207. this.pageSize = e;
  208. this.proxyObj.page_size = this.page_size;
  209. this.getData(this.proxyObj)
  210. },
  211. approved (n) {
  212. if (this.selectIds.length < 1) {
  213. return this.$Message.warning('请至少选择一项')
  214. }
  215. this.confirmDelete({
  216. content: n == 1 ? '是否通过此订单审核?' : '是否驳回此订单审核',
  217. title: n == 1 ? '审批通过' : '驳回审批',
  218. type: n == 1 ? 'primary' : 'error',
  219. then: () => {
  220. this.select_post(n, this.selectIds)
  221. },
  222. cancel: () => { }
  223. })
  224. },
  225. singleApproved (n, row) {
  226. console.log(row)
  227. this.selectIds = [row.oa_order_no]
  228. this.approved(n)
  229. },
  230. selectTable (e) {
  231. this.selectIds = e.reduce((pre, cur) => pre.concat([cur.oa_order_no]), [])
  232. console.log('selectIds :>> ', this.selectIds);
  233. },
  234. select_post (state, arr) {//state(1:通过|2:驳回)
  235. let params = { oa_order_no: arr.join(','), state: state }
  236. state == 2 ? params.remark = this.remark : '';
  237. this.axios.post('/api/order_oa_check', params).then(res => {
  238. if (res.code == 200) {
  239. this.$Message.success(res.msg || '无提示')
  240. this.getData(this.proxyObj)
  241. }
  242. })
  243. },
  244. }
  245. }
  246. </script>
  247. <style lang="scss" scoped>
  248. .nav {
  249. display: flex;
  250. justify-content: space-between;
  251. align-items: center;
  252. }
  253. .item-attr {
  254. display: flex;
  255. align-items: center;
  256. margin-bottom: 10px;
  257. }
  258. </style>