浏览代码

企业档案

zhangqiOMG 2 年之前
父节点
当前提交
a7a5177084

+ 20 - 2
src/router/modelNormal.js

@@ -119,7 +119,25 @@ const moduleNormal = [
     },
     component: () => import(/* webpackChunkName: "about" */ '@/system/moduleNormal/depManage/detail/index.vue')
   },
-  
-
+  {
+    path: '/EnterpriseArchives',
+    name: 'EnterpriseArchives',
+    meta: {
+      title: '企业档案',
+      name: 'EnterpriseArchives',
+      keepAlive:false
+    },
+    component: () => import(/* webpackChunkName: "about" */ '@/system/moduleNormal/enterpriseArchives/index.vue')
+  },
+  {
+    path: '/enterpriseDetail',
+    name: 'enterpriseDetail',
+    meta: {
+      title: '企业档案',
+      name: 'EnterpriseArchives',
+      keepAlive:false
+    },
+    component: () => import(/* webpackChunkName: "about" */ '@/system/moduleNormal/enterpriseArchives/detail/index.vue')
+  },
 ];
 export default moduleNormal;

+ 103 - 0
src/system/moduleNormal/enterpriseArchives/detail/index.vue

@@ -0,0 +1,103 @@
+<template>
+  <div>
+    <detail-template :headData="mainAreaData" :title="enterpriseData.enterprisename" ownertable="sys_enterprise">
+      <template #operation>
+        <edit-temp :data="enterpriseData" @onSuccess="mianData"></edit-temp>
+      </template>
+      <template #tab0>
+      </template>
+    </detail-template>
+  </div>
+</template>
+
+<script setup>
+import Api from '@/api/api'
+
+import detailTemplate from '@/components/detailTemplate/index.vue'
+import editTemp from './modules/edit.vue'
+import { useRouter } from "vue-router";
+import { onMounted,ref } from "vue";
+const router = useRouter()
+const mainAreaData = ref([])
+const param = ref({
+  "id": 20221109093902,
+  "content": {
+    "sa_orderid": 0, //订单ID
+    "pageNumber": 1,
+    "pageSize": 20,
+    "where": {
+      "condition": ""
+    }
+  },
+})
+const enterpriseData = ref({})
+const mianData = async ()=>{
+  const res = await Api.requested({
+    "id":'20220920084001',
+    "content": {
+      "nocache":true,
+      "sys_enterpriseid": router.currentRoute.value.query.id
+    }
+  })
+  enterpriseData.value = res.data
+  changeDataStructure(res.data)
+
+}
+const changeDataStructure = (data) => {
+  mainAreaData.value = [
+    {
+      label:'企业名称',
+      value: data.enterprisename
+    },
+    {
+      label:'订单可退货天数',
+      value: data.limitreturnday
+    },
+    {
+      label:'是否审核订单可开票',
+      value: data.invoicingpoint == 1 ? '订单审核' : '发货'
+    },
+    {
+      label:'省市县',
+      value: `${data.province}-${data.city}-${data.county}`
+    },
+    {
+      label:'详细地址',
+      value: data.address
+    },
+    {
+      label:'企业联系人',
+      value: data.contact
+    },
+    {
+      label:'联系电话',
+      value: data.phonenumber
+    },
+    {
+      label:'税号',
+      value: data.taxno
+    },
+    {
+      label:'是否经营授权',
+      value: data.saleclassauth == 1 ? '否' : '是'
+    },
+    {
+      label:'企业等级',
+      value: data.grade
+    },
+    {
+      label:'创建人',
+      value: data.createby
+    },
+    {
+      label:'创建时间',
+      value: data.createdate
+    },
+  ]
+}
+onMounted (()=>{
+  mianData()
+})
+</script>
+<style>
+</style>

+ 127 - 0
src/system/moduleNormal/enterpriseArchives/detail/modules/edit.vue

@@ -0,0 +1,127 @@
+<template>
+  <div>
+    <a-button type="primary" @click="showDrawer">编辑企业</a-button>
+    <a-drawer
+      v-model:visible="visible"
+      class="custom-class"
+      title="编辑企业档案"
+      placement="right"
+      width="600"
+      :closable="false"
+      @close="onClose"
+    >
+      <a-form :model="form" ref="formRef" size="small" layout="vertical">
+        <a-row :gutter="16">
+          <a-col :span="24">
+            <a-form-item label="企业名称" name="enterprisename" :rules="[{ required: true, message: '请输入企业名称' }]">
+              <a-input  v-model:value="form.enterprisename"
+                placeholder="输入企业名称">
+                <template #addonAfter>
+                   <business-info :value="form.enterprisename" @onSelect="onSelect"></business-info>
+                </template>
+              </a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="企业联系人" name="contact">
+              <a-input v-model:value="form.contact" placeholder="输入企业联系人"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="联系电话" name="phonenumber">
+              <a-input v-model:value="form.phonenumber" placeholder="输入企业联系电话"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-item label="省市县" name="cascaderValue">
+              <a-cascader v-model:value="form.cascaderValue" :options="Provinces" placeholder="选择省市县" change-on-select clear @change="onChange"/>
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row>
+          <a-col :span="24">
+            <a-form-item label="详细地址" name="address">
+              <a-input
+                v-model:value="form.address"
+                placeholder="输入详细地址"
+              />
+            </a-form-item>
+          </a-col>
+        </a-row>
+      </a-form>
+      <template #extra>
+        <a-space>
+          <a-button @click="onClose">关闭</a-button>
+          <a-button type="primary" @click="submit">保存</a-button>
+        </a-space>
+      </template>
+    </a-drawer>
+  </div>
+</template>
+
+<script setup>
+import {ref,defineEmits,defineProps} from 'vue'
+import Api from '@/api/api'
+import utils from '@/utils/utils'
+import { storeToRefs } from 'pinia'
+import { useBaseStore } from '@/stores/modules/base'
+import businessInfo from '@/template/businessInfo/index.vue'
+const props = defineProps(['data'])
+const emit = defineEmits(['onSuccess'])
+const base = useBaseStore()
+const visible = ref(false)
+const form = ref({
+  sys_enterpriseid:0,
+  enterprisename:'',
+  cascaderValue:null
+})
+const formRef = ref()
+const Provinces = ref([])
+const showDrawer = async ()=>{
+  visible.value = true
+  form.value = Object.assign({},form.value,props.data)
+  form.value.cascaderValue = [props.data.province,props.data.city,props.data.county]
+  Provinces.value = await base.ProvincesData()
+}
+const onClose = () => {
+  visible.value = false;
+  formRef.value.resetFields();
+};
+const submit = async ()=>{
+  try {
+    const values = await formRef.value.validateFields();
+    const res = await Api.requested({
+      "id": 20220920084101,
+      "content":form.value
+    })
+    utils.message(res,'创建成功',()=>{
+      onClose()
+      emit('onSuccess')
+    })
+  } catch (errorInfo) {
+    console.log('Failed:', errorInfo);
+  }
+}
+const onChange = ()=>{
+  if (!form.value.cascaderValue)
+    return false
+  let arr = ['province','city','county']
+  arr.forEach((e,index)=>{
+    form.value[e] = form.value.cascaderValue[index]?form.value.cascaderValue[index]:''
+  })
+}
+const onSelect = (info)=>{
+  form.value = {
+    enterprisename:info.companyName,
+    contact:info.legalPerson,
+    phonenumber:info.phone,
+    province:info.regProvince,
+    city:info.regCity,
+    county:info.regArea,
+    address:info.address,
+    cascaderValue:[info.regProvince,info.regCity,info.regArea]
+  }
+}
+</script>
+<style>
+</style>

+ 39 - 0
src/system/moduleNormal/enterpriseArchives/index.vue

@@ -0,0 +1,39 @@
+<template>
+  <div>
+    <listTemp ref="list" :columns="columns" :param="param" keyRouteName="enterprisename"  :tableName="'EnterpriseArchivesTable'" :searchType="searchType" :detailPage="{name:'enterpriseDetail',idname:'sys_enterpriseid'}">
+      <template #operation>
+        <add-temp @onSuccess="onSuccess"></add-temp>
+      </template>
+    </listTemp>
+  </div>
+</template>
+
+<script setup>
+  import listTemp from '@/components/listTemplate/index.vue';
+  import addTemp from './modules/add.vue';
+  import { ref } from 'vue'
+  import { useRouter } from "vue-router";
+  import { onMounted } from "vue";
+  const router = useRouter()
+  let columns = ref([])
+  let dataSource = ref([])
+  let searchType = ref([
+    {label:'搜索',key:'condition',type:'input'},
+  ])
+  let param = ref({
+    "content": {
+      "pageNumber": 1,
+      "pageSize": 20,
+      "where": {
+        "condition": "",
+      }
+    },
+    "id": 20220920083901,
+  })
+  const list = ref()
+  const onSuccess = ()=>{
+    list.value.tableData()
+  }
+</script>
+<style>
+</style>

+ 124 - 0
src/system/moduleNormal/enterpriseArchives/modules/add.vue

@@ -0,0 +1,124 @@
+<template>
+  <div>
+    <a-button type="primary" @click="showDrawer">创建企业</a-button>
+    <a-drawer
+      v-model:visible="visible"
+      class="custom-class"
+      title="创建企业档案"
+      placement="right"
+      width="600"
+      :closable="false"
+      @close="onClose"
+    >
+      <a-form :model="form" ref="formRef" size="small" layout="vertical">
+        <a-row :gutter="16">
+          <a-col :span="24">
+            <a-form-item label="企业名称" name="enterprisename" :rules="[{ required: true, message: '请输入企业名称' }]">
+              <a-input  v-model:value="form.enterprisename"
+                placeholder="输入企业名称">
+                <template #addonAfter>
+                   <business-info :value="form.enterprisename" @onSelect="onSelect"></business-info>
+                </template>
+              </a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="企业联系人" name="contact">
+              <a-input v-model:value="form.contact" placeholder="输入企业联系人"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="联系电话" name="phonenumber">
+              <a-input v-model:value="form.phonenumber" placeholder="输入企业联系电话"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-item label="省市县" name="cascaderValue">
+              <a-cascader v-model:value="form.cascaderValue" :options="Provinces" placeholder="选择省市县" change-on-select clear @change="onChange"/>
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row>
+          <a-col :span="24">
+            <a-form-item label="详细地址" name="address">
+              <a-input
+                v-model:value="form.address"
+                placeholder="输入详细地址"
+              />
+            </a-form-item>
+          </a-col>
+        </a-row>
+      </a-form>
+      <template #extra>
+        <a-space>
+          <a-button @click="onClose">关闭</a-button>
+          <a-button type="primary" @click="submit">保存</a-button>
+        </a-space>
+      </template>
+    </a-drawer>
+  </div>
+</template>
+
+<script setup>
+import {ref,defineEmits} from 'vue'
+import Api from '@/api/api'
+import utils from '@/utils/utils'
+import { storeToRefs } from 'pinia'
+import { useBaseStore } from '@/stores/modules/base'
+import businessInfo from '@/template/businessInfo/index.vue'
+const emit = defineEmits(['onSuccess'])
+const base = useBaseStore()
+const visible = ref(false)
+const form = ref({
+  sys_enterpriseid:0,
+  enterprisename:'',
+  cascaderValue:null
+})
+const formRef = ref()
+const Provinces = ref([])
+const showDrawer = async ()=>{
+  visible.value = true
+  Provinces.value = await base.ProvincesData()
+}
+const onClose = () => {
+  visible.value = false;
+  formRef.value.resetFields();
+};
+const submit = async ()=>{
+  try {
+    const values = await formRef.value.validateFields();
+    const res = await Api.requested({
+      "id": 20220920084101,
+      "content":form.value
+    })
+    utils.message(res,'创建成功',()=>{
+      onClose()
+      emit('onSuccess')
+    })
+  } catch (errorInfo) {
+    console.log('Failed:', errorInfo);
+  }
+}
+const onChange = ()=>{
+  if (!form.value.cascaderValue)
+    return false
+  let arr = ['province','city','county']
+  arr.forEach((e,index)=>{
+    form.value[e] = form.value.cascaderValue[index]?form.value.cascaderValue[index]:''
+  })
+}
+const onSelect = (info)=>{
+  form.value = {
+    enterprisename:info.companyName,
+    contact:info.legalPerson,
+    phonenumber:info.phone,
+    province:info.regProvince,
+    city:info.regCity,
+    county:info.regArea,
+    address:info.address,
+    cascaderValue:[info.regProvince,info.regCity,info.regArea]
+  }
+}
+</script>
+<style>
+</style>

+ 123 - 0
src/template/businessInfo/index.vue

@@ -0,0 +1,123 @@
+<template>
+  <span style="cursor: pointer;" @click="showModel">工商信息查询</span>
+  <a-modal v-model:visible="visible" title="工商信息" :bodyStyle="{padding:'10px'}" width="900px" cancelText="取消" okText="确认" :okButtonProps="{disabled:false}" @ok="handleOk" @cancel="handleCancel">
+    <a-input v-model:value="search" placeholder="搜索内容" @keyup.enter="searchData" allowClear></a-input>
+    <div v-if="list.length == 0" style="padding:20px">
+      <a-empty description="暂无人员数据"/>
+    </div>
+    <div class="scroll-panel" v-else>
+      <div v-for="(item,index) in list" :key="index" class="panel" :class="index == indexVal?'on':''" @click="itemClick(item,index)">
+        <p class="avatar mr-10">{{item.companyName.substr(0, 1)}}</p>
+        <div>
+          <p>{{item.companyName}}</p>
+          <a-space>
+            <p class="small"><small class="info">企业法人:&nbsp;</small>{{item.legalPerson}}</p>
+            <p class="small"><small class="info">成立日期:&nbsp;</small>{{item.registerDate}}</p>
+            <p class="small"><small class="info">注册资本:&nbsp;</small>{{item.registerCapital?item.registerCapital:'未知'}}</p>
+          </a-space>
+          <p class="small"><small class="info">经营地址:&nbsp;</small>{{item.address}}</p>
+        </div>
+      </div>
+    </div>
+    <div style="text-align:center">
+      <a-pagination style="margin-top:10px" v-model:current="param.content.pageNumber" size="small"  :total="total" @change="pageChange"></a-pagination>
+    </div>
+    
+  </a-modal>
+</template>
+
+<script setup>
+import {ref,defineProps,defineEmits} from 'vue'
+import Api  from '@/api/api'
+const emit = defineEmits(['onSelect'])
+const props = defineProps(['value'])
+const visible = ref(false)
+const param = ref({"id":20221208103601,"content":{"pageNumber":1,"pageSize":5,"keyword":""}})
+const search = ref('')
+const total = ref(0)
+const list = ref([])
+const company = ref({})
+
+const showModel = ()=>{
+  search.value = props.value
+  visible.value = true
+  searchData()
+}
+const searchData = ()=>{
+  param.value.content.keyword = search.value
+  param.value.content.pageNumber = 1
+  queryData()
+}
+
+const queryData = async ()=>{
+  const res = await Api.requested(param.value)
+  list.value = res.data
+  total.value = res.total
+}
+const indexVal = ref(null)
+const itemClick = (item,index) =>{
+  indexVal.value = index
+  company.value = item
+}
+
+const handleOk = () =>{
+  emit('onSelect',company.value)
+  visible.value = false
+}
+
+const handleCancel = () =>{
+  search.value = ''
+}
+
+const pageChange = (pagination,pageSize)=>{
+  param.value.content.pageNumber = pagination
+  param.value.content.pageSize = pageSize
+  queryData()
+}
+</script>
+<style scoped>
+  .scroll-panel{
+    height: 700px;
+    overflow-y: scroll;
+  }
+  .avatar{
+    flex: 0 0 auto;
+    position: relative;
+    height:40px;
+    width: 40px;
+    border-radius: 5px;
+    font-size: 1.25rem;
+    text-align: center;
+    line-height: 40px;
+    color:#fff;
+    font-weight: 500;
+    background: #3874F6;
+    cursor: pointer;
+    overflow: hidden;
+  }
+  .panel{
+    display: flex;
+    align-items: start;
+    padding:10px 10px;
+    margin-top: 10px;
+  }
+  .panel:hover{
+    background: #f1f2f3;
+    cursor: pointer;
+    border-radius: 4px;
+  }
+  .panel p{
+    margin-bottom:0
+  }
+  .info{
+    color:#666
+  }
+  .on{
+    background: #3874f626 !important;
+    border-radius: 4px;
+  }
+  .small{
+    font-size: 12px;
+    line-height: 30px;
+  }
+</style>

+ 2 - 2
src/views/login/login.vue

@@ -4,7 +4,7 @@
     <div class="login-form">
       <p class="color-info">欢迎登录</p>
       <div>
-        <p class="title">楚楚E-订单系统</p>
+        <p class="title">班尼戈水务-总控端</p>
       </div>
       <a-form
         :model="formState"
@@ -86,7 +86,7 @@ export default defineComponent({
       const res = await Api.loginbyaccount({
         "accountno":formState.phonenumber,
         "password":md5(formState.password),  
-        "systemclient": "web"
+        "systemclient": "cweb"
       })
       if (res.code === 1) {
         if (res.account_list[0].status == 'INACTIVE')