selectUser.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <template>
  2. <view>
  3. <uni-mall-list :dataList="dataList" :defaultHeadList="defaultHeadList" @change="handleChange" type="select">
  4. </uni-mall-list>
  5. </view>
  6. </template>
  7. <script>
  8. import {
  9. getPartList
  10. } from '@/request/api/organization.js'
  11. import {
  12. insertOrderProcess
  13. } from '@/request/api/order.js'
  14. import uniMallList from '@/components/uni-mall-list/uni-mall-list.vue';
  15. export default {
  16. components: {
  17. uniMallList
  18. },
  19. data() {
  20. return {
  21. defaultHeadList: {},
  22. dataList: [],
  23. orderId: ''
  24. };
  25. },
  26. onLoad(body) {
  27. if (body.orderId) this.orderId = body.orderId;
  28. this.defaultHeadList = {
  29. name: this.$store.getters.organization.name,
  30. id: new Date().getTime()
  31. }
  32. this.init();
  33. },
  34. methods: {
  35. init() {
  36. getPartList(38, 9).then(res => {
  37. if (res.code === 200) {
  38. this.dataList = res.data;
  39. }
  40. })
  41. },
  42. handleChange(type, item) {
  43. console.log(item);
  44. if (type === 'user') {
  45. uni.showLoading();
  46. insertOrderProcess({
  47. operatorId: item.id,
  48. workOrderId: this.orderId,
  49. status: 0,
  50. attachment: '[]'
  51. }).then(res => {
  52. if (res.code === 200) {
  53. this.$toast('操作成功');
  54. uni.$emit('reloadOrderDetail')
  55. setTimeout(() => {
  56. this.$navigateBack();
  57. }, 400)
  58. }
  59. uni.hideLoading();
  60. })
  61. }
  62. }
  63. }
  64. };
  65. </script>
  66. <style></style>