123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284 |
- <template>
- <div>
- <van-nav-bar
- fixed
- title="我的待办"
- left-arrow
- @click-left="onClickLeft"
- :style="{ 'background-color': selectColor }"
- />
- </div>
- <div class="main" v-show="!isLoading">
- <div class="banner">
- <img src="../../../public/loginbg/banner.jpg" alt="" />
- </div>
- <div class="info">
- <p class="miniTitle">详细信息</p>
- <div class="content-top">
- <van-cell-group>
- <van-field
- center
- readonly
- clearable
- label-align="top"
- label="问题内容:"
- input-align="left"
- >
- <template #input>
- <p v-html="PersonInfo.data.problemContent"></p>
- </template>
- </van-field>
- </van-cell-group>
- <van-cell-group>
- <van-field
- v-model="PersonInfo.createDepartment.name"
- center
- readonly
- clearable
- label="发起部门:"
- input-align="right"
- />
- </van-cell-group>
- <van-cell-group>
- <van-field
- v-model="PersonInfo.todoBy.name"
- center
- readonly
- clearable
- label="发起人:"
- input-align="right"
- />
- </van-cell-group>
- <van-cell-group>
- <van-field
- v-model="PersonInfo.data.assignTypeName"
- center
- readonly
- clearable
- label="交办类型:"
- input-align="right"
- />
- </van-cell-group>
- <van-cell-group>
- <van-field
- v-model="PersonInfo.data.problemArea"
- center
- readonly
- clearable
- label="问题区域:"
- input-align="right"
- />
- </van-cell-group>
- <van-cell-group>
- <van-field
- v-model="PersonInfo.data.siteName"
- center
- readonly
- clearable
- label="问题场所:"
- input-align="right"
- />
- </van-cell-group>
- <van-cell-group>
- <van-field
- v-model="PersonInfo.data.areaSelectName"
- center
- readonly
- clearable
- label="详细地址:"
- input-align="right"
- />
- </van-cell-group>
- <van-cell-group>
- <van-field
- v-model="PersonInfo.data.problemTime"
- center
- readonly
- clearable
- label="发生时间:"
- input-align="right"
- />
- </van-cell-group>
- <van-cell-group>
- <van-field
- v-model="PersonInfo.data.deadlineTime"
- center
- readonly
- clearable
- label="截止时间:"
- input-align="right"
- />
- </van-cell-group>
- <van-cell-group>
- <van-field
- v-model="PersonInfo.data.problemAccessory"
- center
- readonly
- clearable
- label="问题附件:"
- input-align="right"
- />
- </van-cell-group>
- </div>
- <div class="content-bottom">
- <van-cell-group>
- <van-field
- center
- readonly
- clearable
- label-align="top"
- label="处理结果:"
- input-align="left"
- >
- <template #input>
- <form action="">
- <textarea
- v-if="PersonInfo.data.disposeContent == ''"
- v-model="PersonInfo.disposeContent"
- name=""
- id=""
- cols="50"
- rows="5"
- ></textarea>
- <textarea
- v-if="PersonInfo.data.disposeContent != ''"
- v-model="PersonInfo.data.disposeContent"
- name=""
- id=""
- cols="50"
- rows="5"
- ></textarea>
- </form>
- </template>
- </van-field>
- </van-cell-group>
- <van-cell-group class="upload">
- <van-field name="uploader" label-align="top" label="处理证据资料:">
- <template #input>
- <van-uploader
- :after-read="afterRead"
- v-model="fileList"
- :max-count="6"
- capture="camera"
- accept=""
- :before-delete="fjdelete"
- >
- <van-button icon="plus">上传文件</van-button>
- </van-uploader>
- </template>
- </van-field>
- </van-cell-group>
- </div>
- </div>
- <van-button type="primary" @click="submit" class="btn-sub">确认</van-button>
- </div>
-
- </template>
- <script>
- import { useRouter } from "vue-router";
- import { onMounted, reactive, ref } from "vue";
- import ToBeDone from "@/api/toBeDone/toBeDone";
- import tools from "@/api/sys/tools";
- export default {
- setup() {
- const router = useRouter();
- const PersonInfo = reactive({
- data: {},
- createDepartment: {},
- todoBy: {},
- disposeContent: "",
- });
- // 导航栏颜色
- const selectColor = ref(window.localStorage.getItem("MZ_COLOR"));
- //数据接收
- onMounted(() => {
- var item = JSON.parse(router.currentRoute.value.query.data);
- // let itemId = item.id
- console.log(item);
- PersonInfo.data = item;
- PersonInfo.createDepartment = PersonInfo.data.createDepartment;
- PersonInfo.todoBy = PersonInfo.data.todoBy;
- });
- //返回事件
- const onClickLeft = () => {
- history.back();
- };
- // 文件上传
- let fileList = ref([]);
- let fileupList = ref([]);
- const afterRead = (file) => {
- // 此时可以自行将文件上传至服务器
- new tools()
- .uploadFile(file, `assign/assignWorkOrder`)
- .then(({ data }) => {
- console.log(data);
- data.name = decodeURIComponent(
- data.url.substring(data.url.lastIndexOf("/") + 1)
- );
- PersonInfo.data.disposeAccessory += ''+data.url
- //data.url = `${$base}` + data.url;
- fileupList.value.push(data);
- });
- };
-
- const fjdelete = (file) => {
- //删除文件操作
- for (let index = 0; index < fileList.value.length; index++) {
- if (file.file == fileList.value[index].file) {
- let delurl = fileupList.value[index].url;
- new tools().uploadFiledelete("", delurl).then(({ data }) => {});
- fileupList.value.splice(index, 1);
- fileList.value.splice(index, 1);
- }
- }
- };
- //待办反馈提交
- const submit = () => {
- if (
- PersonInfo.data.assignState != "3" ||
- PersonInfo.data.assignState != "4"
- ) {
- PersonInfo.data.disposeContent = PersonInfo.disposeContent;
- PersonInfo.data.assignState = "3";
- new ToBeDone().save(PersonInfo.data).then((res) => {
- // router.push({
- // path: "/toBeDone",
- // });
- });
- } else {
- router.push({
- path: "/toBeDone",
- });
- }
- };
- return {
- onClickLeft,
- PersonInfo,
- submit,
- selectColor,
- afterRead,
- fileList,
- fjdelete,
- };
- },
- };
- </script>
- <style lang="less">
- .btn-sub {
- width: 90%;
- border-radius: 20px;
- margin-left: 5%;
- margin-bottom: 40px;
- }
- .upload{
- .van-button{
- border: none;
- color: #1989fa;
- }
- }
- </style>
|