main
wwl 2024-04-24 11:11:04 +08:00
parent 6537b15aca
commit 3734a770dd
6 changed files with 2358 additions and 2335 deletions

View File

@ -1050,6 +1050,19 @@ export async function marketPreADD(data: any) {
export async function badartAdd(data: any) {
return http.post(`/quality/badartAdd`, data)
}
/**---
*
* http://127.0.0.1:8811/openApi/quality/badartAdd
*/
export async function badartAddUser(data: any) {
return http.post(`/quality/addUser`, data)
}
/**-
* http://127.0.0.1:8811/openApi/quality/badartDel?id=3
*/
export async function badartGetUser(params: { indexId: any }) {
return http.get(`/quality/getUser`, { params })
}
/**-
* http://127.0.0.1:8811/openApi/quality/badartDel?id=3
*/

View File

@ -13,9 +13,7 @@ import { Swiper, SwiperSlide } from 'swiper/vue'
import { Autoplay, Navigation, Pagination, A11y } from 'swiper'
const modules = [Autoplay, Pagination, Navigation, A11y]
const store = useUserStore()
const userCode = ['admin', 'bcp_dandnag', 'tech_service'].includes(
store.user.roleCode
)
const userCode = ['admin', 'bcp_dandnag', 'tech_service'].includes(store.user.roleCode)
// import { da } from 'element-plus/es/locale/index.js'
const { day, week } = useDate()
@ -166,20 +164,14 @@ const download = async (row) => {
return
}
let { briefingPath, filePath } = row
console.log(
'🚀 ~ file: BCP.vue:169 ~ briefingPath ,filePath:',
briefingPath,
filePath
)
console.log('🚀 ~ file: BCP.vue:169 ~ briefingPath ,filePath:', briefingPath, filePath)
if (!briefingPath && !filePath) {
message.info('没有可预览文件!')
return
}
srcType.value = getLastSubstring(briefingPath || filePath)
if (
['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'pdf'].includes(srcType.value)
) {
if (['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'pdf'].includes(srcType.value)) {
// src.value = filePath
// pdfShow.value = true
let url = 'https://view.xdocin.com/view?src=' + (briefingPath || filePath)
@ -188,14 +180,7 @@ const download = async (row) => {
window.open(
url,
'',
'width=' +
screenWidth +
',height=' +
screenHeight +
',top=' +
0 +
',left=' +
0
'width=' + screenWidth + ',height=' + screenHeight + ',top=' + 0 + ',left=' + 0
)
// window.open(
// briefingPath,
@ -210,9 +195,7 @@ const download = async (row) => {
// 0
// )
} else {
message.error(
"文件格式不是 'doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx','pdf'"
)
message.error("文件格式不是 'doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx','pdf'")
}
}
@ -308,11 +291,7 @@ const isChart = (content) => {
</el-icon>
</div>
<div
class="new-content overflow-hidden"
id="newContent"
v-if="dataA.length > 0"
>
<div class="new-content overflow-hidden" id="newContent" v-if="dataA.length > 0">
<!-- <div v-for="it in dataA" class="new-item h20px mb-10px overflow-hidden" :key="it">
<div class="news1 w340px h38px text-16px lh-22px" @click="showDetail(it, 1)">
<span v-if="it.status === 'New'" class="tit bg-#2CBA06" style="color: white">{{ it.status }}:</span>
@ -335,8 +314,7 @@ const isChart = (content) => {
}"
:cell-style="{}"
>
<el-table-column prop="" label="时间" width="70px">
</el-table-column>
<el-table-column prop="" label="时间" width="70px"> </el-table-column>
<el-table-column prop="" label="情报内容"> </el-table-column>
<el-table-column prop="" label="风险评估"> </el-table-column>
</el-table>
@ -417,11 +395,7 @@ const isChart = (content) => {
<template #default="scope">
<div
class="h-45px p0 m0"
:class="
isChart(scope.row.riskEstimation)
? 'two-line-header '
: ''
"
:class="isChart(scope.row.riskEstimation) ? 'two-line-header ' : ''"
:title="scope.row.riskEstimation"
>
{{ scope.row.riskEstimation }}
@ -432,10 +406,7 @@ const isChart = (content) => {
</div>
<div v-if="dataA.length == 0" class="empty-content"></div>
</div>
<img
src="./images/yojjt@2x.png"
class="w-18px h18px absolute left-49.5% top-20% ml--8px"
/>
<img src="./images/yojjt@2x.png" class="w-18px h18px absolute left-49.5% top-20% ml--8px" />
<div class="summary absolute">
<!-- <div class="arrow"></div> -->
<div
@ -492,10 +463,7 @@ const isChart = (content) => {
</div> -->
<swiper-slide v-for="i in dataC" :key="i.id">
<div class="py22px item-row items-center flex">
<div
class="inline-flex cur_p file-icon text-16px"
@click="download(i)"
>
<div class="inline-flex cur_p file-icon text-16px" @click="download(i)">
{{ i.title }}
</div>
</div>
@ -514,12 +482,7 @@ const isChart = (content) => {
运营守则
</div>
<div class="operate-content overflow-y-auto" v-if="dataB.length > 0">
<div
v-if="dataB"
v-for="it in dataB"
class="py12px h34px overflow-hidden"
:key="it"
>
<div v-if="dataB" v-for="it in dataB" class="py12px h34px overflow-hidden" :key="it">
<n-popover trigger="hover" placement="top-start">
<template #trigger>
<div
@ -542,7 +505,7 @@ const isChart = (content) => {
<div class="gen w293px h92px absolute">
<div class="ring-gen"></div>
<div class="text-23px text-#00E4FF font-500 gen-title">供方SCM</div>
<div class="gen-content overflow-y-auto" v-if="true">
<div class="gen-content overflow-y-auto relative" v-if="true">
<!-- <div v-if="dataC" v-for="it in dataC" class="py8px h28px overflow-hidden" :key="it">
<n-popover trigger="hover" placement="top-start">
<template #trigger>
@ -556,6 +519,14 @@ const isChart = (content) => {
</n-popover>
</div> -->
<img src="./images/ss.png" class="w-388px" />
<div
class="absolute flex flex-col w-97% rounded-md overflow-hidden h-full z-200 top-0 left-0 right-50px text-center bg-red justify-center items-center"
style="background-color: rgba(255, 255, 255, 0.9)"
>
<img src="@/assets/images/chah.png" />
<br />
<div class="text-#5683DB text-36px">做成中,敬请期待</div>
</div>
</div>
<div v-else class="empty-content">
<div class="content"></div>
@ -571,10 +542,7 @@ const isChart = (content) => {
>
BCP情报
</div>
<div
class="supplier-content overflow-y-auto text-16px"
v-if="dataD.length > 0"
>
<div class="supplier-content overflow-y-auto text-16px" v-if="dataD.length > 0">
<s-tree
:data="dataD"
@changeIsShow="changeIsShowFn"

View File

@ -26,41 +26,23 @@
>
<img :src="item.url" class="max-w250px max-h350px min-w250px" />
<span class="ml40px text-20px min-w845px max-w845px">
<span
>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
{{ item.title }}</span
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {{ item.title }}</span
><br /><br /><br />
<span
>相关文件
<span v-if="item.fileList?.[0]">{{
item.fileList[0].name
}}</span></span
<span v-if="item.fileList?.[0]">{{ item.fileList[0].name }}</span></span
>
</span>
<div class="w200px ml30px">
<el-button
size="small"
type="primary"
@click="handleEditC(item)"
>编辑</el-button
>
<el-button
size="small"
type="danger"
@click="handleDeleteC(item)"
>删除</el-button
>
<el-button size="small" type="primary" @click="handleEditC(item)"></el-button>
<el-button size="small" type="danger" @click="handleDeleteC(item)"></el-button>
</div>
</div>
<div class="my20px fixed bottom-25px left-20% z-2000 h50px w-full">
<el-button type="primary" @click="handleEditC({})"
>新增列表内容</el-button
>
<el-button type="primary" @click="getUser(1)">
查看范围</el-button
>
<el-button type="primary" @click="handleEditC({})"></el-button>
<el-button type="primary" @click="getUser(1)"> </el-button>
</div>
</div>
</el-tab-pane>
@ -71,17 +53,12 @@
</span>
</template>
<div class="p30px cont relative w100% h800px overflow-y-auto">
<div
v-for="item in dataA"
class="my20px bg-#f5f5f5 rounded-15px flex w-full"
>
<div v-for="item in dataA" class="my20px bg-#f5f5f5 rounded-15px flex w-full">
<div>
<img :src="item.url" class="max-w180px max-h350px min-w180px" />
</div>
<div class="min-w600px mt50px text-18px">
<span class="ml40px text-20px"
>底部大标题 {{ item.titles }}</span
>
<span class="ml40px text-20px">底部大标题 {{ item.titles }}</span>
<br /><br />
<br /><br />
@ -108,31 +85,15 @@
</div>
<div class="w160px ml30px mt120px">
<el-button
size="small"
type="primary"
@click="handleEditA(item)"
>编辑</el-button
>
<el-button
size="small"
type="danger"
@click="handleDeleteA(item)"
>删除</el-button
>
<el-button size="small" type="primary" @click="handleEditA(item)"></el-button>
<el-button size="small" type="danger" @click="handleDeleteA(item)"></el-button>
</div>
</div>
<!-- <el-button type="primary" @click="handleEditA(editA)" class="my20px fixed bottom-30px left-20% z-2000">新增年度内容</el-button> -->
<div class="my20px fixed bottom-25px left-20% z-2000 h50px w-full">
<el-button type="primary" @click="handleEditA({})"
>新增列表内容</el-button
>
<el-button
type="primary"
@click="getUser(2)"
@CloseThis="CloseThiss"
>
<el-button type="primary" @click="handleEditA({})"></el-button>
<el-button type="primary" @click="getUser(2)" @CloseThis="CloseThiss">
查看范围</el-button
>
</div>
@ -145,17 +106,12 @@
</span>
</template>
<div class="p30px cont relative w100% h800px overflow-y-auto">
<div
v-for="item in dataB"
class="my20px bg-#f5f5f5 rounded-15px flex w-full"
>
<div v-for="item in dataB" class="my20px bg-#f5f5f5 rounded-15px flex w-full">
<div>
<img :src="item.url" class="max-w180px max-h350px min-w180px" />
</div>
<div class="min-w600px mt50px">
<span class="ml40px text-20px"
>底部大标题 {{ item.titles }}</span
>
<span class="ml40px text-20px">底部大标题 {{ item.titles }}</span>
<br /><br />
<br /><br />
@ -175,35 +131,21 @@
<span class="text-20px">文件列表:</span>
</div>
<div class="max-w250px min-w250px mt20px flex items-center">
<sapn v-if="item.fileList" v-for="i in item.fileList"
<span v-if="item.fileList" v-for="i in item.fileList"
><span class="mt5px">{{ i.name }}</span
><br /><br
/></sapn>
/></span>
</div>
<div class="w120px ml30px mt120px">
<el-button
size="small"
type="primary"
@click="handleEditB(item)"
>编辑</el-button
>
<el-button
size="small"
type="danger"
@click="handleDeleteB(item)"
>删除</el-button
>
<el-button size="small" type="primary" @click="handleEditB(item)"></el-button>
<el-button size="small" type="danger" @click="handleDeleteB(item)"></el-button>
</div>
</div>
<div class="my20px fixed bottom-25px left-20% z-2000 h50px w-full">
<el-button type="primary" @click="handleEditB({})"
>新增列表内容</el-button
>
<el-button type="primary" @click="getUser(3)">
查看范围</el-button
>
<el-button type="primary" @click="handleEditB({})"></el-button>
<el-button type="primary" @click="getUser(3)"> </el-button>
</div>
</div>
</el-tab-pane>
@ -403,10 +345,7 @@
</el-form>
<hr class="mb15px border-#f1f1f1" />
<el-form-item class="">
<el-button
type="primary"
class="w88px justify-center"
@click="onSubmitA(editA)"
<el-button type="primary" class="w88px justify-center" @click="onSubmitA(editA)"
>确认</el-button
>
</el-form-item>
@ -463,11 +402,7 @@
</div>
</n-modal>
<n-modal v-model:show="showModal">
<UserList
:userDataList="setUserList"
@clickChild="handleChild"
@CloseThis="CloseThiss"
/>
<UserList :userDataList="setUserList" @clickChild="handleChild" @CloseThis="CloseThiss" />
</n-modal>
</template>
@ -478,12 +413,7 @@ import HomeHead from '@/views/home/components/HomeHead.vue'
import { Plus } from '@element-plus/icons-vue'
import type { UploadProps, UploadUserFile } from 'element-plus'
import { useUserStore } from '@/stores/modules/user'
import {
getLabActList,
getLabCsrActList,
addLab,
getCateList
} from '@/api/daikin/base'
import { getLabActList, getLabCsrActList, addLab, getCateList } from '@/api/daikin/base'
import Modify from './modifys.vue'
import ModifyPor from './modify.vue'
import ModifyList from './component/modify.vue'
@ -885,16 +815,10 @@ const handleDeleteC = (row: any) => {
)
}
const handleRemove: UploadProps['onRemove'] = (
uploadFile: any,
uploadFiles: any
) => {
const handleRemove: UploadProps['onRemove'] = (uploadFile: any, uploadFiles: any) => {
// console.log(uploadFile, uploadFiles)
}
const handOnExceed: UploadProps['onExceed'] = (
uploadFile: any,
uploadFiles: any
) => {
const handOnExceed: UploadProps['onExceed'] = (uploadFile: any, uploadFiles: any) => {
message.warning('最多只能上传一张图片!')
}
const handlePreview: UploadProps['onSuccess'] = (uploadFile: any) => {
@ -958,7 +882,7 @@ const getUser = (id: any) => {
//
const handleChild = (data: any) => {
const { showModal: show, multipleSelection } = data
showModal.value = unref(show)
showModal.value = unref(Boolean(show))
// userList.value = multipleSelection
let userIdList: any[] = []
multipleSelection.value.forEach((i: { userId: any }) => {

View File

@ -17,7 +17,6 @@ async function getTree() {
if (data && data != 'null' && data.length > 0) {
treeData.value = data
}
console.log(data)
}
const props = defineProps({
@ -67,11 +66,13 @@ async function getUserPage() {
}, 150)
}
function selection(list = props.userDataList) {
function selection(list = uniqBy(props.userDataList, 'userId')) {
console.log('🚀 ~ file: UserPages.vue:79 ~ list:', toRaw(list))
if (userData.value && list) {
const commonItems = userData.value.filter((item1: { userId: any }) =>
list.some((item2) => item2.userId === item1.userId)
)
toggleSelection(commonItems)
}
}
@ -108,7 +109,7 @@ const multipleSelection = ref<[]>([])
const multipleSelectionObj: any = {}
const handleSelectionChange = (val) => {
console.log(val)
// console.log(val, 'val-')
multipleSelectionObj[da.deptId] = val
multipleSelection.value = uniqBy(Object.values(multipleSelectionObj).flat(), 'userId')
}
@ -210,7 +211,7 @@ const addGroupList = () => {
showModal2.value = true
}
const deleteGroupp = (i: any) => {
console.log(i)
// console.log(i)
deleteGroups(i.id)
}
async function deleteGroups(id) {

View File

@ -7,19 +7,11 @@ import { useChart21 } from './Quality'
import { useUserStore } from '@/stores/modules/user'
import { NModal, useMessage } from 'naive-ui'
import Amtion from '@/components/amtion.vue'
import {
topList,
actList,
highList,
badartList,
topStat
} from '@/api/daikin/base'
import { topList, actList, highList, badartList, topStat } from '@/api/daikin/base'
import { isNotOneWeekAgo } from '@/utils'
// import { it } from "element-plus/es/locale/index.js";
const store = useUserStore()
const userCode = ['admin', 'quality_dangdan', 'tech_service'].includes(
store.user.roleCode
)
const userCode = ['admin', 'quality_dangdan', 'tech_service'].includes(store.user.roleCode)
const message = useMessage()
// console.log(userCode);
const dataA = ref([])
@ -167,7 +159,11 @@ const value1 = ref(null)
const src = ref('')
const srcType = ref()
const showModalRef2 = ref(false)
const openUrl = async (url) => {
const openUrl = async (row: any) => {
if (row.isSelect === 2) {
return message.info('您没有权限查看!')
}
let url = row.filePath || row.filePathList[0].url
console.log(url)
if (!url) {
@ -175,30 +171,19 @@ const openUrl = async (url) => {
return
}
srcType.value = getLastSubstring(url)
if (
['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'pdf'].includes(srcType.value)
) {
if (['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'pdf'].includes(srcType.value)) {
// src.value = filePath
// pdfShow.value = true
url = 'https://view.xdocin.com/view?src=' + url
const _url = 'https://view.xdocin.com/view?src=' + url
const screenWidth = window.screen.width
const screenHeight = window.screen.height
window.open(
url,
_url,
'',
'width=' +
screenWidth +
',height=' +
screenHeight +
',top=' +
0 +
',left=' +
0
'width=' + screenWidth + ',height=' + screenHeight + ',top=' + 0 + ',left=' + 0
)
} else {
message.error(
"文件格式不是 'doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx','pdf'"
)
message.error("文件格式不是 'doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx','pdf'")
}
}
function getLastSubstring(str: string): string {
@ -278,7 +263,7 @@ function getLastSubstring(str: string): string {
<span
v-if="row.filePathList.length > 0"
class="text-#5695FF underline text-16px truncate"
@click="openUrl(row.filePathList[0].url)"
@click="openUrl(row)"
>{{ row.filePathList[0].originalFileName }}</span
>
<el-dropdown
@ -287,9 +272,7 @@ function getLastSubstring(str: string): string {
v-if="row.filePathList.length > 1"
>
<span class="el-dropdown-link mt5px">
<el-icon color="#097BC2" class="el-icon--right"
><CaretBottom
/></el-icon>
<el-icon color="#097BC2" class="el-icon--right"><CaretBottom /></el-icon>
</span>
<template #dropdown>
<el-dropdown-menu>
@ -391,9 +374,7 @@ function getLastSubstring(str: string): string {
<div class="flex flex-wrap">
<div class="h400px relative">
<div class="box-title">品质情报</div>
<div
class="absolute right-0px top-10px w165px text-14px text-#B2B7BE"
>
<div class="absolute right-0px top-10px w165px text-14px text-#B2B7BE">
{{ dataC.length > 0 ? '更新时间:' + dataC[0].createTime : '' }}
</div>
<div class="mt23px overflow-y-auto">
@ -432,16 +413,12 @@ function getLastSubstring(str: string): string {
</el-table-column>
<el-table-column prop="title" label="详情" width="110px" />
<el-table-column prop="source" label="来源" width="60px" />
<el-table-column
prop="createTime"
label="情报追踪"
width="120px"
>
<el-table-column prop="createTime" label="情报追踪" width="120px">
<template #default="{ row, $index }">
<span
v-if="row.filePathList.length > 0"
class="text-#5695FF underline text-16px w-80px truncate"
@click="openUrl(row.filePathList[0].url)"
@click="openUrl(row)"
>{{ row.filePathList[0].originalFileName }}</span
>
<el-dropdown
@ -450,9 +427,7 @@ function getLastSubstring(str: string): string {
v-if="row.filePathList.length > 1"
>
<span class="el-dropdown-link mt5px">
<el-icon color="#097BC2" class="el-icon--right"
><CaretBottom
/></el-icon>
<el-icon color="#097BC2" class="el-icon--right"><CaretBottom /></el-icon>
</span>
<template #dropdown>
<el-dropdown-menu>
@ -472,9 +447,7 @@ function getLastSubstring(str: string): string {
<div class="relative">
<div class="box-title mt30px">活动进展</div>
<div
class="absolute right-0 top-40px w165px text-14px text-#B2B7BE"
>
<div class="absolute right-0 top-40px w165px text-14px text-#B2B7BE">
{{ dataB.length > 0 ? '更新时间:' + dataB[0].createTime : '' }}
</div>
<div class="mt23px overflow-y-auto">
@ -514,16 +487,12 @@ function getLastSubstring(str: string): string {
</el-table-column>
<el-table-column prop="title" label="内容" width="150px" />
<el-table-column
prop="createTime"
label="活动追踪"
width="140px"
>
<el-table-column prop="createTime" label="活动追踪" width="140px">
<template #default="{ row, $index }">
<span
v-if="row.filePathList.length > 0"
class="text-#5695FF underline text-16px w-80px truncate"
@click="openUrl(row.filePathList[0].url)"
@click="openUrl(row)"
>{{ row.filePathList[0].originalFileName }}</span
>
<el-dropdown
@ -532,9 +501,7 @@ function getLastSubstring(str: string): string {
v-if="row.filePathList.length > 1"
>
<span class="el-dropdown-link mt5px">
<el-icon color="#097BC2" class="el-icon--right"
><CaretBottom
/></el-icon>
<el-icon color="#097BC2" class="el-icon--right"><CaretBottom /></el-icon>
</span>
<template #dropdown>
<el-dropdown-menu>

View File

@ -1,11 +1,28 @@
<script setup lang="ts">
import AppBlock from '@/components/AppBlock.vue'
import HomeHead from '@/views/home/components/HomeHead.vue'
import {formatDate} from '@/utils/format'
import { useMessage, NModal,NSelect} from 'naive-ui'
import { formatDate } from '@/utils/format'
import { useMessage, NModal, NSelect } from 'naive-ui'
import { useUserStore } from '@/stores/modules/user'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import { topList, actList, highList, badartList, topAdd, topDel, actAdd, highAdd, badartAdd, badartDel, highDel, actDel } from '@/api/daikin/base'
import {
topList,
actList,
highList,
badartList,
topAdd,
topDel,
actAdd,
highAdd,
badartAdd,
badartDel,
highDel,
actDel,
fetchdbAuthGetInfo,
badartGetUser,
badartAddUser
} from '@/api/daikin/base'
import UserList from '@/views/home/intelligence/process/UserPages.vue'
const message = useMessage()
const store = useUserStore()
const header = { 'token': store.user.token }
@ -22,7 +39,6 @@ const editC = ref()
const editD = ref()
const editE = ref()
const shomkA = ref(false)
const shomkB = ref(false)
const shomkC = ref(false)
@ -36,8 +52,8 @@ async function gettopList() {
dataA.value = _rowA.map((i: { filePathList: { name: any; originalFileName: any }[] }) => {
if (i.filePathList && i.filePathList.length > 0) {
i.filePathList.forEach((file: { name: any; originalFileName: any }) => {
file.name = file.originalFileName;
});
file.name = file.originalFileName
})
}
return i
})
@ -52,8 +68,8 @@ async function getbadartList() {
dataB.value = _rowB.map((i: { filePathList: { name: any; originalFileName: any }[] }) => {
if (i.filePathList && i.filePathList.length > 0) {
i.filePathList.forEach((file: { name: any; originalFileName: any }) => {
file.name = file.originalFileName;
});
file.name = file.originalFileName
})
}
return i
})
@ -68,8 +84,8 @@ async function getactList() {
dataD.value = _rowD.map((i: { filePathList: { name: any; originalFileName: any }[] }) => {
if (i.filePathList && i.filePathList.length > 0) {
i.filePathList.forEach((file: { name: any; originalFileName: any }) => {
file.name = file.originalFileName;
});
file.name = file.originalFileName
})
}
return i
})
@ -84,8 +100,8 @@ async function gethighList() {
dataC.value = _rowC.map((i: { filePathList: { name: any; originalFileName: any }[] }) => {
if (i.filePathList && i.filePathList.length > 0) {
i.filePathList.forEach((file: { name: any; originalFileName: any }) => {
file.name = file.originalFileName;
});
file.name = file.originalFileName
})
}
return i
})
@ -93,35 +109,52 @@ async function gethighList() {
}
onMounted(async () => {
getactList();
getbadartList();
gettopList();
gethighList();
getactList()
getbadartList()
gettopList()
gethighList()
})
async function onSubmitA(row: { filePathList?: any; id?: any; indexId?: any; title?: any; proportion?: any; partSum?: any; badSum?: any }) {
async function onSubmitA(row: {
filePathList?: any
id?: any
indexId?: any
title?: any
proportion?: any
partSum?: any
badSum?: any
}) {
console.log(row)
const { id, indexId, title, partSum, badSum,monthDate } = row
const { id, indexId, title, partSum, badSum, monthDate } = row
let filePathArr = []
if (row.fileList && row.fileList.length > 0) {
row.fileList.map(item => {
if (item.response) filePathArr.push(item.response.url);
else filePathArr.push(item.url);
row.fileList.map((item) => {
if (item.response) filePathArr.push(item.response.url)
else filePathArr.push(item.url)
})
}
let filePath = filePathArr.join(',')
const cate = cateValue.value
console.log(monthDate,formatDate(monthDate))
const time = formatDate(monthDate).substring(0,7)
const { code, msg } = await topAdd({ id, indexId, title, partSum, badSum, filePath,cate,monthDate:time})
if (code === 200) { message.success("修改成功!") }
else { message.error(msg) }
console.log(monthDate, formatDate(monthDate))
const time = formatDate(monthDate).substring(0, 7)
const { code, msg } = await topAdd({
id,
indexId,
title,
partSum,
badSum,
filePath,
cate,
monthDate: time
})
if (code === 200) {
message.success('修改成功!')
} else {
message.error(msg)
}
shomkA.value = false
gettopList();
gettopList()
}
async function onSubmitB(row: { filePathList?: any; id?: any; cate?: any; title?: any }) {
@ -129,19 +162,22 @@ async function onSubmitB(row: { filePathList?: any; id?: any; cate?: any; title?
let filePathArr = []
if (row.fileList && row.fileList.length > 0) {
row.fileList.map(item => {
if (item.response) filePathArr.push(item.response.url);
else filePathArr.push(item.url);
row.fileList.map((item) => {
if (item.response) filePathArr.push(item.response.url)
else filePathArr.push(item.url)
})
}
let filePath = filePathArr.join(',')
const { code, msg } = await badartAdd({ id, cate, title, filePath })
if (code === 200) { message.success("修改成功!") }
else { message.error(msg) }
if (code === 200) {
message.success('修改成功!')
} else {
message.error(msg)
}
shomkB.value = false
getbadartList();
getbadartList()
}
async function onSubmitC(row: { filePathList?: any; id?: any; source?: any; title?: any }) {
@ -150,16 +186,17 @@ async function onSubmitC(row: { filePathList?: any; id?: any; source?: any; titl
let filePathArr = []
if (row.fileList && row.fileList.length > 0) {
row.fileList.map(item => {
if (item.response) filePathArr.push(item.response.url);
else filePathArr.push(item.url);
row.fileList.map((item) => {
if (item.response) filePathArr.push(item.response.url)
else filePathArr.push(item.url)
})
}
let filePath = filePathArr.join(',')
const { code, msg } = await highAdd({ id, source, title, filePath })
if (code === 200) { message.success("修改成功!") }
else message.error(msg)
if (code === 200) {
message.success('修改成功!')
} else message.error(msg)
shomkC.value = false
gethighList()
}
@ -169,41 +206,38 @@ async function onSubmitD(row: { filePathList?: any; id?: any; title?: any }) {
let filePathArr = []
if (row.fileList && row.fileList.length > 0) {
row.fileList.map(item => {
if (item.response) filePathArr.push(item.response.url);
else filePathArr.push(item.url);
row.fileList.map((item) => {
if (item.response) filePathArr.push(item.response.url)
else filePathArr.push(item.url)
})
}
let filePath = filePathArr.join(',')
const { code, msg } = await actAdd({ id, title, filePath })
if (code === 200) { message.success("修改成功!") }
else {
if (code === 200) {
message.success('修改成功!')
} else {
message.error(msg)
}
shomkD.value = false
getactList()
}
const handleEditA = (index: number, row: any) => {
if (row && row.filePathList) {
if (row.filePathList.length > 0) {
if (row.filePathList && row.filePathList.length > 0) {
row.filePathList.forEach((file: { name: any; originalFileName: any }) => {
file.name = file.originalFileName;
});
file.name = file.originalFileName
})
row.fileList = row.filePathList
}
}
else if (row.files && row.files.length > 0) {
row.files.map(i => {
} else if (row.files && row.files.length > 0) {
row.files.map((i) => {
i.url = i.response.url
})
}
}
else {
} else {
editA.value = {
indexId: '',
title: '',
@ -211,7 +245,7 @@ const handleEditA = (index: number, row: any) => {
partSum: '',
badSum: '',
fileList: [],
monthDate:''
monthDate: ''
}
}
shomkA.value = true
@ -221,21 +255,18 @@ const handleEditA = (index: number, row: any) => {
const handleEditB = (index: number, row: any) => {
if (row && row.filePathList) {
if (row.filePathList.length > 0) {
if (row.filePathList && row.filePathList.length > 0) {
row.filePathList.forEach((file: { name: any; originalFileName: any }) => {
file.name = file.originalFileName;
});
file.name = file.originalFileName
})
row.fileList = row.filePathList
}
}
else if (row.files && row.files.length > 0) {
row.files.map(i => {
} else if (row.files && row.files.length > 0) {
row.files.map((i) => {
i.url = i.response.url
})
}
}
else {
} else {
editB.value = {
title: '',
cate: '',
@ -249,25 +280,22 @@ const handleEditB = (index: number, row: any) => {
const handleEditC = (index: number, row: any) => {
if (row && row.filePathList) {
if (row.filePathList.length > 0) {
if (row.filePathList && row.filePathList.length > 0) {
row.filePathList.forEach((file: { name: any; originalFileName: any }) => {
file.name = file.originalFileName;
});
file.name = file.originalFileName
})
row.fileList = row.filePathList
}
}
else if (row.files && row.files.length > 0) {
row.files.map(i => {
} else if (row.files && row.files.length > 0) {
row.files.map((i) => {
i.url = i.response.url
})
}
}
else {
} else {
editC.value = {
title: '',
source: '',
fileList: [],
fileList: []
}
}
shomkC.value = true
@ -277,25 +305,22 @@ const handleEditC = (index: number, row: any) => {
const handleEditD = (index: number, row: any) => {
if (row && row.filePathList) {
if (row.filePathList.length > 0) {
if (row.filePathList && row.filePathList.length > 0) {
row.filePathList.forEach((file: { name: any; originalFileName: any }) => {
file.name = file.originalFileName;
});
file.name = file.originalFileName
})
row.fileList = row.filePathList
}
}
else if (row.files && row.files.length > 0) {
row.files.map(i => {
} else if (row.files && row.files.length > 0) {
row.files.map((i) => {
i.url = i.response.url
})
}
}
else {
} else {
editD.value = {
title: '',
source: '',
fileList: [],
fileList: []
}
}
shomkD.value = true
@ -303,59 +328,105 @@ const handleEditD = (index: number, row: any) => {
editD.value = row
}
async function handleDeleteA(index: number, row: any) {
const { id } = row
if (!id) return
const { code, msg } = await topDel({ id })
if (code === 200) { message.success("删除成功!") }
else { message.error(msg) }
gettopList();
if (code === 200) {
message.success('删除成功!')
} else {
message.error(msg)
}
gettopList()
}
async function handleDeleteB(index: number, row: any) {
const { id } = row
if (!id) return
const { code, msg } = await badartDel({ id })
if (code === 200) { message.success("删除成功!") }
else { message.error(msg) }
if (code === 200) {
message.success('删除成功!')
} else {
message.error(msg)
}
getbadartList();
getbadartList()
}
async function handleDeleteC(index: number, row: any) {
const { id } = row
if (!id) return
const { code, msg } = await highDel({ id })
if (code === 200) { message.success("删除成功!") }
else { message.error(msg) }
if (code === 200) {
message.success('删除成功!')
} else {
message.error(msg)
}
gethighList()
}
async function handleDeleteD(index: number, row: any) {
const { id } = row
if (!id) return
const { code, msg } = await actDel({ id })
if (code === 200) { message.success("删除成功!") }
else { message.error(msg) }
getactList();
if (code === 200) {
message.success('删除成功!')
} else {
message.error(msg)
}
getactList()
}
const optt = ref([
{
lable:'新品',
id:'1'
lable: '新品',
id: '1'
},
{
lable:'累进变更品',
id:'2'
lable: '累进变更品',
id: '2'
},
{
lable:'现行品',
id:'3'
lable: '现行品',
id: '3'
}
])
const activeName = ref("first")
const activeName = ref('first')
const cateValue = ref('新品')
const showModal = ref(false)
const userData = ref(false)
const flg = ref<any>({})
const setUserList = ref<any>([])
const selIndex = ref(0) // 1- 2- 3- 4-
async function getUser(indexId: any) {
showModal.value = !showModal.value
if (typeof indexId === 'number') {
selIndex.value = indexId
const { data: userArr } = await badartGetUser({
indexId
})
setUserList.value = userArr
}
}
const handleChild = async (data: any) => {
const { showModal: show, multipleSelection } = data
showModal.value = unref(show) || false
let userIdList: any[] = []
multipleSelection.value.forEach((i: { userId: any; nickName: string }) => {
userIdList.push(i.userId)
})
if (userIdList.length > 0) {
const res = await badartAddUser({
indexId: selIndex.value,
userIdList
})
if (res.code == 200) {
message.success('设置成功!')
}
}
}
const CloseThiss = (data: any) => {
showModal.value = data
}
</script>
<template>
<HomeHead class="top">
@ -368,20 +439,28 @@ const cateValue = ref('新品')
<!-- <img src="./images/logo.svg" class="h56px mr21px" /> -->
<div class="text-36px text-#000">品质内容管理</div>
</div>
<el-tabs type="card" v-model="activeName" class="demo-tabs mt30px text-20px" @tab-click="handleClick">
<el-tabs type="card" v-model="activeName" class="demo-tabs mt30px text-20px" @tab-click="">
<el-tab-pane name="first">
<template #label>
<span class="custom-tabs-label">
<span class="text-20px">不良情报模块</span>
</span>
</template>
<div class=" cont relative w100% h800px overflow-y-auto">
<div class="cont relative w100% h800px overflow-y-auto">
<el-button type="primary" @click="handleEditB" class="my20px">不良情报新增</el-button>
<el-table :data="dataB" style="width: 95%"
:header-cell-style="{ background: '#2A7BF7', color: '#fff', height: '60px', textAlign: 'center', 'font-size': '24px' }"
:cell-style="{ 'text-align': 'center', 'font-size': '16px' }">
<el-button type="primary" @click="getUser(3)" class="my20px">查看范围</el-button>
<el-table
:data="dataB"
style="width: 95%"
:header-cell-style="{
background: '#2A7BF7',
color: '#fff',
height: '60px',
textAlign: 'center',
'font-size': '24px'
}"
:cell-style="{ 'text-align': 'center', 'font-size': '16px' }"
>
<el-table-column label="时间" prop="createTime" />
<el-table-column label="类别" prop="cate" />
<el-table-column label="详情" prop="title" />
@ -391,12 +470,18 @@ const cateValue = ref('新品')
{{ it.name }}
</div>
</template>
</el-table-column>
<el-table-column label="操作" width="180px">
<template #default="scope">
<el-button size="small" @click="handleEditB(scope.$index, scope.row)">编辑</el-button>
<el-button size="small" type="danger" @click="handleDeleteB(scope.$index, scope.row)">删除</el-button>
<el-button size="small" @click="handleEditB(scope.$index, scope.row)"
>编辑</el-button
>
<el-button
size="small"
type="danger"
@click="handleDeleteB(scope.$index, scope.row)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
@ -411,9 +496,19 @@ const cateValue = ref('新品')
</template>
<div>
<el-button type="primary" @click="handleEditA" class="my20px">不良统计新增</el-button>
<el-table :data="dataA" style="width: 95%"
:header-cell-style="{ background: '#2A7BF7', color: '#fff', height: '60px', textAlign: 'center', 'font-size': '24px' }"
:cell-style="{ 'text-align': 'center' , 'font-size': '16px'}">
<el-button type="primary" @click="getUser(2)" class="my20px">查看范围</el-button>
<el-table
:data="dataA"
style="width: 95%"
:header-cell-style="{
background: '#2A7BF7',
color: '#fff',
height: '60px',
textAlign: 'center',
'font-size': '24px'
}"
:cell-style="{ 'text-align': 'center', 'font-size': '16px' }"
>
<el-table-column label="时间" prop="monthDate" width="180px" />
<el-table-column label="供应商" prop="indexId" width="220px" />
<!-- <el-table-column label="计件数" prop="partSum" width="150px"/>
@ -431,8 +526,15 @@ const cateValue = ref('新品')
</el-table-column> -->
<el-table-column label="操作" width="180px">
<template #default="scope">
<el-button size="small" @click="handleEditA(scope.$index, scope.row)">编辑</el-button>
<el-button size="small" type="danger" @click="handleDeleteA(scope.$index, scope.row)">删除</el-button>
<el-button size="small" @click="handleEditA(scope.$index, scope.row)"
>编辑</el-button
>
<el-button
size="small"
type="danger"
@click="handleDeleteA(scope.$index, scope.row)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
@ -442,16 +544,25 @@ const cateValue = ref('新品')
<el-tab-pane name="third">
<template #label>
<span class="custom-tabs-label">
<span class="text-20px">品质情报模块</span>
</span>
</template>
<div>
<el-button type="primary" @click="handleEditC" class="my20px">品质情报新增</el-button>
<el-table :data="dataC" style="width: 95%"
:header-cell-style="{ background: '#2A7BF7', color: '#fff', height: '60px', textAlign: 'center', 'font-size': '24px' }"
:cell-style="{ 'text-align': 'center' , 'font-size': '16px'}">
<el-button type="primary" @click="getUser(4)" class="my20px">查看范围</el-button>
<el-table
:data="dataC"
style="width: 95%"
:header-cell-style="{
background: '#2A7BF7',
color: '#fff',
height: '60px',
textAlign: 'center',
'font-size': '24px'
}"
:cell-style="{ 'text-align': 'center', 'font-size': '16px' }"
>
<el-table-column label="时间" prop="createTime" />
<el-table-column label="详情" prop="title" />
<el-table-column label="来源" prop="source" />
@ -461,12 +572,18 @@ const cateValue = ref('新品')
{{ it.name }}
</div>
</template>
</el-table-column>
<el-table-column label="操作" width="180px">
<template #default="scope">
<el-button size="small" @click="handleEditC(scope.$index, scope.row)">编辑</el-button>
<el-button size="small" type="danger" @click="handleDeleteC(scope.$index, scope.row)">删除</el-button>
<el-button size="small" @click="handleEditC(scope.$index, scope.row)"
>编辑</el-button
>
<el-button
size="small"
type="danger"
@click="handleDeleteC(scope.$index, scope.row)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
@ -481,11 +598,19 @@ const cateValue = ref('新品')
</template>
<div>
<el-button type="primary" @click="handleEditD" class="my20px">活动进展新增</el-button>
<el-table :data="dataD" style="width: 95%"
:header-cell-style="{ background: '#2A7BF7', color: '#fff', height: '60px', textAlign: 'center', 'font-size': '24px' }"
:cell-style="{ 'text-align': 'center' , 'font-size': '16px'}">
<el-button type="primary" @click="getUser(1)" class="my20px">查看范围</el-button>
<el-table
:data="dataD"
style="width: 95%"
:header-cell-style="{
background: '#2A7BF7',
color: '#fff',
height: '60px',
textAlign: 'center',
'font-size': '24px'
}"
:cell-style="{ 'text-align': 'center', 'font-size': '16px' }"
>
<el-table-column label="时间" prop="createTime" />
<el-table-column label="详情" prop="title" />
<el-table-column label="活动追踪" prop="filePathList">
@ -494,56 +619,69 @@ const cateValue = ref('新品')
{{ it.name }}
</div>
</template>
</el-table-column>
<el-table-column label="操作" width="180px">
<template #default="scope">
<el-button size="small" @click="handleEditD(scope.$index, scope.row)">编辑</el-button>
<el-button size="small" type="danger" @click="handleDeleteD(scope.$index, scope.row)">删除</el-button>
<el-button size="small" @click="handleEditD(scope.$index, scope.row)"
>编辑</el-button
>
<el-button
size="small"
type="danger"
@click="handleDeleteD(scope.$index, scope.row)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
</div>
</el-tab-pane>
</el-tabs>
<el-form-item>
</el-form-item>
<el-form-item> </el-form-item>
</AppBlock>
<n-modal v-model:show="shomkA">
<div class="bg-#FFF p30px">
<el-form :model="editA" label-width="120px" :inline="true">
<el-form-item label="时间">
<el-config-provider :locale="locale">
<el-date-picker v-model="editA.monthDate" type="month" placeholder="时间选择" size="large" />
<el-date-picker
v-model="editA.monthDate"
type="month"
placeholder="时间选择"
size="large"
/>
</el-config-provider>
</el-form-item>
<br>
<br />
<el-form-item label="供应商">
<el-input v-model="editA.indexId" />
</el-form-item>
<br>
<br />
<el-form-item label="数量">
<el-input v-model="editA.partSum" type="number" min="0" />
</el-form-item>
<br>
<br />
<el-form-item label="类型">
<n-select class="w220px" size="large" v-if="optt" :show-arrow="false" :show-checkmark="false" v-model:value="cateValue" :options="optt"
value-field="lable" label-field="lable" />
<n-select
class="w220px"
size="large"
v-if="optt"
:show-arrow="false"
:show-checkmark="false"
v-model:value="cateValue"
:options="optt"
value-field="lable"
label-field="lable"
/>
</el-form-item>
<br>
<br>
<br />
<br />
<el-form-item label="详情">
<el-input type="textarea" v-model="editA.title" />
</el-form-item>
<br>
<br />
<!-- <el-form-item label="不良内容">
<el-upload v-model:file-list="editA.fileList" class="upload-demo" :headers="header"
action="/test-api/common/upload" multiple>
@ -552,7 +690,7 @@ const cateValue = ref('新品')
</el-upload>
</el-form-item> -->
</el-form>
<hr class="mb15px border-#f1f1f1">
<hr class="mb15px border-#f1f1f1" />
<el-button class="flex-center" type="primary" @click="onSubmitA(editA)"></el-button>
</div>
@ -564,20 +702,24 @@ const cateValue = ref('新品')
<el-input v-model="editB.title" />
</el-form-item>
<br>
<br />
<el-form-item label="类别">
<el-input v-model="editB.cate" />
</el-form-item>
<br>
<br />
<el-form-item label="文件">
<el-upload v-model:file-list="editB.fileList" class="upload-demo" :headers="header"
action="/test-api/common/upload" multiple>
<el-upload
v-model:file-list="editB.fileList"
class="upload-demo"
:headers="header"
action="/test-api/common/upload"
multiple
>
<el-button type="primary">选择文件</el-button>
</el-upload>
</el-form-item>
</el-form>
<hr class="mb15px border-#f1f1f1">
<hr class="mb15px border-#f1f1f1" />
<el-button class="flex-center" type="primary" @click="onSubmitB(editB)"></el-button>
</div>
@ -585,26 +727,28 @@ const cateValue = ref('新品')
<n-modal v-model:show="shomkC">
<div class="bg-#FFF p30px">
<el-form :model="editC" label-width="120px" :inline="true">
<el-form-item label="详情">
<el-input v-model="editC.title" />
</el-form-item>
<br>
<br />
<el-form-item label="来源">
<el-input v-model="editC.source" />
</el-form-item>
<br>
<br />
<el-form-item label="文件">
<el-upload v-model:file-list="editC.fileList" class="upload-demo" :headers="header"
action="/test-api/common/upload">
<el-upload
v-model:file-list="editC.fileList"
class="upload-demo"
:headers="header"
action="/test-api/common/upload"
>
<el-button type="primary">选择文件</el-button>
</el-upload>
</el-form-item>
</el-form>
<hr class="mb15px border-#f1f1f1">
<hr class="mb15px border-#f1f1f1" />
<el-button class="flex-center" type="primary" @click="onSubmitC(editC)"></el-button>
</div>
@ -615,25 +759,31 @@ const cateValue = ref('新品')
<el-form-item label="详情">
<el-input v-model="editD.title" />
</el-form-item>
<br>
<br />
<el-form-item label="文件">
<el-upload v-model:file-list="editD.fileList" class="upload-demo" :headers="header"
action="/test-api/common/upload" multiple>
<el-upload
v-model:file-list="editD.fileList"
class="upload-demo"
:headers="header"
action="/test-api/common/upload"
multiple
>
<el-button type="primary">选择文件</el-button>
</el-upload>
</el-form-item>
</el-form>
<hr class="mb15px border-#f1f1f1">
<hr class="mb15px border-#f1f1f1" />
<el-button class="flex-center" type="primary" @click="onSubmitD(editD)"></el-button>
</div>
</n-modal>
<n-modal v-model:show="showModal" :z-index="99999">
<UserList :userDataList="setUserList" @clickChild="handleChild" @CloseThis="CloseThiss" />
</n-modal>
</template>
<style lang="less">
.demo-tabs>.el-tabs__content {
.demo-tabs > .el-tabs__content {
color: #6b778c;
font-size: 32px;
font-weight: 600;