errorDisposition.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <template>
  2. <scroll-view id="exception" class="scroll-height" :scroll-y="true" :data-theme="'theme-' + proxy.$settingStore.themeColor.name">
  3. <u--form ref="uForm" :model="form" :rules="rules" labelWidth="90">
  4. <view style="padding: 10px 10px 20px 20px; background: #ffffff">
  5. <u-form-item label="事件名称" prop="eventName" required :borderBottom="true">
  6. <view style="color: #666666">{{ form.eventName }}</view>
  7. </u-form-item>
  8. <u-form-item label="处置图片" :borderBottom="true">
  9. <oa-upload :uploadCount="5" :uploadList="form.imageList" :uploadListSrc="'url'" @uploadSuccessChange="uploadSuccessChange" @uploadDeleteChange="uploadDeleteChange"></oa-upload>
  10. </u-form-item>
  11. <u-form-item label="备注" prop="remark" :borderBottom="true">
  12. <u--textarea v-model="form.handleContent" placeholder="备注信息,最多可输入50个字" :count="true" border="none" maxlength="50"></u--textarea>
  13. </u-form-item>
  14. </view>
  15. </u--form>
  16. <view class="app-button">
  17. <view class="app-button-padding"></view>
  18. <view class="app-button-fixed">
  19. <u-button class="app-buttom" type="primary" @click="handleSubmit()" shape="circle"> 提交 </u-button>
  20. </view>
  21. </view>
  22. </scroll-view>
  23. </template>
  24. <script setup>
  25. /*----------------------------------依赖引入-----------------------------------*/
  26. import { onLoad, onShow } from "@dcloudio/uni-app";
  27. import { reactive, toRefs, getCurrentInstance } from "vue";
  28. /*----------------------------------接口引入-----------------------------------*/
  29. import { errorApi } from "@/api/business/zhaf/xunJian/index.js";
  30. /*----------------------------------组件引入-----------------------------------*/
  31. /*----------------------------------公共方法引入-----------------------------------*/
  32. /*----------------------------------公共变量-----------------------------------*/
  33. const { proxy } = getCurrentInstance();
  34. /*----------------------------------变量声明-----------------------------------*/
  35. const state = reactive({
  36. form: {
  37. eventName: "", //事件名称
  38. imageList: [],
  39. handleImage:"",
  40. handleContent: "",
  41. id:undefined
  42. },
  43. });
  44. const { form } = toRefs(state);
  45. /**
  46. * @按钮点击事件
  47. */
  48. function handleSubmit() {
  49. var param = {
  50. eventName: state.form.id, //事件名称
  51. handleImage: JSON.stringify(state.form.imageList),
  52. handleContent: state.form.handleContent,
  53. id:state.form.id
  54. };
  55. errorApi()
  56. .Update(param)
  57. .then(() => {
  58. uni.showToast({
  59. title: "提交成功",
  60. });
  61. uni.navigateTo({
  62. url: "/pages/business/zhaf/xunJian/error/errorList",
  63. });
  64. })
  65. .catch((err) => {
  66. proxy.$modal.msg(err);
  67. });
  68. }
  69. /**
  70. * @图片上传成功回调
  71. */
  72. function uploadSuccessChange(e) {
  73. state.form.imageList.push({
  74. name: e.name,
  75. url: e.url,
  76. });
  77. }
  78. /**
  79. * @图片删除回调
  80. */
  81. function uploadDeleteChange(e) {
  82. state.form.imageList = e;
  83. }
  84. onLoad((options) => {
  85. state.form.id = options.id;
  86. state.form.eventName = options.eventName;
  87. });
  88. onShow(() => {
  89. //调用系统主题颜色
  90. proxy.$settingStore.systemThemeColor([1]);
  91. });
  92. </script>
  93. <style lang="scss">
  94. #exception {
  95. :deep(.u-picker__view__column__item) {
  96. font-size: 13px;
  97. }
  98. }
  99. </style>