YY 1 rok temu
rodzic
commit
2560156230

+ 5 - 0
src/router/module/user.ts

@@ -34,6 +34,11 @@ export default [
     meta: { title: '已往直播' },
     component: () => import('@/views/dock/pass/index.vue')
   },
+  {
+    path: '/dock/pass/detail',
+    meta: { title: '信息管理' },
+    component: () => import('@/views/dock/pass/detail.vue')
+  },
   {
     path: '/matter',
     meta: { title: '事项管理' },

+ 99 - 5
src/views/dock/next/detail.vue

@@ -1,18 +1,112 @@
 <template>
-  <div id="index">
+  <div id="detail">
     <el-row>
-      <el-col :span="24" class="main animate__animated animate__backInRight " v-loading="loading"> test </el-col>
+      <el-col :span="24" class="main animate__animated animate__backInRight" v-loading="loading">
+        <el-col :span="24" class="one">
+          <cSearch :is_back="true" @toBack="toBack"></cSearch>
+        </el-col>
+        <el-col :span="24" class="two">
+          <cForm :span="24" :fields="formFields" :form="form" :rules="rules" @save="onSubmit" @dataChange="dataChange">
+            <template #province>
+              <el-option v-for="(i, index) in provinceList" :key="index" :label="i.label" :value="i.value"></el-option>
+            </template>
+            <template #city>
+              <el-option v-for="(i, index) in cityList" :key="index" :label="i.label" :value="i.value"></el-option>
+            </template>
+            <template #status>
+              <el-option v-for="(i, index) in statusList" :key="index" :label="i.label" :value="i.value"></el-option>
+            </template>
+          </cForm>
+        </el-col>
+      </el-col>
     </el-row>
   </div>
 </template>
 
 <script setup lang="ts">
 import type { Ref } from 'vue';
-import { ref, toRefs,onMounted } from 'vue';
+import { ref, reactive, onMounted } from 'vue';
+import { useRoute } from 'vue-router';
+import { ElMessage } from 'element-plus';
+import type { FormRules } from 'element-plus';
+import store from '@/stores/counter';
+// 接口
+import { DictDataStore } from '@common/src/stores/system/dictData'; // 字典表
+import { DockStore } from '@common/src/stores/allAdmin/dock';
+
+import type { IQueryResult } from '@/util/types.util';
+const dock = DockStore();
+const dictData = DictDataStore();
+
+// 路由
+const route = useRoute();
+
+// 加载中
 const loading = ref(false);
+let user: Ref<any> = ref({});
+// 表单
+let form: Ref<any> = ref({});
+let formFields: Ref<any[]> = ref([
+  { label: '标题', model: 'title' },
+  { label: '开始时间', model: 'start_time', type: 'datetime' },
+  { label: '结束时间', model: 'end_time', type: 'datetime' },
+  { label: '省份', model: 'province', type: 'select' },
+  { label: '市区', model: 'city', type: 'select' },
+  { label: '负责人', model: 'contact' },
+  { label: '手机号', model: 'phone' },
+  { label: '主办方', model: 'sponsor' },
+  { label: '承办方', model: 'organizer' },
+  { label: '状态', model: 'status', type: 'select' }
+]);
+const rules = reactive<FormRules>({});
+
+// 字典表
+let statusList: Ref<any> = ref([]);
+let provinceList: Ref<any> = ref([]);
+let cityList: Ref<any> = ref([]);
 onMounted(async () => {
-loading.value = true;
- loading.value = false;
+  loading.value = true;
+  user.value = store.state.user;
+  await searchOther();
+  await search();
+  loading.value = false;
 });
+const search = async () => {
+  if (route.query.id) {
+    let res: IQueryResult = await dock.fetch(route.query.id);
+    if (res.errcode == 0) form.value = res.data as {};
+  } else form.value = { type: '7', status: '0', user_id: user.value._id };
+};
+const dataChange = (e: { model: string; value: any }) => {
+  const { model, value } = e;
+  if (model == 'province') {
+    let data = provinceList.value.find((i) => i.value == value);
+    if (data && data.children.length > 0) cityList.value = data.children;
+  }
+};
+// 提交
+const onSubmit = async (data) => {
+  let res: IQueryResult;
+  if (data._id) res = await dock.update(data);
+  else res = await dock.create(data);
+  if (res.errcode == 0) {
+    ElMessage({ type: `success`, message: `维护信息成功` });
+    toBack();
+  }
+};
+
+// 返回上一页
+const toBack = () => {
+  window.history.go(-1);
+};
+const searchOther = async () => {
+  let res: IQueryResult;
+  // 状态
+  res = await dictData.query({ type: 'dock_status' });
+  if (res.errcode == 0) statusList.value = res.data;
+  // 省市
+  res = await dictData.query({ type: 'common_city' });
+  if (res.errcode == 0) provinceList.value = res.data;
+};
 </script>
 <style scoped lang="scss"></style>

+ 123 - 7
src/views/dock/next/index.vue

@@ -1,18 +1,134 @@
 <template>
   <div id="index">
     <el-row>
-      <el-col :span="24" class="main animate__animated animate__backInRight " v-loading="loading"> test </el-col>
+      <el-col :span="24" class="main animate__animated animate__backInRight" v-loading="loading">
+        <el-col :span="24" class="one">
+          <cSearch :is_title="false" :is_search="true" :fields="fields" @search="toSearch">
+            <template #status>
+              <el-option v-for="i in statusList" :key="i.value" :label="i.label" :value="i.value"></el-option>
+            </template>
+          </cSearch>
+        </el-col>
+        <el-col :span="24" class="two">
+          <cButton @toAdd="toAdd()"> </cButton>
+        </el-col>
+        <el-col :span="24" class="thr">
+          <cTable :fields="fields" :opera="opera" :list="list" @query="search" :total="total" @edit="toEdit" @del="toDel"> </cTable>
+        </el-col>
+      </el-col>
     </el-row>
   </div>
 </template>
-
-<script setup lang="ts">
+<script lang="ts" setup>
+import _ from 'lodash';
 import type { Ref } from 'vue';
-import { ref, toRefs,onMounted } from 'vue';
+import { ref, onMounted, getCurrentInstance } from 'vue';
+import { useRouter } from 'vue-router';
+import { ElMessage } from 'element-plus';
+
+// 接口
+import { DockStore } from '@common/src/stores/allAdmin/dock';
+import { DictDataStore } from '@common/src/stores/system/dictData'; // 字典表
+import type { IQueryResult } from '@/util/types.util';
+const dock = DockStore();
+const dictData = DictDataStore();
+
+const { proxy } = getCurrentInstance() as any;
+
+// 路由
+const router = useRouter();
+
+// 加载中
 const loading = ref(false);
+// 列表数据
+let list: Ref<any> = ref([]);
+// 总数
+let total: Ref<number> = ref(0);
+let skip = 0;
+let limit: number = proxy.$limit;
+// 列表
+let fields: Ref<any[]> = ref([
+  { label: '房间号', model: 'room_id', isSearch: true },
+  { label: '标题', model: 'title', isSearch: true },
+  { label: '负责人', model: 'contact', isSearch: true },
+  { label: '手机号', model: 'phone' },
+  { label: '开始时间', model: 'start_time' },
+  { label: '结束时间', model: 'end_time' },
+  { label: '状态', model: 'status', format: (i) => getDict(i, 'status'), isSearch: true, type: 'select' }
+]);
+// 操作
+let opera: Ref<any[]> = ref([
+  { label: '修改', method: 'edit' },
+  { label: '删除', method: 'del', confirm: true, type: 'danger' }
+]);
+
+
+// 申请,dockUser
+// 选 科技需求和技术成果
+
+// 查询数据
+let searchForm: Ref<any> = ref({});
+// 字典表
+let statusList: Ref<any> = ref([]);
+
 onMounted(async () => {
-loading.value = true;
- loading.value = false;
+  loading.value = true;
+  await searchOther();
+  await search({ skip, limit });
+  loading.value = false;
 });
+// 查询
+const search = async (e: { skip: number; limit: number }) => {
+  const { skip, limit } = e;
+  const condition = _.cloneDeep(searchForm.value);
+  let info = { limit: limit, skip: skip, ...condition, type: '7', status: '0' };
+  let res: IQueryResult = await dock.query(info);
+  if (res.errcode == 0) {
+    list.value = res.data;
+    total.value = res.total;
+  }
+};
+const toSearch = (query) => {
+  searchForm.value = query;
+  search({ skip, limit });
+};
+const getDict = (e, model) => {
+  if (model == 'status') {
+    let data: any = statusList.value.find((i: any) => i.value == e);
+    if (data) return data.label;
+    else return '暂无';
+  }
+};
+// 新增
+const toAdd = () => {
+  router.push({ path: '/dock/next/detail' });
+};
+// 修改
+const toEdit = async (data) => {
+  router.push({ path: '/dock/next/detail', query: { id: data._id } });
+};
+// 删除
+const toDel = async (data) => {
+  let res: IQueryResult = await dock.del(data._id);
+  if (res.errcode == 0) {
+    ElMessage({ type: `success`, message: `刪除信息成功` });
+    search({ skip, limit });
+  }
+};
+const searchOther = async () => {
+  let res: IQueryResult;
+  // 状态
+  res = await dictData.query({ type: 'dock_status' });
+  if (res.errcode == 0) statusList.value = res.data;
+};
 </script>
-<style scoped lang="scss"></style>
+<style lang="scss" scoped>
+.main {
+  .one {
+    margin: 0 0 10px 0;
+  }
+  .two {
+    margin: 0 0 10px 0;
+  }
+}
+</style>

+ 93 - 0
src/views/dock/pass/detail.vue

@@ -0,0 +1,93 @@
+<template>
+  <div id="detail">
+    <el-row>
+      <el-col :span="24" class="main animate__animated animate__backInRight" v-loading="loading">
+        <el-col :span="24" class="one">
+          <cSearch :is_back="true" @toBack="toBack"></cSearch>
+        </el-col>
+        <el-col :span="24" class="two">
+          <cForm :span="24" :fields="formFields" :form="form" :rules="rules" :disabled="true" :isSave="false">
+            <template #province>
+              <el-option v-for="(i, index) in provinceList" :key="index" :label="i.label" :value="i.value"></el-option>
+            </template>
+            <template #city>
+              <el-option v-for="(i, index) in cityList" :key="index" :label="i.label" :value="i.value"></el-option>
+            </template>
+            <template #status>
+              <el-option v-for="(i, index) in statusList" :key="index" :label="i.label" :value="i.value"></el-option>
+            </template>
+          </cForm>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script setup lang="ts">
+import type { Ref } from 'vue';
+import { ref, reactive, onMounted } from 'vue';
+import { useRoute } from 'vue-router';
+import type { FormRules } from 'element-plus';
+import store from '@/stores/counter';
+// 接口
+import { DictDataStore } from '@common/src/stores/system/dictData'; // 字典表
+import { DockStore } from '@common/src/stores/allAdmin/dock';
+
+import type { IQueryResult } from '@/util/types.util';
+const dock = DockStore();
+const dictData = DictDataStore();
+
+// 路由
+const route = useRoute();
+
+// 加载中
+const loading = ref(false);
+let user: Ref<any> = ref({});
+// 表单
+let form: Ref<any> = ref({});
+let formFields: Ref<any[]> = ref([
+  { label: '标题', model: 'title' },
+  { label: '开始时间', model: 'start_time', type: 'datetime' },
+  { label: '结束时间', model: 'end_time', type: 'datetime' },
+  { label: '省份', model: 'province', type: 'select' },
+  { label: '市区', model: 'city', type: 'select' },
+  { label: '负责人', model: 'contact' },
+  { label: '手机号', model: 'phone' },
+  { label: '主办方', model: 'sponsor' },
+  { label: '承办方', model: 'organizer' },
+  { label: '状态', model: 'status', type: 'select' }
+]);
+const rules = reactive<FormRules>({});
+
+// 字典表
+let statusList: Ref<any> = ref([]);
+let provinceList: Ref<any> = ref([]);
+let cityList: Ref<any> = ref([]);
+onMounted(async () => {
+  loading.value = true;
+  user.value = store.state.user;
+  await searchOther();
+  await search();
+  loading.value = false;
+});
+const search = async () => {
+  if (route.query.id) {
+    let res: IQueryResult = await dock.fetch(route.query.id);
+    if (res.errcode == 0) form.value = res.data as {};
+  }
+};
+// 返回上一页
+const toBack = () => {
+  window.history.go(-1);
+};
+const searchOther = async () => {
+  let res: IQueryResult;
+  // 状态
+  res = await dictData.query({ type: 'dock_status' });
+  if (res.errcode == 0) statusList.value = res.data;
+  // 省市
+  res = await dictData.query({ type: 'common_city' });
+  if (res.errcode == 0) provinceList.value = res.data;
+};
+</script>
+<style scoped lang="scss"></style>

+ 95 - 21
src/views/dock/pass/index.vue

@@ -2,37 +2,111 @@
   <div id="index">
     <el-row>
       <el-col :span="24" class="main animate__animated animate__backInRight" v-loading="loading">
-        <el-col :span="24" class="one">系统首页</el-col>
+        <el-col :span="24" class="one">
+          <cSearch :is_title="false" :is_search="true" :fields="fields" @search="toSearch">
+            <template #status>
+              <el-option v-for="i in statusList" :key="i.value" :label="i.label" :value="i.value"></el-option>
+            </template>
+          </cSearch>
+        </el-col>
+        <el-col :span="24" class="thr">
+          <cTable :fields="fields" :opera="opera" :list="list" @query="search" :total="total" @view="toView"> </cTable>
+        </el-col>
       </el-col>
     </el-row>
   </div>
 </template>
-
-<script setup lang="ts">
-// 基础
+<script lang="ts" setup>
+import _ from 'lodash';
 import type { Ref } from 'vue';
-// reactive,
-import { onMounted, ref, getCurrentInstance } from 'vue';
+import { ref, onMounted, getCurrentInstance } from 'vue';
+import { useRouter } from 'vue-router';
+
 // 接口
-//import { TestStore } from '@common/src/stores/test';
-//import type { IQueryResult } from '@/util/types.util';
-//const testAxios = TestStore();
+import { DockStore } from '@common/src/stores/allAdmin/dock';
+import { DictDataStore } from '@common/src/stores/system/dictData'; // 字典表
+import type { IQueryResult } from '@/util/types.util';
+const dock = DockStore();
+const dictData = DictDataStore();
+
 const { proxy } = getCurrentInstance() as any;
+
+// 路由
+const router = useRouter();
+
 // 加载中
-const loading: Ref<any> = ref(false);
-// 分页数据
-//  const skip = 0;
-//  const limit = proxy.limit;;
-// 请求
+const loading = ref(false);
+// 列表数据
+let list: Ref<any> = ref([]);
+// 总数
+let total: Ref<number> = ref(0);
+let skip = 0;
+let limit: number = proxy.$limit;
+// 列表
+let fields: Ref<any[]> = ref([
+  { label: '房间号', model: 'room_id', isSearch: true },
+  { label: '标题', model: 'title', isSearch: true },
+  { label: '负责人', model: 'contact', isSearch: true },
+  { label: '手机号', model: 'phone' },
+  { label: '开始时间', model: 'start_time' },
+  { label: '结束时间', model: 'end_time' },
+  { label: '状态', model: 'status', format: (i) => getDict(i, 'status'), isSearch: true, type: 'select' }
+]);
+// 操作
+let opera: Ref<any[]> = ref([{ label: '查看', method: 'view' }]);
+
+// 查询数据
+let searchForm: Ref<any> = ref({});
+// 字典表
+let statusList: Ref<any> = ref([]);
+
 onMounted(async () => {
   loading.value = true;
-  //  await search({ skip, limit });
+  await searchOther();
+  await search({ skip, limit });
   loading.value = false;
 });
-//const search = async (e: { skip: number; limit: number }) => {
-//  const info = { skip: e.skip, limit: e.limit, ...searchInfo.value  };
-//  const res: IQueryResult = await testAxios.query(info);
-//  console.log(res);
-//};
+// 查询
+const search = async (e: { skip: number; limit: number }) => {
+  const { skip, limit } = e;
+  const condition = _.cloneDeep(searchForm.value);
+  let info = { limit: limit, skip: skip, ...condition, type: '7', status: '2' };
+  let res: IQueryResult = await dock.query(info);
+  if (res.errcode == 0) {
+    list.value = res.data;
+    total.value = res.total;
+  }
+};
+const toSearch = (query) => {
+  searchForm.value = query;
+  search({ skip, limit });
+};
+const getDict = (e, model) => {
+  if (model == 'status') {
+    let data: any = statusList.value.find((i: any) => i.value == e);
+    if (data) return data.label;
+    else return '暂无';
+  }
+};
+
+// 查看
+const toView = async (data) => {
+  router.push({ path: '/dock/pass/detail', query: { id: data._id } });
+};
+const searchOther = async () => {
+  let res: IQueryResult;
+  // 状态
+  res = await dictData.query({ type: 'dock_status' });
+  if (res.errcode == 0) statusList.value = res.data;
+};
 </script>
-<style scoped lang="scss"></style>
+<style lang="scss" scoped>
+.main {
+  .one {
+    margin: 0 0 10px 0;
+  }
+  .two {
+    margin: 0 0 10px 0;
+  }
+}
+</style>

+ 6 - 6
src/views/product/detail.vue

@@ -181,8 +181,8 @@ const valueOne = () => {
     { label: '预期目标', model: 'expect' },
     { label: '需求现状', model: 'present' },
     { label: '合作条件及要求', model: 'condition' },
-    { label: '产品图片(6)', model: 'file', custom: true },
-    { label: '状态', model: 'status', type: 'select' }
+    { label: '产品图片(6)', model: 'file', custom: true }
+    // { label: '状态', model: 'status', type: 'select' }
   ];
 };
 // 技术成果
@@ -208,8 +208,8 @@ const valueTwo = () => {
     { label: '技术团队', model: 'team' },
     { label: '商业预期', model: 'expect' },
     { label: '合作条件及要求', model: 'condition' },
-    { label: '产品图片(6)', model: 'file', custom: true },
-    { label: '状态', model: 'status', type: 'select' }
+    { label: '产品图片(6)', model: 'file', custom: true }
+    // { label: '状态', model: 'status', type: 'select' }
   ];
 };
 // 商务服务
@@ -227,8 +227,8 @@ const valueThr = () => {
     { label: '信息描述', model: 'informationdesc', type: 'textarea' },
     { label: '核心要素', model: 'coreelements' },
     { label: '价格信息', model: 'priceinfo' },
-    { label: '商业预期', model: 'expect' },
-    { label: '状态', model: 'status', type: 'select' }
+    { label: '商业预期', model: 'expect' }
+    // { label: '状态', model: 'status', type: 'select' }
   ];
 };
 const onUpload = (e: { model: string; value: Array<[]> }) => {

+ 5 - 36
src/views/product/index.vue

@@ -21,15 +21,6 @@
         </el-col>
       </el-col>
     </el-row>
-    <cDialog :dialog="dialog" @handleClose="toClose">
-      <template v-slot:info>
-        <cForm v-if="dialog.type == '1'" :span="24" :fields="formFields" :form="form" :rules="{}" @save="onSubmit">
-          <template #status>
-            <el-option v-for="(i, index) in statusList" :key="index" :label="i.label" :value="i.value"></el-option>
-          </template>
-        </cForm>
-      </template>
-    </cDialog>
   </div>
 </template>
 <script lang="ts" setup>
@@ -72,14 +63,10 @@ let fields: Ref<any[]> = ref([
 // 操作
 let opera: Ref<any[]> = ref([
   { label: '查看', method: 'view', type: 'success' },
-  { label: '状态', method: 'exam' },
-  { label: '修改', method: 'edit' },
+  { label: '发布', method: 'exam', confirm: true, type: 'warning', display: (i) => i.status == '0' },
+  { label: '修改', method: 'edit', display: (i) => i.status == '0' },
   { label: '删除', method: 'del', confirm: true, type: 'danger' }
 ]);
-const dialog: Ref<{ type: string; show: boolean; title: string }> = ref({ type: '1', show: false, title: '信息管理' });
-let form: Ref<any> = ref({});
-// 表单
-let formFields: Ref<any[]> = ref([{ label: '状态', model: 'status', type: 'select' }]);
 // 查询数据
 let searchForm: Ref<any> = ref({});
 // 字典表
@@ -129,28 +116,10 @@ const toView = (data) => {
   router.push({ path: '/product/detail', query: { id: data._id, isdisabled: `${true}` } });
 };
 const toExam = async (data) => {
-  let res: IQueryResult = await product.fetch(data._id);
-  if (res.errcode == 0) {
-    form.value = res.data;
-    dialog.value = { title: '信息管理', show: true, type: '1' };
-  }
-};
-// 提交
-const onSubmit = async (data) => {
+  data.status = '1';
   let res: IQueryResult = await product.update(data);
-  if (res.errcode == 0) {
-    ElMessage({ type: `success`, message: `审核成功` });
-    toClose();
-  } else {
-    ElMessage({ type: `error`, message: `${res.errmsg}` });
-  }
-};
-// 弹框关闭
-const toClose = () => {
-  form.value = {};
-  searchForm.value = {};
-  dialog.value = { title: '信息管理', show: false, type: '1' };
-  search({ skip, limit });
+  if (res.errcode == 0) ElMessage({ type: `success`, message: `发布成功` });
+  else ElMessage({ type: `error`, message: `${res.errmsg}` });
 };
 // 删除
 const toDel = async (data) => {