toBeDone_details.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. <template>
  2. <div>
  3. <van-nav-bar
  4. fixed
  5. title="我的待办"
  6. left-arrow
  7. @click-left="onClickLeft"
  8. :style="{ 'background-color': selectColor }"
  9. />
  10. </div>
  11. <div class="main" v-show="!isLoading">
  12. <div class="banner">
  13. <img src="../../../public/loginbg/banner.jpg" alt="" />
  14. </div>
  15. <div class="info">
  16. <p class="miniTitle">详细信息</p>
  17. <div class="content-top">
  18. <van-cell-group>
  19. <van-field
  20. center
  21. readonly
  22. clearable
  23. label-align="top"
  24. label="问题内容:"
  25. input-align="left"
  26. >
  27. <template #input>
  28. <p v-html="PersonInfo.data.problemContent"></p>
  29. </template>
  30. </van-field>
  31. </van-cell-group>
  32. <van-cell-group>
  33. <van-field
  34. v-model="PersonInfo.createDepartment.name"
  35. center
  36. readonly
  37. clearable
  38. label="发起部门:"
  39. input-align="right"
  40. />
  41. </van-cell-group>
  42. <van-cell-group>
  43. <van-field
  44. v-model="PersonInfo.todoBy.name"
  45. center
  46. readonly
  47. clearable
  48. label="发起人:"
  49. input-align="right"
  50. />
  51. </van-cell-group>
  52. <van-cell-group>
  53. <van-field
  54. v-model="PersonInfo.data.assignTypeName"
  55. center
  56. readonly
  57. clearable
  58. label="交办类型:"
  59. input-align="right"
  60. />
  61. </van-cell-group>
  62. <van-cell-group>
  63. <van-field
  64. v-model="PersonInfo.data.problemArea"
  65. center
  66. readonly
  67. clearable
  68. label="问题区域:"
  69. input-align="right"
  70. />
  71. </van-cell-group>
  72. <van-cell-group>
  73. <van-field
  74. v-model="PersonInfo.data.siteName"
  75. center
  76. readonly
  77. clearable
  78. label="问题场所:"
  79. input-align="right"
  80. />
  81. </van-cell-group>
  82. <van-cell-group>
  83. <van-field
  84. v-model="PersonInfo.data.areaSelectName"
  85. center
  86. readonly
  87. clearable
  88. label="详细地址:"
  89. input-align="right"
  90. />
  91. </van-cell-group>
  92. <van-cell-group>
  93. <van-field
  94. v-model="PersonInfo.data.problemTime"
  95. center
  96. readonly
  97. clearable
  98. label="发生时间:"
  99. input-align="right"
  100. />
  101. </van-cell-group>
  102. <van-cell-group>
  103. <van-field
  104. v-model="PersonInfo.data.deadlineTime"
  105. center
  106. readonly
  107. clearable
  108. label="截止时间:"
  109. input-align="right"
  110. />
  111. </van-cell-group>
  112. <van-cell-group>
  113. <van-field
  114. v-model="PersonInfo.data.problemAccessory"
  115. center
  116. readonly
  117. clearable
  118. label="问题附件:"
  119. input-align="right"
  120. />
  121. </van-cell-group>
  122. </div>
  123. <div class="content-bottom">
  124. <van-cell-group>
  125. <van-field
  126. center
  127. readonly
  128. clearable
  129. label-align="top"
  130. label="处理结果:"
  131. input-align="left"
  132. >
  133. <template #input>
  134. <form action="">
  135. <textarea
  136. v-if="PersonInfo.data.disposeContent == ''"
  137. v-model="PersonInfo.disposeContent"
  138. name=""
  139. id=""
  140. cols="50"
  141. rows="5"
  142. ></textarea>
  143. <textarea
  144. v-if="PersonInfo.data.disposeContent != ''"
  145. v-model="PersonInfo.data.disposeContent"
  146. name=""
  147. id=""
  148. cols="50"
  149. rows="5"
  150. ></textarea>
  151. </form>
  152. </template>
  153. </van-field>
  154. </van-cell-group>
  155. <van-cell-group class="upload">
  156. <van-field name="uploader" label-align="top" label="处理证据资料:">
  157. <template #input>
  158. <van-uploader
  159. :after-read="afterRead"
  160. v-model="fileList"
  161. :max-count="6"
  162. capture="camera"
  163. accept=""
  164. :before-delete="fjdelete"
  165. >
  166. <van-button icon="plus">上传文件</van-button>
  167. </van-uploader>
  168. </template>
  169. </van-field>
  170. </van-cell-group>
  171. </div>
  172. </div>
  173. <van-button type="primary" @click="submit" class="btn-sub">确认</van-button>
  174. </div>
  175. </template>
  176. <script>
  177. import { useRouter } from "vue-router";
  178. import { onMounted, reactive, ref } from "vue";
  179. import ToBeDone from "@/api/toBeDone/toBeDone";
  180. import tools from "@/api/sys/tools";
  181. export default {
  182. setup() {
  183. const router = useRouter();
  184. const PersonInfo = reactive({
  185. data: {},
  186. createDepartment: {},
  187. todoBy: {},
  188. disposeContent: "",
  189. });
  190. // 导航栏颜色
  191. const selectColor = ref(window.localStorage.getItem("MZ_COLOR"));
  192. //数据接收
  193. onMounted(() => {
  194. var item = JSON.parse(router.currentRoute.value.query.data);
  195. // let itemId = item.id
  196. console.log(item);
  197. PersonInfo.data = item;
  198. PersonInfo.createDepartment = PersonInfo.data.createDepartment;
  199. PersonInfo.todoBy = PersonInfo.data.todoBy;
  200. });
  201. //返回事件
  202. const onClickLeft = () => {
  203. history.back();
  204. };
  205. // 文件上传
  206. let fileList = ref([]);
  207. let fileupList = ref([]);
  208. const afterRead = (file) => {
  209. // 此时可以自行将文件上传至服务器
  210. new tools()
  211. .uploadFile(file, `assign/assignWorkOrder`)
  212. .then(({ data }) => {
  213. console.log(data);
  214. data.name = decodeURIComponent(
  215. data.url.substring(data.url.lastIndexOf("/") + 1)
  216. );
  217. PersonInfo.data.disposeAccessory += ''+data.url
  218. //data.url = `${$base}` + data.url;
  219. fileupList.value.push(data);
  220. });
  221. };
  222. const fjdelete = (file) => {
  223. //删除文件操作
  224. for (let index = 0; index < fileList.value.length; index++) {
  225. if (file.file == fileList.value[index].file) {
  226. let delurl = fileupList.value[index].url;
  227. new tools().uploadFiledelete("", delurl).then(({ data }) => {});
  228. fileupList.value.splice(index, 1);
  229. fileList.value.splice(index, 1);
  230. }
  231. }
  232. };
  233. //待办反馈提交
  234. const submit = () => {
  235. if (
  236. PersonInfo.data.assignState != "3" ||
  237. PersonInfo.data.assignState != "4"
  238. ) {
  239. PersonInfo.data.disposeContent = PersonInfo.disposeContent;
  240. PersonInfo.data.assignState = "3";
  241. new ToBeDone().save(PersonInfo.data).then((res) => {
  242. // router.push({
  243. // path: "/toBeDone",
  244. // });
  245. });
  246. } else {
  247. router.push({
  248. path: "/toBeDone",
  249. });
  250. }
  251. };
  252. return {
  253. onClickLeft,
  254. PersonInfo,
  255. submit,
  256. selectColor,
  257. afterRead,
  258. fileList,
  259. fjdelete,
  260. };
  261. },
  262. };
  263. </script>
  264. <style lang="less">
  265. .btn-sub {
  266. width: 90%;
  267. border-radius: 20px;
  268. margin-left: 5%;
  269. margin-bottom: 40px;
  270. }
  271. .upload{
  272. .van-button{
  273. border: none;
  274. color: #1989fa;
  275. }
  276. }
  277. </style>