Browse Source

feat:预约管理完成

coder 1 year ago
parent
commit
bc5926d87b

BIN
src/assets/index/shgl.png


BIN
src/assets/index/yygl.png


+ 6 - 0
src/main.ts

@@ -2,9 +2,14 @@ import { createApp } from 'vue'
 import { createPinia } from 'pinia'
 import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
 import router from './router/index'
+import { ImagePreview } from 'vant';
 import App from './App.vue'
 import 'vant/es/toast/style'
 import 'vant/es/dialog/style'
+import 'vant/lib/index.css'
+
+
+
 import 'amfe-flexible'
 
 import 'virtual:windi.css'
@@ -19,3 +24,4 @@ pinia.use(piniaPluginPersistedstate)
 app.use(pinia)
 app.use(router)
 app.mount('#app')
+app.use(ImagePreview)

+ 1 - 1
src/pages/borrowReceive/schoolPropertyList/index.vue

@@ -121,7 +121,7 @@ function dropItemChange() {
         <template #label>
           <div><span>资产分类:{{ item.xhx_zcfl }}</span></div>
           <div style="color: black;">
-            <div><span>{{ `状态:${item.xhx_zt}\u00A0\u00A0\u00A0单价${item.xhx_dj}` }}</span></div>
+            <div><span>{{ `状态:${item.xhx_zt}\u00A0\u00A0\u00A0单价${item.xhx_dj}` }}</span></div>
             <div><span>审批人:{{ item.xhx_spr }}</span></div>
           </div>
         </template>

+ 9 - 1
src/pages/menuData.js

@@ -93,7 +93,7 @@ export const menuList = [
   //     { icon: getAssetsImages('index/tjtj.png'), menuName: '提交统计' },
   //   ],
   // },
-   {
+  {
     tag: 'cjxt',
     title: '晨检系统',
     list: [
@@ -121,4 +121,12 @@ export const menuList = [
       { icon: getAssetsImages('index/xmlcgl.png'), menuName: '校内申购', path: '/equipmentPurchase' },
     ],
   },
+  {
+    tag: 'zyyy',
+    title: '资源预约',
+    list: [
+      { icon: getAssetsImages('index/yygl.png'), menuName: '预约管理', path: '/resourceOrder/orderManager' },
+      { icon: getAssetsImages('index/shgl.png'), menuName: '审核管理', path: '/resourceOrder/auditManager' },
+    ],
+  },
 ]

+ 230 - 0
src/pages/resourceOrder/auditManager/index.vue

@@ -0,0 +1,230 @@
+<script setup>
+import { closeToast, showLoadingToast, showToast } from "vant";
+import { userInfo } from '~/store/user'
+
+const { uo_type } = userInfo
+const isBureau = ref(false)// 当前用户是否局端
+isBureau.value = uo_type === '1'
+const list = ref([])
+const loading = ref(false)
+const finished = ref(false)
+let page = 1
+const param = $ref({
+  keyword: '',
+  xhz_cdmc: '',
+  xhz_ssbm: '',
+  xhz_jyr: '',
+  xhz_pzr: '',
+  xhz_zt: ''
+})
+function onLoad() {
+  loading.value = true
+  request({
+    url: '/xdhq/hqgl_zyyy/index',
+    method: 'post',
+    data: {
+      ...param,
+      page,
+      limit: 20,
+    },
+  }).then((res) => {
+    const data = res.data
+    list.value = [...list.value, ...data.page_data]
+    finished.value = data.total_page === page
+    page++
+    loading.value = false
+  })
+}
+function onClickSearch() {
+  reGetList()
+}
+const itemRef1 = ref(null)
+const itemRef2 = ref(null)
+const itemRef3 = ref(null)
+const itemRef4 = ref(null)
+function onConfirm(num) {
+  let temp = [itemRef1, itemRef2, itemRef3, itemRef4]
+  temp[num].value.toggle()
+  reGetList()
+}
+function reGetList() {
+  page = 1
+  list.value = []
+  finished.value = false
+  onLoad()
+}
+
+const statusOption = $ref([{ text: '状态', value: '' }, { text: '通过', value: '1' }, { text: '未通过', value: '2' }, { text: '待审核', value: '3' }])
+function dropItemChange() {
+  reGetList()
+}
+
+const auditDialogShow = ref(false);
+const auditchecked = ref("");
+const xhz_yy = ref('')
+let operaItem = {}
+
+function audit(item) {
+  operaItem = item
+  auditDialogShow.value = true
+}
+function beforeCloseDialog(action) {
+  if (action == "confirm") {
+    if (auditchecked.value == "") {
+      showToast("请选择审核结果");
+      return false;
+    } else if (auditchecked.value === "2" && xhz_yy.value == "") {
+      showToast("请填写意见");
+      return false;
+    } else {
+      dialogSubmit();
+      return true;
+    }
+  } else {
+    return true;
+  }
+}
+function dialogSubmit() {
+  const transObj = {
+    xhz_id: operaItem.xhz_id,
+    xdhq_hqgl_zyyy: {
+      xhz_zt: auditchecked.value, // 待审核 1通过 2驳回
+      xhz_yy: xhz_yy.value, // 处理意见
+    },
+  };
+  showLoadingToast({
+    message: "提交中...",
+    forbidClick: true,
+  });
+  request({
+    url: "/xdhq/hqgl_zyyy/edit",
+    data: transObj,
+  }).then((res) => {
+    closeToast();
+    if (res.code == 1) {
+      showToast(res.msg);
+      list.value = [];
+      page = 1;
+      onLoad();
+    }
+  });
+}
+</script>
+
+<template>
+  <div v-show="isBureau">
+    <div style="width: 100%;text-align: center;"><span style="font-size: 20px;">本功能仅对校端用户开放</span></div>
+  </div>
+  <div class="index" v-show="!isBureau">
+    <van-search v-model="param.keyword" :clearable="false" show-action placeholder="请输入搜索关键词" @search="onClickSearch">
+      <template #action>
+        <div @click="onClickSearch">
+          搜索
+        </div>
+      </template>
+    </van-search>
+    <van-dropdown-menu>
+      <van-dropdown-item ref="itemRef1" title="场地名称">
+        <van-cell-group inset>
+          <van-field v-model="param.xhz_cdmc" placeholder="请输入场地名称" />
+        </van-cell-group>
+        <div style="padding: 5px 16px;">
+          <van-button type="primary" block round @click="onConfirm(0)">
+            确认
+          </van-button>
+        </div>
+      </van-dropdown-item>
+
+      <van-dropdown-item ref="itemRef2" title="所属部门">
+        <van-cell-group inset>
+          <van-field v-model="param.xhz_ssbm" placeholder="请输入所属部门" />
+        </van-cell-group>
+        <div style="padding: 5px 16px;">
+          <van-button type="primary" block round @click="onConfirm(1)">
+            确认
+          </van-button>
+        </div>
+      </van-dropdown-item>
+      <van-dropdown-item ref="itemRef3" title="借用人">
+        <van-cell-group inset>
+          <van-field v-model="param.xhz_jyr" placeholder="请输入借用人" />
+        </van-cell-group>
+        <div style="padding: 5px 16px;">
+          <van-button type="primary" block round @click="onConfirm(2)">
+            确认
+          </van-button>
+        </div>
+      </van-dropdown-item>
+      <van-dropdown-item ref="itemRef4" title="批准人">
+        <van-cell-group inset>
+          <van-field v-model="param.xhz_pzr" placeholder="请输入批准人" />
+        </van-cell-group>
+        <div style="padding: 5px 16px;">
+          <van-button type="primary" block round @click="onConfirm(3)">
+            确认
+          </van-button>
+        </div>
+      </van-dropdown-item>
+      <van-dropdown-item v-model="param.xhz_zt" :options="statusOption" @change="dropItemChange" />
+
+    </van-dropdown-menu>
+    <van-list v-model:loading="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
+      <van-cell v-for="item in list" :key="item">
+        <template #title>
+          <span>{{ `${item.xhz_cdmc}` }}</span>
+        </template>
+        <template #value>
+          <div>
+            <van-button class="w-60px" type="primary" size="small" @click="audit(item)"
+              v-show="item.xhz_zt_option_k == 3">审核</van-button>
+          </div>
+        </template>
+        <template #label>
+          <div><span>{{ `所属部门:${item.xhz_ssbm}\u00A0\u00A0\u00A0状态:${item.xhz_zt}` }}</span></div>
+          <div style="color: black;">
+            <div><span>{{ `借用人:${item.xhz_jyr}\u00A0\u00A0\u00A0批准人:${item.xhz_pzr}` }}</span>
+            </div>
+            <div><span>借用时间:{{ item.xhz_jysj_ks + '至' + item.xhz_jysj_js }}</span></div>
+          </div>
+        </template>
+      </van-cell>
+    </van-list>
+
+    <van-dialog v-model:show="auditDialogShow" title="审核" confirm-button-text="提交" show-cancel-button
+      :before-close="beforeCloseDialog">
+      <div class="dialogDiv">
+        <van-radio-group v-model="auditchecked">
+          <van-cell-group inset>
+            <van-cell title="通过" clickable @click="auditchecked = '1'">
+              <template #right-icon>
+                <van-radio name="1" />
+              </template>
+            </van-cell>
+            <van-cell title="不通过" clickable @click="auditchecked = '2'">
+              <template #right-icon>
+                <van-radio name="2" />
+              </template>
+            </van-cell>
+          </van-cell-group>
+        </van-radio-group>
+        <van-field v-if="auditchecked === '2'" v-model="xhz_yy" rows="3" autosize type="textarea" placeholder="填写原因" />
+      </div>
+    </van-dialog>
+  </div>
+</template>
+
+<style lang="scss" scoped>
+:deep(.van-cell__title) {
+  width: 70% !important;
+  flex: auto
+}
+
+:deep(.van-cell__value) {
+  width: 30% !important;
+  flex: auto
+}
+
+:deep(.van-ellipsis) {
+  font-size: 14px !important;
+}
+</style>

+ 175 - 0
src/pages/resourceOrder/orderManager/index.vue

@@ -0,0 +1,175 @@
+<script setup>
+import { userInfo } from '~/store/user'
+import { showImagePreview } from 'vant';
+
+const { uo_type } = userInfo
+const isBureau = ref(false)// 当前用户是否局端
+isBureau.value = uo_type === '1'
+const list = ref([])
+const loading = ref(false)
+const finished = ref(false)
+let page = 1
+const param = $ref({
+  keyword: '',
+  xhzz_cdbh: '',
+  xhzz_cdmc: '',
+  xhzl_flbm: '',
+  xhzz_fzr: ''
+})
+function onLoad() {
+  loading.value = true
+  request({
+    url: '/xdhq/hqgl_zyyyzy/index',
+    method: 'post',
+    data: {
+      ...param,
+      page,
+      limit: 20,
+    },
+  }).then((res) => {
+    const data = res.data
+    list.value = [...list.value, ...data.page_data]
+    finished.value = data.total_page === page
+    page++
+    loading.value = false
+  })
+}
+function onClickSearch() {
+  reGetList()
+}
+const itemRef1 = ref(null)
+const itemRef2 = ref(null)
+const itemRef3 = ref(null)
+const itemRef4 = ref(null)
+function onConfirm(num) {
+  let temp = [itemRef1, itemRef2, itemRef3, itemRef4]
+  temp[num].value.toggle()
+  reGetList()
+}
+function reGetList() {
+  page = 1
+  list.value = []
+  finished.value = false
+  onLoad()
+}
+const router = useRouter()
+function order(item) {
+  router.push({
+    path: "/resourceOrder/orderManager/orderFrom",
+    query: { xhzz_id: item.xhzz_id },
+  });
+}
+const placeCategoryOption = $ref([{ text: '场地类别', value: '' }])
+request({
+  url: '/xdhq/hqgl_zyyylb/index', data: {
+    page: 1,
+    limit: 9999
+  }
+}).then(res => {
+  for (let item of res.data.page_data) {
+    placeCategoryOption.push({ text: item.xhzl_flmc, value: item.xhzl_flbm })
+  }
+})
+function dropItemChange() {
+  reGetList()
+}
+
+
+function getFullUrl(url) {
+  if (!url)
+    return ''
+  if (url.includes('60.188.226.44:8090')) {
+    url = url.replace('60.188.226.44:8090', 'jnjymf.bozedu.net')
+  }
+  return url.startsWith('http') ? url : `http://jnjymf.bozedu.net/${url}`
+}
+
+function previewImg(url) {
+  showImagePreview([url]);
+}
+</script>
+
+<template>
+  <div v-show="isBureau">
+    <div style="width: 100%;text-align: center;"><span style="font-size: 20px;">本功能仅对校端用户开放</span></div>
+  </div>
+  <div class="index" v-show="!isBureau">
+    <van-search v-model="param.keyword" :clearable="false" show-action placeholder="请输入搜索关键词" @search="onClickSearch">
+      <template #action>
+        <div @click="onClickSearch">
+          搜索
+        </div>
+      </template>
+    </van-search>
+    <van-dropdown-menu>
+      <van-dropdown-item ref="itemRef1" title="场地编号">
+        <van-cell-group inset>
+          <van-field v-model="param.xhzz_cdbh" placeholder="请输入场地编号" />
+        </van-cell-group>
+        <div style="padding: 5px 16px;">
+          <van-button type="primary" block round @click="onConfirm(0)">
+            确认
+          </van-button>
+        </div>
+      </van-dropdown-item>
+
+      <van-dropdown-item ref="itemRef3" title="场地名称">
+        <van-cell-group inset>
+          <van-field v-model="param.xhzz_cdmc" placeholder="请输入场地名称" />
+        </van-cell-group>
+        <div style="padding: 5px 16px;">
+          <van-button type="primary" block round @click="onConfirm(2)">
+            确认
+          </van-button>
+        </div>
+      </van-dropdown-item>
+      <van-dropdown-item v-model="param.xhzl_flbm" :options="placeCategoryOption" @change="dropItemChange" />
+      <van-dropdown-item ref="itemRef4" title="负责人">
+        <van-cell-group inset>
+          <van-field v-model="param.xhzz_fzr" placeholder="请输入负责人" />
+        </van-cell-group>
+        <div style="padding: 5px 16px;">
+          <van-button type="primary" block round @click="onConfirm(3)">
+            确认
+          </van-button>
+        </div>
+      </van-dropdown-item>
+    </van-dropdown-menu>
+    <van-list v-model:loading="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
+      <van-cell v-for="item in list" :key="item">
+        <template #title>
+          <span>{{ `${item.xhzz_cdmc}\u00A0\u00A0\u00A0 ${item.xhzz_cdbh}` }}</span>
+        </template>
+        <template #value>
+          <div>
+            <div>
+              <van-button class="w-60px" type="primary" size="small" @click="order(item)">预约</van-button>
+            </div>
+            <div style="margin-top: 10px;">
+              <img :src="getFullUrl(item.xhzz_tp)" @click="previewImg(getFullUrl(item.xhzz_tp))" />
+            </div>
+          </div>
+        </template>
+        <template #label>
+          <div><span>{{ `场地类别:${item.xhzl_flmc}` }}</span></div>
+          <div style="color: black;">
+            <div><span>{{ `占地面积:${item.xhzz_zdmj}\u00A0\u00A0\u00A0所属校区:${item.xhzz_ssxq}` }}</span></div>
+            <div><span>地址:{{ item.xhzz_dz }}</span></div>
+          </div>
+        </template>
+      </van-cell>
+    </van-list>
+  </div>
+</template>
+
+<style lang="scss" scoped>
+:deep(.van-cell__title) {
+  width: 70% !important;
+  flex: auto
+}
+
+:deep(.van-cell__value) {
+  width: 30% !important;
+  flex: auto
+}
+</style>

+ 56 - 0
src/pages/resourceOrder/orderManager/orderFrom/dateTImePicker.vue

@@ -0,0 +1,56 @@
+<script setup>
+
+const props = defineProps({
+  label: {
+    type: String,
+    default: '',
+  },
+})
+
+defineExpose({
+  getResult
+})
+function getResult() {
+  return result
+}
+let result = $ref('')
+let showDatePicker = $ref(false)
+let showTimePicker = $ref(false)
+
+const onDateConfirm = ({ selectedValues }) => {
+  result = selectedValues.join('/');
+  showDatePicker = false;
+  showTimePicker = true
+};
+const onTimeConfirm = ({ selectedValues }) => {
+  result = result + ' ' + selectedValues.join(':');
+  showTimePicker = false;
+};
+
+let oldResult = ''
+const clickPop = () => {
+  oldResult = result
+  showDatePicker = true
+}
+const clickCancel = () => {
+  result = oldResult
+  showDatePicker = false
+  showTimePicker = false
+
+}
+const currentTime = ref(['12', '00', '00']);
+const columnsType = ['hour', 'minute', 'second'];
+
+const minDate = new Date(2020, 0, 1)
+</script>
+<template>
+  <van-field v-model="result" is-link readonly name="datePicker" :label='props.label' placeholder="点击选择时间"
+    @click="clickPop" :rules="[{ required: true, message: '请选择时间' }]" />
+  <van-popup v-model:show="showDatePicker" position="bottom">
+    <van-date-picker :min-date="minDate" @confirm="onDateConfirm" @cancel="clickCancel" />
+  </van-popup>
+  <van-popup v-model:show="showTimePicker" position="bottom">
+    <van-time-picker @confirm="onTimeConfirm" @cancel="clickCancel" v-model="currentTime" title="选择时间"
+      :columns-type="columnsType" />
+  </van-popup>
+</template>

+ 83 - 0
src/pages/resourceOrder/orderManager/orderFrom/index.vue

@@ -0,0 +1,83 @@
+<script setup>
+import { userInfo } from "~/store/user";
+import { showFailToast, showToast } from 'vant'
+import dateTimePicker from './dateTImePicker.vue'
+
+const { uo_type } = userInfo;
+const isBureau = ref(false); // 当前用户是否局端
+isBureau.value = uo_type === "1";
+
+const router = useRouter()
+
+let transParams = $ref({
+  xhzz_cdbh: '',
+  xhz_cdmc: '',
+  xhz_ssbm: '',
+  xhz_jyr: '',
+  xhz_pzr: '',
+  xhz_jysj_ks: '',
+  xhz_jysj_js: '',
+  xhz_yt: ''
+})
+const jysj_stratRef = $ref()
+const jysj_endRef = $ref()
+const onSubmit = () => {
+  transParams.xhz_jysj_ks = jysj_stratRef.getResult()
+  transParams.xhz_jysj_js = jysj_endRef.getResult()
+  request({ url: '/xdhq/hqgl_zyyy/add', data: { xdhq_hqgl_zyyy: transParams } }).then(res => {
+    if (res.code == '1') {
+      showToast('预约成功等待审核');
+      router.go(-1)
+    } else {
+      showFailToast(res.msg);
+    }
+  })
+};
+const cancel = () => {
+  router.go(-1)
+}
+
+const { currentRoute } = useRouter()
+request({
+  url: '/xdhq/hqgl_zyyyzy/detail',
+  data: {
+    xhzz_id: currentRoute.value.query.xhzz_id,
+  }
+}).then(res => {
+  if (res.code == 1) {
+    transParams.xhzz_cdbh = res.data.one_info.xhzz_cdbh
+    transParams.xhz_cdmc = res.data.one_info.xhzz_cdmc
+  }
+})
+</script>
+<template>
+  <div v-show="isBureau">
+    <div style="width: 100%;text-align: center;"><span style="font-size: 20px;">本功能仅对校端用户开放</span></div>
+  </div>
+  <div v-show="!isBureau">
+    <van-form @submit="onSubmit">
+      <van-cell-group inset>
+        <van-field v-model="transParams.xhzz_cdbh" readonly name="场地编号" label="场地编号" placeholder="请输入场地编号" />
+        <van-field v-model="transParams.xhz_cdmc" readonly name="场地名称" label="场地名称" placeholder="请输入场地名称" />
+        <van-field v-model="transParams.xhz_ssbm" name="所属部门" label="所属部门" placeholder="请输入所属部门"
+          :rules="[{ required: true, message: '请输入所属部门' }]" />
+        <van-field v-model="transParams.xhz_jyr" name="借用人" label="借用人" placeholder="请输入借用人"
+          :rules="[{ required: true, message: '请输入借用人' }]" />
+        <van-field v-model="transParams.xhz_pzr" name="批准人" label="批准人" placeholder="请输入批准人"
+          :rules="[{ required: true, message: '请输入批准人' }]" />
+        <dateTimePicker ref="jysj_stratRef" label="借用时间_开始" />
+        <dateTimePicker ref="jysj_endRef" label="借用时间_结束" />
+        <van-field v-model="transParams.xhz_yt" name="用途" label="用途" placeholder="请输入用途"
+          :rules="[{ required: true, message: '请输入用途' }]" />
+      </van-cell-group>
+      <div style="margin: 16px;">
+        <van-button round block type="primary" native-type="submit">
+          提交
+        </van-button>
+        <van-button style="margin-top: 10px;" round block type="default" @click="cancel()">
+          取消
+        </van-button>
+      </div>
+    </van-form>
+  </div>
+</template>