Merge branch 'master' of http://gitea.zianxin.com/zianxin-tec/biz-pc-cloud
This commit is contained in:
commit
da26e142b3
15 files changed
+1071
-79
No files matched your search
@@ -0,0 +1,41 @@
|
||||
import request from "/@/utils/request"
|
||||
|
||||
export function fetchList(query?: Object) {
|
||||
return request({
|
||||
url: '/integrated/faqCategory/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function addObj(obj?: Object) {
|
||||
return request({
|
||||
url: '/integrated/faqCategory',
|
||||
method: 'post',
|
||||
data: obj
|
||||
})
|
||||
}
|
||||
|
||||
export function getObj(id?: string) {
|
||||
return request({
|
||||
url: '/integrated/faqCategory/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function delObjs(ids?: Object) {
|
||||
return request({
|
||||
url: '/integrated/faqCategory',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function putObj(obj?: Object) {
|
||||
return request({
|
||||
url: '/integrated/faqCategory',
|
||||
method: 'put',
|
||||
data: obj
|
||||
})
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
import request from "/@/utils/request"
|
||||
|
||||
export function fetchList(query?: Object) {
|
||||
return request({
|
||||
url: '/integrated/faqInfo/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function addObj(obj?: Object) {
|
||||
return request({
|
||||
url: '/integrated/faqInfo',
|
||||
method: 'post',
|
||||
data: obj
|
||||
})
|
||||
}
|
||||
|
||||
export function getObj(id?: string) {
|
||||
return request({
|
||||
url: '/integrated/faqInfo/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function delObjs(ids?: Object) {
|
||||
return request({
|
||||
url: '/integrated/faqInfo',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function putObj(obj?: Object) {
|
||||
return request({
|
||||
url: '/integrated/faqInfo',
|
||||
method: 'put',
|
||||
data: obj
|
||||
})
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
import request from "/@/utils/request"
|
||||
|
||||
export function fetchList(query?: Object) {
|
||||
return request({
|
||||
url: '/integrated/visitors/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function addObj(obj?: Object) {
|
||||
return request({
|
||||
url: '/integrated/visitors',
|
||||
method: 'post',
|
||||
data: obj
|
||||
})
|
||||
}
|
||||
|
||||
export function getObj(id?: string) {
|
||||
return request({
|
||||
url: '/integrated/visitors/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function delObjs(ids?: Object) {
|
||||
return request({
|
||||
url: '/integrated/visitors',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function putObj(obj?: Object) {
|
||||
return request({
|
||||
url: '/integrated/visitors',
|
||||
method: 'put',
|
||||
data: obj
|
||||
})
|
||||
}
|
||||
|
||||
@@ -6,6 +6,9 @@
|
||||
<el-form-item :label="$t('systoken.username')" prop="username">
|
||||
<el-input :placeholder="$t('systoken.inputUsernameTip')" v-model="state.queryForm.username"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户id" prop="username">
|
||||
<el-input :placeholder="$t('systoken.inputUsernameTip')" v-model="state.queryForm.userId"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList" icon="Search" type="primary">{{ $t('common.queryBtn') }} </el-button>
|
||||
<el-button @click="resetQuery" icon="Refresh">{{ $t('common.resetBtn') }}</el-button>
|
||||
@@ -81,6 +84,7 @@ const multiple = ref(true);
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {
|
||||
username: '',
|
||||
userId: '',
|
||||
},
|
||||
pageList: fetchList,
|
||||
});
|
||||
|
||||
@@ -19,12 +19,12 @@
|
||||
</div>
|
||||
</template>
|
||||
<el-descriptions-item label="商户名称:">{{}}</el-descriptions-item>
|
||||
<el-descriptions-item label="设备编号:">{{ doorSettingData.id }}</el-descriptions-item>
|
||||
<el-descriptions-item label="设备名称:">{{}}</el-descriptions-item>
|
||||
<el-descriptions-item label="机器编号:">{{}}</el-descriptions-item>
|
||||
<el-descriptions-item label="设备编号:">{{ doorSettingData.deviceCode }}</el-descriptions-item>
|
||||
<el-descriptions-item label="设备名称:">{{ doorSettingData.hardName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="机器编号:">{{ doorSettingData.imei }}</el-descriptions-item>
|
||||
<el-descriptions-item label="外部设备编号:">{{}}</el-descriptions-item>
|
||||
<el-descriptions-item label="SIM卡号:">{{}}</el-descriptions-item>
|
||||
<el-descriptions-item label="柜子层数:">{{}}</el-descriptions-item>
|
||||
<el-descriptions-item label="SIM卡号:">{{ doorSettingData.simSn }}</el-descriptions-item>
|
||||
<el-descriptions-item label="柜子层数:">{{ doorSettingData.doorCount }}</el-descriptions-item>
|
||||
<el-descriptions-item label="地址:">{{}}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
@@ -34,10 +34,10 @@
|
||||
<el-button icon="Edit" type="primary" @click="doVolumeSetting">音量设置</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<el-descriptions-item label="销售状态:">{{}}</el-descriptions-item>
|
||||
<el-descriptions-item label="销售状态:">{{ doorSettingData.saleStatus }}</el-descriptions-item>
|
||||
<el-descriptions-item label="设备状态:">{{}}</el-descriptions-item>
|
||||
<el-descriptions-item label="电源状态:">{{}}</el-descriptions-item>
|
||||
<el-descriptions-item label="网络状态:">{{}}</el-descriptions-item>
|
||||
<el-descriptions-item label="电源状态:">{{ doorSettingData.powerStatus }}</el-descriptions-item>
|
||||
<el-descriptions-item label="网络状态:">{{ doorSettingData.netStatus }}</el-descriptions-item>
|
||||
<el-descriptions-item label="媒体音量:">{{ doorSettingData.mediaVolume }}</el-descriptions-item>
|
||||
<el-descriptions-item label="系统音量:">{{ doorSettingData.systemVolume }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
@@ -51,7 +51,12 @@
|
||||
</el-descriptions>
|
||||
|
||||
<el-tabs type="border-card">
|
||||
<el-tab-pane label="114514-1">
|
||||
<el-tab-pane
|
||||
v-if="doorSettingData.cabinetList?.length"
|
||||
:label="doorSettingData.deviceCode + '-' + item.cabinetNo"
|
||||
v-for="(item, index) in doorSettingData.cabinetList"
|
||||
:key="index"
|
||||
>
|
||||
<div v-for="(floorItem, floorIndex) in state.doorGoods" :key="floorIndex">
|
||||
<el-divider />
|
||||
<div class="text-black flex items-center">
|
||||
@@ -79,7 +84,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="114514-2">22</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
|
||||
@@ -100,6 +104,7 @@ import { useMessage } from "/@/hooks/message"
|
||||
import { displayPrice } from "/@/utils/formatMoney"
|
||||
import * as hardDoorManager from "/@/api/hard/hard-door-manager"
|
||||
import { ElMessageBox } from "element-plus"
|
||||
import { getByCabinetNo } from "/@/api/hard/hard-spu"
|
||||
|
||||
const InfoSetting = defineAsyncComponent(() => import("./info-setting.vue"))
|
||||
const VolumeSetting = defineAsyncComponent(() => import("./volume-setting.vue"))
|
||||
@@ -108,6 +113,8 @@ const GoodsPutaway = defineAsyncComponent(() => import("./goods-putaway.vue"))
|
||||
const { query } = useRoute()
|
||||
const loading = ref(false)
|
||||
const doorSettingData = ref<any>({})
|
||||
const cabinetData = ref<any>([])
|
||||
const currentCabinet = ref(0)
|
||||
const state = reactive<any>({
|
||||
mediaVolume: "",
|
||||
systemVolume: "",
|
||||
@@ -120,8 +127,10 @@ const goodsPutawayRef = ref()
|
||||
|
||||
onMounted(async () => {
|
||||
await getDetail()
|
||||
await getCabinet()
|
||||
})
|
||||
|
||||
// 获取柜子详情
|
||||
const getDetail = async () => {
|
||||
const id = query.id as unknown as any
|
||||
if (!id) return useMessage().error("设备id不存在")
|
||||
@@ -129,13 +138,27 @@ const getDetail = async () => {
|
||||
|
||||
const { data: orderData } = await hardDoorManager.getByHardId({ hardId: id })
|
||||
if (orderData) {
|
||||
doorSettingData.value = orderData
|
||||
doorSettingData.value = { ...orderData, cabinetList: JSON.parse(orderData.cabinetList) }
|
||||
}
|
||||
if (!doorSettingData.value.hardId) {
|
||||
doorSettingData.value.hardId = id
|
||||
}
|
||||
}
|
||||
|
||||
const getCabinet = async (cabinetIndex: number = 0) => {
|
||||
console.log(doorSettingData.value.cabinetList)
|
||||
|
||||
if (!doorSettingData.value.hardId) return useMessage().error("设备id不存在")
|
||||
if (!doorSettingData.value.cabinetList?.length) return useMessage().error("设备空间不存在")
|
||||
const { data } = await getByCabinetNo({
|
||||
hardId: doorSettingData.value.hardId,
|
||||
cabinetNo: doorSettingData.value.cabinetList[cabinetIndex].cabinetNo,
|
||||
})
|
||||
if (data) {
|
||||
cabinetData.value = data
|
||||
}
|
||||
}
|
||||
|
||||
// 绑定信息
|
||||
const doBind = async () => {
|
||||
if (infoSettingRef.value) {
|
||||
@@ -148,7 +171,7 @@ const refreshInfo = () => {}
|
||||
// 音量设置
|
||||
const doVolumeSetting = async () => {
|
||||
if (volumeSettingRef.value) {
|
||||
volumeSettingRef.value.openDialog(doorSettingData.value.hardId)
|
||||
volumeSettingRef.value.openDialog(doorSettingData.value.hardId, doorSettingData.value.mediaVolume, doorSettingData.value.systemVolume)
|
||||
}
|
||||
}
|
||||
const refreshVolume = (data: { hardId: string; mediaVolume: number; systemVolume: number }) => {
|
||||
|
||||
@@ -36,14 +36,16 @@ const form = reactive<{
|
||||
systemVolume: number
|
||||
}>({
|
||||
hardId: "",
|
||||
mediaVolume: 80,
|
||||
systemVolume: 80,
|
||||
mediaVolume: 0,
|
||||
systemVolume: 0,
|
||||
})
|
||||
|
||||
const openDialog = (id: string) => {
|
||||
if (!id) return useMessage().warning("设备id不存在")
|
||||
const openDialog = (hardId: string, mediaVolume: number, systemVolume: number) => {
|
||||
if (!hardId) return useMessage().warning("设备id不存在")
|
||||
form.hardId = hardId
|
||||
form.mediaVolume = mediaVolume
|
||||
form.systemVolume = systemVolume
|
||||
visible.value = true
|
||||
form.hardId = id
|
||||
}
|
||||
|
||||
// 提交
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
<template>
|
||||
<el-dialog :title="form.id ? '编辑' : '新增'" v-model="visible"
|
||||
:close-on-click-modal="false" draggable>
|
||||
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="90px" v-loading="loading">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="分类名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入分类名称"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input-number :min="1" :max="1000" v-model="form.sort" placeholder="请输入排序"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-input v-model="form.status" placeholder="请输入状态"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="部门id" prop="deptId">
|
||||
<el-input v-model="form.deptId" placeholder="请输入部门id"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="onSubmit" :disabled="loading">确认</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="FaqCategoryDialog">
|
||||
import { useDict } from '/@/hooks/dict';
|
||||
import { useMessage } from "/@/hooks/message";
|
||||
import { getObj, addObj, putObj } from '/@/api/integrated/faqCategory'
|
||||
import { rule } from '/@/utils/validate';
|
||||
const emit = defineEmits(['refresh']);
|
||||
|
||||
// 定义变量内容
|
||||
const dataFormRef = ref();
|
||||
const visible = ref(false)
|
||||
const loading = ref(false)
|
||||
// 定义字典
|
||||
|
||||
// 提交表单数据
|
||||
const form = reactive({
|
||||
id:'',
|
||||
name: '',
|
||||
sort: 0,
|
||||
status: '',
|
||||
deptId: '',
|
||||
});
|
||||
|
||||
// 定义校验规则
|
||||
const dataRules = ref({
|
||||
name: [{required: true, message: '分类名称不能为空', trigger: 'blur'}],
|
||||
sort: [{ validator: rule.number, trigger: 'blur' }],
|
||||
})
|
||||
|
||||
// 打开弹窗
|
||||
const openDialog = (id: string) => {
|
||||
visible.value = true
|
||||
form.id = ''
|
||||
|
||||
// 重置表单数据
|
||||
nextTick(() => {
|
||||
dataFormRef.value?.resetFields();
|
||||
});
|
||||
|
||||
// 获取faqCategory信息
|
||||
if (id) {
|
||||
form.id = id
|
||||
getfaqCategoryData(id)
|
||||
}
|
||||
};
|
||||
|
||||
// 提交
|
||||
const onSubmit = async () => {
|
||||
const valid = await dataFormRef.value.validate().catch(() => {});
|
||||
if (!valid) return false;
|
||||
|
||||
try {
|
||||
loading.value = true;
|
||||
form.id ? await putObj(form) : await addObj(form);
|
||||
useMessage().success(form.id ? '修改成功' : '添加成功');
|
||||
visible.value = false;
|
||||
emit('refresh');
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// 初始化表单数据
|
||||
const getfaqCategoryData = (id: string) => {
|
||||
// 获取数据
|
||||
loading.value = true
|
||||
getObj(id).then((res: any) => {
|
||||
Object.assign(form, res.data)
|
||||
}).finally(() => {
|
||||
loading.value = false
|
||||
})
|
||||
};
|
||||
|
||||
// 暴露变量
|
||||
defineExpose({
|
||||
openDialog
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,116 @@
|
||||
<template>
|
||||
<div class="layout-padding">
|
||||
<div class="layout-padding-auto layout-padding-view">
|
||||
<el-row>
|
||||
<div class="mb8" style="width: 100%">
|
||||
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()"
|
||||
v-auth="'integrated_faqCategory_add'">
|
||||
新 增
|
||||
</el-button>
|
||||
<el-button plain :disabled="multiple" icon="Delete" type="primary"
|
||||
v-auth="'integrated_faqCategory_del'" @click="handleDelete(selectObjs)">
|
||||
删除
|
||||
</el-button>
|
||||
<right-toolbar v-model:showSearch="showSearch" :export="'integrated_faqCategory_export'"
|
||||
@exportExcel="exportExcel" class="ml10 mr20" style="float: right;"
|
||||
@queryTable="getDataList"></right-toolbar>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-table :data="state.dataList" v-loading="state.loading" border
|
||||
:cell-style="tableStyle.cellStyle" :header-cell-style="tableStyle.headerCellStyle"
|
||||
@selection-change="selectionChangHandle"
|
||||
@sort-change="sortChangeHandle">
|
||||
<el-table-column type="selection" width="40" align="center" />
|
||||
<el-table-column type="index" label="#" width="40" />
|
||||
<el-table-column prop="name" label="分类名称" show-overflow-tooltip/>
|
||||
<el-table-column prop="sort" label="排序" show-overflow-tooltip/>
|
||||
<el-table-column prop="status" label="状态" show-overflow-tooltip/>
|
||||
<el-table-column prop="deptId" label="部门id" show-overflow-tooltip/>
|
||||
<el-table-column label="操作" width="150">
|
||||
<template #default="scope">
|
||||
<el-button icon="edit-pen" text type="primary" v-auth="'integrated_faqCategory_edit'"
|
||||
@click="formDialogRef.openDialog(scope.row.id)">编辑</el-button>
|
||||
<el-button icon="delete" text type="primary" v-auth="'integrated_faqCategory_del'" @click="handleDelete([scope.row.id])">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||
</div>
|
||||
|
||||
<!-- 编辑、新增 -->
|
||||
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="systemFaqCategory">
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { fetchList, delObjs } from "/@/api/integrated/faqCategory";
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import { useDict } from '/@/hooks/dict';
|
||||
|
||||
// 引入组件
|
||||
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
|
||||
// 定义查询字典
|
||||
|
||||
// 定义变量内容
|
||||
const formDialogRef = ref()
|
||||
// 搜索变量
|
||||
const queryRef = ref()
|
||||
const showSearch = ref(true)
|
||||
// 多选变量
|
||||
const selectObjs = ref([]) as any
|
||||
const multiple = ref(true)
|
||||
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {},
|
||||
pageList: fetchList
|
||||
})
|
||||
|
||||
// table hook
|
||||
const {
|
||||
getDataList,
|
||||
currentChangeHandle,
|
||||
sizeChangeHandle,
|
||||
sortChangeHandle,
|
||||
downBlobFile,
|
||||
tableStyle
|
||||
} = useTable(state)
|
||||
|
||||
// 清空搜索条件
|
||||
const resetQuery = () => {
|
||||
// 清空搜索条件
|
||||
queryRef.value?.resetFields()
|
||||
// 清空多选
|
||||
selectObjs.value = []
|
||||
getDataList()
|
||||
}
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile('/integrated/faqCategory/export', Object.assign(state.queryForm, { ids: selectObjs }), 'faqCategory.xlsx')
|
||||
}
|
||||
|
||||
// 多选事件
|
||||
const selectionChangHandle = (objs: { id: string }[]) => {
|
||||
selectObjs.value = objs.map(({ id }) => id);
|
||||
multiple.value = !objs.length;
|
||||
};
|
||||
|
||||
// 删除操作
|
||||
const handleDelete = async (ids: string[]) => {
|
||||
try {
|
||||
await useMessageBox().confirm('此操作将永久删除');
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await delObjs(ids);
|
||||
getDataList();
|
||||
useMessage().success('删除成功');
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -0,0 +1,144 @@
|
||||
<template>
|
||||
<el-dialog :title="form.id ? '编辑' : '新增'" v-model="visible"
|
||||
:close-on-click-modal="false" draggable>
|
||||
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="90px" v-loading="loading">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入名称"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input v-model="form.sort" placeholder="请输入排序"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-input v-model="form.status" placeholder="请输入状态"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="部门id" prop="deptId">
|
||||
<el-input v-model="form.deptId" placeholder="请输入部门id"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="分类id" prop="categoryId">
|
||||
<el-select v-model="form.categoryId" placeholder="请选择分类id">
|
||||
<el-option label="请选择">0</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="标题" prop="questionText">
|
||||
<el-input v-model="form.questionText" placeholder="请输入标题"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="内容" prop="answerText">
|
||||
<editor v-if="visible" v-model:get-html="form.answerText" placeholder="请输入内容"></editor>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="onSubmit" :disabled="loading">确认</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="FaqInfoDialog">
|
||||
import { useDict } from '/@/hooks/dict';
|
||||
import { useMessage } from "/@/hooks/message";
|
||||
import { getObj, addObj, putObj } from '/@/api/integrated/faqInfo'
|
||||
import { rule } from '/@/utils/validate';
|
||||
const emit = defineEmits(['refresh']);
|
||||
|
||||
// 定义变量内容
|
||||
const dataFormRef = ref();
|
||||
const visible = ref(false)
|
||||
const loading = ref(false)
|
||||
// 定义字典
|
||||
|
||||
// 提交表单数据
|
||||
const form = reactive({
|
||||
id:'',
|
||||
name: '',
|
||||
sort: '',
|
||||
status: '',
|
||||
deptId: '',
|
||||
categoryId: '',
|
||||
questionText: '',
|
||||
answerText: '',
|
||||
});
|
||||
|
||||
// 定义校验规则
|
||||
const dataRules = ref({
|
||||
categoryId: [{required: true, message: '分类id不能为空', trigger: 'blur'}],
|
||||
questionText: [{required: true, message: '标题不能为空', trigger: 'blur'}],
|
||||
answerText: [{required: true, message: '内容不能为空', trigger: 'blur'}],
|
||||
})
|
||||
|
||||
// 打开弹窗
|
||||
const openDialog = (id: string) => {
|
||||
visible.value = true
|
||||
form.id = ''
|
||||
|
||||
// 重置表单数据
|
||||
nextTick(() => {
|
||||
dataFormRef.value?.resetFields();
|
||||
});
|
||||
|
||||
// 获取faqInfo信息
|
||||
if (id) {
|
||||
form.id = id
|
||||
getfaqInfoData(id)
|
||||
}
|
||||
};
|
||||
|
||||
// 提交
|
||||
const onSubmit = async () => {
|
||||
const valid = await dataFormRef.value.validate().catch(() => {});
|
||||
if (!valid) return false;
|
||||
|
||||
try {
|
||||
loading.value = true;
|
||||
form.id ? await putObj(form) : await addObj(form);
|
||||
useMessage().success(form.id ? '修改成功' : '添加成功');
|
||||
visible.value = false;
|
||||
emit('refresh');
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// 初始化表单数据
|
||||
const getfaqInfoData = (id: string) => {
|
||||
// 获取数据
|
||||
loading.value = true
|
||||
getObj(id).then((res: any) => {
|
||||
Object.assign(form, res.data)
|
||||
}).finally(() => {
|
||||
loading.value = false
|
||||
})
|
||||
};
|
||||
|
||||
// 暴露变量
|
||||
defineExpose({
|
||||
openDialog
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,118 @@
|
||||
<template>
|
||||
<div class="layout-padding">
|
||||
<div class="layout-padding-auto layout-padding-view">
|
||||
<el-row>
|
||||
<div class="mb8" style="width: 100%">
|
||||
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()"
|
||||
v-auth="'integrated_faqInfo_add'">
|
||||
新 增
|
||||
</el-button>
|
||||
<el-button plain :disabled="multiple" icon="Delete" type="primary"
|
||||
v-auth="'integrated_faqInfo_del'" @click="handleDelete(selectObjs)">
|
||||
删除
|
||||
</el-button>
|
||||
<right-toolbar v-model:showSearch="showSearch" :export="'integrated_faqInfo_export'"
|
||||
@exportExcel="exportExcel" class="ml10 mr20" style="float: right;"
|
||||
@queryTable="getDataList"></right-toolbar>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-table :data="state.dataList" v-loading="state.loading" border
|
||||
:cell-style="tableStyle.cellStyle" :header-cell-style="tableStyle.headerCellStyle"
|
||||
@selection-change="selectionChangHandle"
|
||||
@sort-change="sortChangeHandle">
|
||||
<el-table-column type="selection" width="40" align="center" />
|
||||
<el-table-column type="index" label="#" width="40" />
|
||||
<el-table-column prop="name" label="名称" show-overflow-tooltip/>
|
||||
<el-table-column prop="sort" label="排序" show-overflow-tooltip/>
|
||||
<el-table-column prop="status" label="状态" show-overflow-tooltip/>
|
||||
<el-table-column prop="deptId" label="部门id" show-overflow-tooltip/>
|
||||
<el-table-column prop="categoryId" label="分类id" show-overflow-tooltip/>
|
||||
<el-table-column prop="questionText" label="标题" show-overflow-tooltip/>
|
||||
<el-table-column label="操作" width="150">
|
||||
<template #default="scope">
|
||||
<el-button icon="edit-pen" text type="primary" v-auth="'integrated_faqInfo_edit'"
|
||||
@click="formDialogRef.openDialog(scope.row.id)">编辑</el-button>
|
||||
<el-button icon="delete" text type="primary" v-auth="'integrated_faqInfo_del'" @click="handleDelete([scope.row.id])">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||
</div>
|
||||
|
||||
<!-- 编辑、新增 -->
|
||||
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="systemFaqInfo">
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { fetchList, delObjs } from "/@/api/integrated/faqInfo";
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import { useDict } from '/@/hooks/dict';
|
||||
|
||||
// 引入组件
|
||||
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
|
||||
// 定义查询字典
|
||||
|
||||
// 定义变量内容
|
||||
const formDialogRef = ref()
|
||||
// 搜索变量
|
||||
const queryRef = ref()
|
||||
const showSearch = ref(true)
|
||||
// 多选变量
|
||||
const selectObjs = ref([]) as any
|
||||
const multiple = ref(true)
|
||||
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {},
|
||||
pageList: fetchList
|
||||
})
|
||||
|
||||
// table hook
|
||||
const {
|
||||
getDataList,
|
||||
currentChangeHandle,
|
||||
sizeChangeHandle,
|
||||
sortChangeHandle,
|
||||
downBlobFile,
|
||||
tableStyle
|
||||
} = useTable(state)
|
||||
|
||||
// 清空搜索条件
|
||||
const resetQuery = () => {
|
||||
// 清空搜索条件
|
||||
queryRef.value?.resetFields()
|
||||
// 清空多选
|
||||
selectObjs.value = []
|
||||
getDataList()
|
||||
}
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile('/integrated/faqInfo/export', Object.assign(state.queryForm, { ids: selectObjs }), 'faqInfo.xlsx')
|
||||
}
|
||||
|
||||
// 多选事件
|
||||
const selectionChangHandle = (objs: { id: string }[]) => {
|
||||
selectObjs.value = objs.map(({ id }) => id);
|
||||
multiple.value = !objs.length;
|
||||
};
|
||||
|
||||
// 删除操作
|
||||
const handleDelete = async (ids: string[]) => {
|
||||
try {
|
||||
await useMessageBox().confirm('此操作将永久删除');
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await delObjs(ids);
|
||||
getDataList();
|
||||
useMessage().success('删除成功');
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -9,18 +9,12 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="图片" prop="picUrl">
|
||||
<upload-img v-model="form.picUrl"></upload-img>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input-number :min="1" :max="1000" v-model="form.sort" placeholder="请输入排序"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="描述" prop="description">
|
||||
<editor v-if="visible" v-model:get-html="form.description" placeholder="请输入描述"></editor>
|
||||
|
||||
@@ -0,0 +1,185 @@
|
||||
<template>
|
||||
<el-dialog :title="form.id ? '编辑' : '新增'" v-model="visible"
|
||||
:close-on-click-modal="false" draggable>
|
||||
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="90px" v-loading="loading">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="姓名" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入姓名"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="手机号" prop="mobile">
|
||||
<el-input v-model="form.mobile" placeholder="请输入手机号"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="身份证号" prop="idCard">
|
||||
<el-input v-model="form.idCard" placeholder="请输入身份证号"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
|
||||
<el-form-item label="到访理由" prop="description">
|
||||
<el-select v-model="form.description" placeholder="请选择拜访理由">
|
||||
<el-option :value="item.value" :label="item.label" v-for="(item, index) in visitor_reason" :key="index"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="到访单位" prop="deptId">
|
||||
<el-input v-model="form.deptId" placeholder="请输入到访单位"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="接待人" prop="userName">
|
||||
<el-input v-model="form.userName" placeholder="请输入接待人"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="车牌号id" prop="carId">
|
||||
<el-input v-model="form.carId" placeholder="请输入车牌号id"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="公司名称" prop="companyName">
|
||||
<el-input v-model="form.companyName" placeholder="请输入公司名称"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="随行人数" prop="peopleNumber">
|
||||
<el-input v-model="form.peopleNumber" placeholder="请输入随行人员数量"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="到访开始时间" prop="vDate">
|
||||
<el-input v-model="form.vStartDate" placeholder="请输入到访时间"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="到访结束时间" prop="vDate">
|
||||
<el-input v-model="form.vEndDate" placeholder="请输入到访时间"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- <el-col :span="12" class="mb20">-->
|
||||
<!-- <el-form-item label="是否驾驶车辆" prop="isDrive">-->
|
||||
<!-- <el-radio-group v-model="form.isDrive">-->
|
||||
<!-- <el-radio :label="item.value" v-for="(item, index) in is_drive" border :key="index">{{ item.label }}-->
|
||||
<!-- </el-radio>-->
|
||||
<!-- </el-radio-group>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="onSubmit" :disabled="loading">确认</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="VisitorsDialog">
|
||||
import { useDict } from '/@/hooks/dict';
|
||||
import { useMessage } from "/@/hooks/message";
|
||||
import { getObj, addObj, putObj } from '/@/api/integrated/visitors'
|
||||
import { rule } from '/@/utils/validate';
|
||||
const emit = defineEmits(['refresh']);
|
||||
|
||||
// 定义变量内容
|
||||
const dataFormRef = ref();
|
||||
const visible = ref(false)
|
||||
const loading = ref(false)
|
||||
// 定义字典
|
||||
const { check_status,is_drive,visitor_reason } = useDict('check_status','is_drive','visitor_reason')
|
||||
|
||||
// 提交表单数据
|
||||
const form = reactive({
|
||||
id:'',
|
||||
name: '',
|
||||
mobile: '',
|
||||
idCard: '',
|
||||
description: '',
|
||||
checkStatus: '',
|
||||
deptId: '',
|
||||
userName: '',
|
||||
carId: '',
|
||||
companyName: '',
|
||||
peopleNumber: '',
|
||||
vStartDate: '',
|
||||
vEndDate: '',
|
||||
isDrive: '',
|
||||
processInstanceId: '',
|
||||
checkReason: '',
|
||||
});
|
||||
|
||||
// 定义校验规则
|
||||
const dataRules = ref({
|
||||
name: [{required: true, message: '姓名不能为空', trigger: 'blur'}],
|
||||
mobile: [{required: true, message: '手机号不能为空', trigger: 'blur'}, { validator: rule.mobilePhone, trigger: 'blur' }],
|
||||
})
|
||||
|
||||
// 打开弹窗
|
||||
const openDialog = (id: string) => {
|
||||
visible.value = true
|
||||
form.id = ''
|
||||
|
||||
// 重置表单数据
|
||||
nextTick(() => {
|
||||
dataFormRef.value?.resetFields();
|
||||
});
|
||||
|
||||
// 获取visitors信息
|
||||
if (id) {
|
||||
form.id = id
|
||||
getvisitorsData(id)
|
||||
}
|
||||
};
|
||||
|
||||
// 提交
|
||||
const onSubmit = async () => {
|
||||
const valid = await dataFormRef.value.validate().catch(() => {});
|
||||
if (!valid) return false;
|
||||
|
||||
try {
|
||||
loading.value = true;
|
||||
form.id ? await putObj(form) : await addObj(form);
|
||||
useMessage().success(form.id ? '修改成功' : '添加成功');
|
||||
visible.value = false;
|
||||
emit('refresh');
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// 初始化表单数据
|
||||
const getvisitorsData = (id: string) => {
|
||||
// 获取数据
|
||||
loading.value = true
|
||||
getObj(id).then((res: any) => {
|
||||
Object.assign(form, res.data)
|
||||
}).finally(() => {
|
||||
loading.value = false
|
||||
})
|
||||
};
|
||||
|
||||
// 暴露变量
|
||||
defineExpose({
|
||||
openDialog
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,151 @@
|
||||
<template>
|
||||
<div class="layout-padding">
|
||||
<div class="layout-padding-auto layout-padding-view">
|
||||
<el-row v-show="showSearch">
|
||||
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
|
||||
<el-form-item label="姓名" prop="name" >
|
||||
<el-input placeholder="请输入姓名" v-model="state.queryForm.name" />
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号" prop="mobile" >
|
||||
<el-input placeholder="请输入手机号" v-model="state.queryForm.mobile" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="search" type="primary" @click="getDataList">
|
||||
查询
|
||||
</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<div class="mb8" style="width: 100%">
|
||||
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()"
|
||||
v-auth="'integrated_visitors_add'">
|
||||
新 增
|
||||
</el-button>
|
||||
<el-button plain :disabled="multiple" icon="Delete" type="primary"
|
||||
v-auth="'integrated_visitors_del'" @click="handleDelete(selectObjs)">
|
||||
删除
|
||||
</el-button>
|
||||
<right-toolbar v-model:showSearch="showSearch" :export="'integrated_visitors_export'"
|
||||
@exportExcel="exportExcel" class="ml10 mr20" style="float: right;"
|
||||
@queryTable="getDataList"></right-toolbar>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-table :data="state.dataList" v-loading="state.loading" border
|
||||
:cell-style="tableStyle.cellStyle" :header-cell-style="tableStyle.headerCellStyle"
|
||||
@selection-change="selectionChangHandle"
|
||||
@sort-change="sortChangeHandle">
|
||||
<el-table-column type="selection" width="40" align="center" />
|
||||
<el-table-column type="index" label="#" width="40" />
|
||||
<el-table-column prop="name" label="姓名" show-overflow-tooltip/>
|
||||
<el-table-column prop="mobile" label="手机号" show-overflow-tooltip/>
|
||||
<el-table-column prop="idCard" label="身份证号" show-overflow-tooltip/>
|
||||
<el-table-column prop="description" label="描述" show-overflow-tooltip/>
|
||||
<el-table-column prop="checkStatus" label="审核状态" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<dict-tag :options="check_status" :value="scope.row.checkStatus"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="deptId" label="到访单位" show-overflow-tooltip/>
|
||||
<el-table-column prop="userName" label="接待人" show-overflow-tooltip/>
|
||||
<!-- <el-table-column prop="carId" label="车牌号id" show-overflow-tooltip/>-->
|
||||
<el-table-column prop="companyName" label="公司名称" show-overflow-tooltip/>
|
||||
<el-table-column prop="peopleNumber" label="随行人员数量" show-overflow-tooltip/>
|
||||
<el-table-column prop="vDate" label="到访时间" show-overflow-tooltip/>
|
||||
<el-table-column prop="isDrive" label="是否驾驶车辆" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<dict-tag :options="is_drive" :value="scope.row.isDrive"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="processInstanceId" label="流程id" show-overflow-tooltip/>
|
||||
<el-table-column prop="checkReason" label="审核原因" show-overflow-tooltip/>
|
||||
<el-table-column label="操作" width="150">
|
||||
<template #default="scope">
|
||||
<el-button icon="edit-pen" text type="primary" v-auth="'integrated_visitors_edit'"
|
||||
@click="formDialogRef.openDialog(scope.row.id)">编辑</el-button>
|
||||
<el-button icon="delete" text type="primary" v-auth="'integrated_visitors_del'" @click="handleDelete([scope.row.id])">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||
</div>
|
||||
|
||||
<!-- 编辑、新增 -->
|
||||
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="systemVisitors">
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { fetchList, delObjs } from "/@/api/integrated/visitors";
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import { useDict } from '/@/hooks/dict';
|
||||
|
||||
// 引入组件
|
||||
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
|
||||
// 定义查询字典
|
||||
|
||||
const { check_status,is_drive } = useDict('check_status','is_drive')
|
||||
// 定义变量内容
|
||||
const formDialogRef = ref()
|
||||
// 搜索变量
|
||||
const queryRef = ref()
|
||||
const showSearch = ref(true)
|
||||
// 多选变量
|
||||
const selectObjs = ref([]) as any
|
||||
const multiple = ref(true)
|
||||
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {},
|
||||
pageList: fetchList
|
||||
})
|
||||
|
||||
// table hook
|
||||
const {
|
||||
getDataList,
|
||||
currentChangeHandle,
|
||||
sizeChangeHandle,
|
||||
sortChangeHandle,
|
||||
downBlobFile,
|
||||
tableStyle
|
||||
} = useTable(state)
|
||||
|
||||
// 清空搜索条件
|
||||
const resetQuery = () => {
|
||||
// 清空搜索条件
|
||||
queryRef.value?.resetFields()
|
||||
// 清空多选
|
||||
selectObjs.value = []
|
||||
getDataList()
|
||||
}
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile('/integrated/visitors/export', Object.assign(state.queryForm, { ids: selectObjs }), 'visitors.xlsx')
|
||||
}
|
||||
|
||||
// 多选事件
|
||||
const selectionChangHandle = (objs: { id: string }[]) => {
|
||||
selectObjs.value = objs.map(({ id }) => id);
|
||||
multiple.value = !objs.length;
|
||||
};
|
||||
|
||||
// 删除操作
|
||||
const handleDelete = async (ids: string[]) => {
|
||||
try {
|
||||
await useMessageBox().confirm('此操作将永久删除');
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await delObjs(ids);
|
||||
getDataList();
|
||||
useMessage().success('删除成功');
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -1,7 +1,39 @@
|
||||
<template>
|
||||
<div v-loading="loading" :element-loading-svg="svg" element-loading-svg-view-box="-10, -10, 50, 50" class="w-full h-full">
|
||||
<div v-if="baseDataForm.inventoryCode" class="layout-padding-auto layout-padding-view" style="overflow: scroll">
|
||||
<el-form v-if="!disabled" ref="baseDataFormRef" :model="baseDataForm" :rules="dataRules" label-width="100px">
|
||||
<div v-if="disabled" ref="baseDataInfoRef">
|
||||
<div style="margin-bottom: 8px; padding: 8px 16px; color: #606279">
|
||||
<div style="display: inline-block; width: 100%">
|
||||
<div style="float: left; width: 33.33%; height: 28px; line-height: 28px">
|
||||
<span class="font-bold">单据编号:</span>
|
||||
<span>{{ baseDataForm.inventoryCode }}</span>
|
||||
</div>
|
||||
<div style="float: left; width: 33.33%; height: 28px; line-height: 28px">
|
||||
<span class="font-bold">单据日期:</span>
|
||||
<span>{{ baseDataForm.inventoryDate }}</span>
|
||||
</div>
|
||||
<div style="float: left; width: 33.33%; height: 28px; line-height: 28px">
|
||||
<span class="font-bold">经办人:</span>
|
||||
<span>{{ baseDataForm.handlerUserId }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: inline-block; width: 100%">
|
||||
<div style="float: left; width: 33.33%; height: 28px; line-height: 28px">
|
||||
<span class="font-bold">关联补货申请:</span>
|
||||
<span>{{ baseDataForm.linkCode }}</span>
|
||||
</div>
|
||||
<div style="float: left; width: 33.33%; height: 28px; line-height: 28px">
|
||||
<span class="font-bold">货商:</span>
|
||||
<span>{{ baseDataForm.supplierId }}</span>
|
||||
</div>
|
||||
<div style="float: left; width: 33.33%; height: 28px; line-height: 28px">
|
||||
<span class="font-bold">备注:</span>
|
||||
<span>{{ baseDataForm.remark }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-form v-else ref="baseDataFormRef" :model="baseDataForm" :rules="dataRules" label-width="100px">
|
||||
<div class="flex flex-wrap">
|
||||
<el-form-item label="单据编号" prop="inventoryCode">
|
||||
<el-input v-model.trim="baseDataForm.inventoryCode" readonly style="width: 200px" :disabled="disabled" />
|
||||
@@ -36,41 +68,9 @@
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form>
|
||||
<div v-else ref="baseDataInfoRef">
|
||||
<div style="margin-bottom: 8px; padding: 8px 16px; color: #606279">
|
||||
<div style="display: inline-block; width: 100%">
|
||||
<div style="float: left; width: 33.33%; height: 28px; line-height: 28px">
|
||||
<span class="font-bold">单据编号:</span>
|
||||
<span>{{ baseDataForm.inventoryCode }}</span>
|
||||
</div>
|
||||
<div style="float: left; width: 33.33%; height: 28px; line-height: 28px">
|
||||
<span class="font-bold">单据日期:</span>
|
||||
<span>{{ baseDataForm.inventoryDate }}</span>
|
||||
</div>
|
||||
<div style="float: left; width: 33.33%; height: 28px; line-height: 28px">
|
||||
<span class="font-bold">经办人:</span>
|
||||
<span>{{ baseDataForm.handlerUserId }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: inline-block; width: 100%">
|
||||
<div style="float: left; width: 33.33%; height: 28px; line-height: 28px">
|
||||
<span class="font-bold">关联补货申请:</span>
|
||||
<span>{{ baseDataForm.linkCode }}</span>
|
||||
</div>
|
||||
<div style="float: left; width: 33.33%; height: 28px; line-height: 28px">
|
||||
<span class="font-bold">货商:</span>
|
||||
<span>{{ baseDataForm.supplierId }}</span>
|
||||
</div>
|
||||
<div style="float: left; width: 33.33%; height: 28px; line-height: 28px">
|
||||
<span class="font-bold">备注:</span>
|
||||
<span>{{ baseDataForm.remark }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-row v-if="!disabled" class="my-3">
|
||||
<el-button @click="addEvent">新增(顶部)</el-button>
|
||||
<!-- <el-button @click="addEvent">新增(顶部)</el-button>
|
||||
<el-button @click="pushEvent">新增(尾部)</el-button>
|
||||
<el-button @click="insertEvent">
|
||||
在第
|
||||
@@ -85,10 +85,10 @@
|
||||
style="min-width: 50px; margin: 0 5px"
|
||||
/>
|
||||
行新增
|
||||
</el-button>
|
||||
</el-button> -->
|
||||
<el-button type="primary" plain @click="handleClickSpuSelect">商品选择</el-button>
|
||||
<el-button @click="removeSelectRowEvent" :disabled="state.selectedRowsErpSpuIds.length <= 0">删除选中</el-button>
|
||||
<el-button @click="clearData">清空数据</el-button>
|
||||
<el-button @click="handleClickSpuSelect">商品选择</el-button>
|
||||
<el-button type="danger" plain @click="clearData">清空数据</el-button>
|
||||
</el-row>
|
||||
|
||||
<vxe-table
|
||||
@@ -137,7 +137,7 @@
|
||||
:label="item.unit"
|
||||
:value="item.id"
|
||||
/>
|
||||
<el-option v-else :key="row.id" :label="row.unit" :value="row.id" />
|
||||
<el-option v-else :key="row.id" :label="row.unit" :value="row.unitId" />
|
||||
</el-select>
|
||||
</template>
|
||||
<template #default="{ row }">
|
||||
@@ -150,15 +150,16 @@
|
||||
<el-input v-model="row.quantity" />
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="unitPrice" title="进价">
|
||||
<template #default="{ row }">
|
||||
{{
|
||||
row.purchasePrice
|
||||
? displayPrice(row.purchasePrice)
|
||||
: displayPrice(row.erpUnitVos?.find((item: any) => item.id == row.unitId)?.purchasePrice)
|
||||
}}
|
||||
</template>
|
||||
</vxe-column>
|
||||
|
||||
<vxe-column field="unitPrice" title="进价">
|
||||
<template #default="{ row }">
|
||||
{{
|
||||
row.purchasePrice
|
||||
? displayPrice(row.purchasePrice)
|
||||
: displayPrice(row.erpUnitVos?.find((item: any) => item.id == row.unitId)?.purchasePrice)
|
||||
}}
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="totalAmount" title="累计总金额">
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.unitId && row.quantity && row.unit && !row.erpUnitVos">
|
||||
@@ -192,7 +193,7 @@
|
||||
</el-row>
|
||||
|
||||
<!-- 商品选择对话框 -->
|
||||
<erpSpuSelectDialog
|
||||
<select-dialog
|
||||
ref="erpSpuSelectDialogRef"
|
||||
v-model="state.erpSpuSelectDialogVisible"
|
||||
:selectedSpuRows="state.editableTableData"
|
||||
@@ -218,11 +219,12 @@ import { getPlanCode, getErpSpuSimpleAll, getCgddPage } from "/@/api/supermarket
|
||||
import { VxeTableEvents, VxeTablePropTypes, type VxeTableInstance } from "vxe-table"
|
||||
import { formatDate } from "/@/utils/formatTime"
|
||||
import { Search } from "@element-plus/icons-vue"
|
||||
import erpSpuSelectDialog from "/@/views/supermarketerp/components/erpSpuSelectDialog.vue"
|
||||
import linkCodeDialog from "/@/views/supermarketerp/components/linkCodeDialog.vue"
|
||||
import { displayPrice } from "/@/utils/formatMoney"
|
||||
import { tablePrint } from "../../supermarketUtils"
|
||||
|
||||
const SelectDialog = defineAsyncComponent(() => import("/@/views/supermarketerp/components/erpSpuSelectDialog.vue"))
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
formId: string | undefined
|
||||
@@ -307,7 +309,7 @@ const getInitData = async () => {
|
||||
disabled.value = props.disabled
|
||||
if (id) {
|
||||
loading.value = true
|
||||
// 获取采购计划数据 & 获取简要商品列表
|
||||
// 获取清单数据
|
||||
const [cgPlanData] = await Promise.allSettled([getObj(id)])
|
||||
.then((results) => results.map((result) => (result.status === "fulfilled" ? result.value : null)))
|
||||
.finally(() => (loading.value = false))
|
||||
@@ -317,16 +319,21 @@ const getInitData = async () => {
|
||||
state.editableTableData = cgPlanData.data.items
|
||||
state.erpSpuItemsMemo = cgPlanData.data.items
|
||||
}
|
||||
return
|
||||
} else {
|
||||
loading.value = true
|
||||
// 获取采购入库编号
|
||||
const [planCode] = await Promise.allSettled([getPlanCode({ type: 3 })])
|
||||
.then((results) => results.map((result) => (result.status === "fulfilled" ? result.value : null)))
|
||||
.finally(() => (loading.value = false))
|
||||
planCode && planCode.code === 0 && (baseDataForm.inventoryCode = planCode.data)
|
||||
}
|
||||
|
||||
loading.value = true
|
||||
// 获取采购入库编号
|
||||
const [erpSpuSimpleAll, planCode] = await Promise.allSettled([getErpSpuSimpleAll(), getPlanCode({ type: 3 })])
|
||||
// 获取简要商品列表
|
||||
const [erpSpuSimpleAll] = await Promise.allSettled([getErpSpuSimpleAll()])
|
||||
.then((results) => results.map((result) => (result.status === "fulfilled" ? result.value : null)))
|
||||
.finally(() => (loading.value = false))
|
||||
erpSpuSimpleAll && erpSpuSimpleAll.code === 0 && (state.erpSpuSimpleAll = erpSpuSimpleAll.data)
|
||||
planCode && planCode.code === 0 && (baseDataForm.inventoryCode = planCode.data)
|
||||
}
|
||||
|
||||
// 点击关联采购申请编号
|
||||
|
||||
@@ -112,7 +112,12 @@ const supplierList = ref([{
|
||||
}, {
|
||||
value: 'qiniu',
|
||||
label: '七牛云短信'
|
||||
}])
|
||||
},
|
||||
{
|
||||
value: 'liantong',
|
||||
label: '联通短信'
|
||||
}
|
||||
])
|
||||
|
||||
// 提交表单数据
|
||||
const form = reactive({
|
||||
|
||||
Reference in new issue
Block a user