Merge pull request 'wxy' (#30) from wxy into master

Reviewed-on: http://git.feashow.cn/feashow/SmartOpsWeb/pulls/30
This commit is contained in:
springlog
2024-09-14 15:52:32 +00:00
7 changed files with 234 additions and 108 deletions

View File

@@ -1,2 +1,2 @@
# 开发环境基地址 # 开发环境基地址
VITE_BASE_URL='/api' VITE_BASE_URL='http://frp.feashow.cn:31800/'

40
src/api/order/order.js Normal file
View File

@@ -0,0 +1,40 @@
import request from '@/utils/request.js'
export const orderGetList=(params)=>{
return request({
url:'/order/list',
method:'get',
params
})
}
export const orderGetDetails =(params)=>{
return request({
url:`/order/info/${params}`,
method:'get'
})
}
export const orderAdd=(data)=>{
return request({
url:'/order/create',
method:'post',
data
})
}
export const orderdDetele =(params)=>{
return request({
url:`/order/delete/${params}`,
method:'delete'
})
}
export const orderdClose =(params)=>{
return request({
url:`/order/${params}`,
method:'post'
})
}

View File

@@ -4,6 +4,7 @@ import { ElMessage, ElMessageBox } from "element-plus";
import { getToken, removeToken } from "./auth"; import { getToken, removeToken } from "./auth";
axios.defaults.headers['Content-Type']='application/json' axios.defaults.headers['Content-Type']='application/json'
console.log(import.meta.env.VITE_BASE_URL);
const serveice = axios.create({ const serveice = axios.create({
baseURL: import.meta.env.VITE_BASE_URL, baseURL: import.meta.env.VITE_BASE_URL,

View File

@@ -2,15 +2,17 @@
<fvSearchForm :searchConfig="searchConfig" @search="search"> <fvSearchForm :searchConfig="searchConfig" @search="search">
</fvSearchForm> </fvSearchForm>
<fvTable ref="tableIns" :tableConfig="tableConfig" :data="mockData" @headBtnClick="headBtnClick"></fvTable> <fvTable ref="tableIns" :tableConfig="tableConfig" :data="mockData" @headBtnClick="headBtnClick"></fvTable>
<WorkDialog ref="workDialogRef"></WorkDialog> <WorkDialog ref="workDialogRef" :rowData="rowData" />
</template> </template>
<script setup lang="jsx"> <script setup lang="jsx">
import { shallowRef } from 'vue'; import { isShallow, reactive, shallowRef } from 'vue';
import fvSelect from '@/fvcomponents/fvSelect/index.vue' import fvSelect from '@/fvcomponents/fvSelect/index.vue'
import WorkDialog from '../components/WorkDialog.vue'; import WorkDialog from '../components/WorkDialog.vue';
import { orderdDetele, orderdClose, orderAdd } from "@/api/order/order.js"
const rowData = ref()
const isShow = ref(false)
const workDialogRef = ref() const workDialogRef = ref()
const router = useRouter() const router = useRouter()
const tableIns = ref() const tableIns = ref()
@@ -119,22 +121,25 @@ const tableConfig = reactive({
width: 80, width: 80,
}, },
{ {
prop: 'workOrderNumber', prop: 'orderNumber',
label: '工单号', label: '工单号',
align: 'center' align: 'center',
width: 200
}, },
{ {
prop: 'workOrderNumber', prop: 'siteName',
label: '工单名称', label: '工单名称',
align: 'center' align: 'center',
width: 200
}, },
{ {
prop: 'workOrderNumber', prop: 'orderContent',
label: '工单内容', label: '工单内容',
align: 'center' align: 'center',
width: 200
}, },
{ {
prop: 'state', prop: 'orderState',
label: '工单状态', label: '工单状态',
align: 'center', align: 'center',
showOverflowTooltip: false, showOverflowTooltip: false,
@@ -160,29 +165,29 @@ const tableConfig = reactive({
} }
}, },
{ {
prop: 'workOrderNumber', prop: 'operationUser',
label: '处理人', label: '处理人',
align: 'center' align: 'center'
}, },
{ {
prop: 'workOrderNumber', prop: 'processedContent',
label: '处理内容', label: '处理内容',
align: 'center' align: 'center'
}, },
{ {
prop: 'workOrderTime', prop: 'createTime',
label: '创建时间', label: '创建时间',
align: 'center', align: 'center',
width: 200 width: 200
}, },
{ {
prop: 'workOrderTime', prop: 'processedTime',
label: '处理时间', label: '处理时间',
align: 'center', align: 'center',
width: 200 width: 200
}, },
{ {
prop: 'workOrderTime', prop: 'completionTime',
label: '完成时间', label: '完成时间',
align: 'center', align: 'center',
width: 200 width: 200
@@ -195,6 +200,8 @@ const tableConfig = reactive({
width: 150, width: 150,
showOverflowTooltip: false, showOverflowTooltip: false,
currentRender: ({ row, index }) => { currentRender: ({ row, index }) => {
// console.log(row);
let btn = [] let btn = []
btn.push({ label: '详情', prem: auths.detail, func: () => handleDetail(row), type: 'primary' }) btn.push({ label: '详情', prem: auths.detail, func: () => handleDetail(row), type: 'primary' })
btn.push({ label: '关单', prem: auths.detail, func: () => handleClose(row), type: 'primary' }) btn.push({ label: '关单', prem: auths.detail, func: () => handleClose(row), type: 'primary' })
@@ -218,14 +225,14 @@ const tableConfig = reactive({
} }
} }
], ],
api: '', api: '/order/list',
params: {}, params: {},
btns: [ btns: [
// {name: '新增', key: 'add', color: '#DED0B2', auth: auths.report}, // {name: '新增', key: 'add', color: '#DED0B2', auth: auths.report},
] ]
}) })
const headBtnClick = (key) => { const headBtnClick = (key) => {
console.log(key); // console.log(key);
switch (key) { switch (key) {
case 'add': case 'add':
@@ -236,9 +243,12 @@ const headBtnClick = (key) => {
const handleDetail = (row) => { const handleDetail = (row) => {
workDialogRef.value.open(row) workDialogRef.value.open(row)
rowData.value = row
} }
const handleClose = (row) => { const handleClose = async (row) => {
// console.log(row.orderNumber);
ElMessageBox.confirm( ElMessageBox.confirm(
'确定要关单吗?', '确定要关单吗?',
'温馨提示', '温馨提示',
@@ -248,7 +258,8 @@ const handleClose = (row) => {
type: 'warning', type: 'warning',
} }
) )
.then(() => { .then(async () => {
await orderdClose(row.orderNumber)
ElMessage({ ElMessage({
type: 'success', type: 'success',
message: '关闭成功', message: '关闭成功',
@@ -262,7 +273,8 @@ const handleClose = (row) => {
}) })
} }
const handleDelete = (row) => { const handleDelete = async (row) => {
ElMessageBox.confirm( ElMessageBox.confirm(
'确定要删除吗?', '确定要删除吗?',
'温馨提示', '温馨提示',
@@ -272,7 +284,8 @@ const handleDelete = (row) => {
type: 'warning', type: 'warning',
} }
) )
.then(() => { .then(async () => {
await orderdDetele(row.orderNumber)
ElMessage({ ElMessage({
type: 'success', type: 'success',
message: '删除成功', message: '删除成功',

View File

@@ -1,15 +1,56 @@
<script setup> <script setup>
import { ref } from "vue"; import { onMounted, reactive, ref, watch } from "vue";
import { ElMessageBox } from "element-plus"; import { ElMessageBox } from "element-plus";
import { MoreFilled } from "@element-plus/icons-vue"; import { MoreFilled } from "@element-plus/icons-vue";
import { time } from "echarts"; import { time } from "echarts";
import { defineExpose } from "vue";
import { defineProps } from "vue";
import { orderGetDetails } from "@/api/order/order.js"
//控制显示隐藏 //控制显示隐藏
const dialogVisible = ref(false); const dialogVisible = ref(false);
const props = defineProps({
rowData: Object
})
let dataDetails = {};
let opsCallList = {};
const open = (row) => { const open = (row) => {
dialogVisible.value = true; dialogVisible.value = true;
console.log(row);
}; };
const getData = async () => {
console.log(123);
const data = await orderGetDetails(props.rowData.orderNumber)
// console.log("111", data);
return data
}
watch(() => props.rowData, (newRowData) => {
if (newRowData) {
// console.log(getData(newRowData));
getData(newRowData).then((data) => {
// console.log(data.data);
dataDetails = data.data
console.log(dataDetails.value);
opsCallList = dataDetails.opsCallList
console.log(opsCallList);
})
}
}, {
immediate: true // 立即执行一次以便在rowData初始值非空时也能触发
});
// getData()
const test = [ const test = [
{ {
content: "待处理", content: "待处理",
@@ -58,10 +99,12 @@ const data = [
state: '已接通', state: '已接通',
time: '18 : 32', time: '18 : 32',
}] }]
defineExpose({ defineExpose({
open, open,
}); });
</script> </script>
<template> <template>
@@ -70,7 +113,7 @@ defineExpose({
<div class="common-layout"> <div class="common-layout">
<el-container> <el-container>
<el-header class="header"><span>工单号 :</span> <el-header class="header"><span>工单号 :</span>
<span>666</span> <span>{{ rowData.orderNumber }}</span>
</el-header> </el-header>
<el-container class="main-container"> <el-container class="main-container">
<el-aside width="200px" :style="{ position: 'static' }"> <el-aside width="200px" :style="{ position: 'static' }">
@@ -79,7 +122,7 @@ defineExpose({
<el-timeline-item v-for="(activity, index) in test" :key="index" :icon="activity.icon" <el-timeline-item v-for="(activity, index) in test" :key="index" :icon="activity.icon"
:type="activity.type" :color="activity.color" :size="activity.size" :type="activity.type" :color="activity.color" :size="activity.size"
:hollow="activity.hollow" :timestamp="activity.timestamp"> :hollow="activity.hollow" :timestamp="activity.timestamp">
{{ activity.content }} <p style="font-size: 17px;"> {{ activity.content }}</p>
</el-timeline-item> </el-timeline-item>
</el-timeline> </el-timeline>
</div> </div>
@@ -87,28 +130,28 @@ defineExpose({
<el-main :style="{ position: 'static' }" class="main-content"> <el-main :style="{ position: 'static' }" class="main-content">
<div class="top"> <div class="top">
<div class="info"> <div class="info">
<span>创始人 :</span> <span>创始人 : {{ rowData.createBy }}</span>
<span>处理人 :</span> <span>处理人 :{{ rowData.operationUser }}</span>
</div> </div>
<div class="info"> <div class="info">
<span>工单名称 :</span> <span>工单名称 :{{ rowData.siteName }}</span>
<span>关单人 :</span> <span>关单人 :{{ rowData.knotter }}</span>
</div> </div>
</div> </div>
<div class="body"> <div class="body">
<div> <div>
<div>工单内容 :</div> <div>工单内容 :</div>
<div class="text"></div> <div class="text">{{ rowData.orderContent }}</div>
</div> </div>
<div> <div>
<div>工单内容 :</div> <div>处理内容 :</div>
<div class="text"></div> <div class="text">{{ rowData.processedContent }}</div>
</div> </div>
<div> <div>
<div>工单内容 :</div> <div>录音信息 :</div>
<div class="text"></div> <div class="text">{{ rowData.recordUrl }}</div>
</div> </div>
</div> </div>
@@ -118,18 +161,23 @@ defineExpose({
<div> <div>
<el-scrollbar height="20vh"> <el-scrollbar height="20vh">
<el-timeline style="max-width: 99%" class="timeline"> <el-timeline style="max-width: 99%" class="timeline">
<el-timeline-item v-for="(activity, index) in test2" :key="index" <el-timeline-item v-for="(activity, index) in opsCallList" :key="index"
:icon="activity.icon" :type="activity.type" :color="activity.color" :icon="activity.icon" :type="activity.type" :color="activity.color"
:size="activity.size"> :size="activity.size">
<div class="custom-card"> <div class="custom-card">
<div>{{ activity.date }}</div> <div>{{ activity.createTime }}</div>
<div v-for="(info, index) in data" :key="index"> <!-- <div v-for="(info, index) in data" :key="index"> -->
<div> <div>
<span :style="{color:'#a8abb2'}">{{ info.number }}</span> <span :style="{ color: '#a8abb2' }">{{ activity.callIdNumber
<span :style="{ color: info.state === '通话中' ? '#6cc23a' : '#409eff' }">{{ info.state }}</span> }}</span>
<span class="span-3th" :style="{color:'#a8abb2'}">{{ info.time }}</span> <span :style="{
</div> color: activity.callState
=== '通话中' ? '#6cc23a' : '#409eff'
}">{{ activity.callState }}</span>
<span class="span-3th" :style="{ color: '#a8abb2' }">{{
activity.answer_time }}</span>
</div> </div>
<!-- </div> -->
</div> </div>
</el-timeline-item> </el-timeline-item>
</el-timeline> </el-timeline>
@@ -172,7 +220,8 @@ defineExpose({
.main-content .info { .main-content .info {
border-bottom: 1.5px solid #e4e7ed; border-bottom: 1.5px solid #e4e7ed;
margin-bottom: 50px margin-bottom: 50px;
font-size: 17px;
} }
.main-content .body { .main-content .body {
@@ -209,18 +258,19 @@ defineExpose({
position: relative; position: relative;
left: 3px; left: 3px;
// background-color: red; // background-color: red;
} }
.custom-card{ .custom-card {
width: 100%; width: 100%;
font-size: 16px; font-size: 16px;
} }
.custom-card span { .custom-card span {
padding-top: 10px; padding-top: 10px;
width: 20%; width: 20%;
margin: 2px; margin: 2px;
} }
.custom-card .span-3th { .custom-card .span-3th {

View File

@@ -1,17 +1,18 @@
<template> <template>
<fvSearchForm :searchConfig="searchConfig" @search="search"> <fvSearchForm :searchConfig="searchConfig" @search="search">
<FvSelect></FvSelect>
</fvSearchForm> </fvSearchForm>
<fvTable ref="tableIns" :tableConfig="tableConfig" :data="mockData" @headBtnClick="headBtnClick"></fvTable> <fvTable ref="tableIns" :tableConfig="tableConfig" :data="mockData" @headBtnClick="headBtnClick"></fvTable>
<WorkDialog ref="workDialogRef"></WorkDialog> <WorkDialog ref="workDialogRef" :rowData="rowData" />
</template> </template>
<script setup lang="jsx"> <script setup lang="jsx">
import { shallowRef } from 'vue'; import { isShallow, reactive, shallowRef } from 'vue';
import fvSelect from '@/fvcomponents/fvSelect/index.vue' import fvSelect from '@/fvcomponents/fvSelect/index.vue'
import WorkDialog from '../components/WorkDialog.vue'; import WorkDialog from '../components/WorkDialog.vue';
import { orderdDetele, orderdClose, orderAdd } from "@/api/order/order.js"
const rowData = ref()
const isShow = ref(false)
const workDialogRef = ref() const workDialogRef = ref()
const router = useRouter() const router = useRouter()
const tableIns = ref() const tableIns = ref()
@@ -59,7 +60,6 @@ const searchConfig = reactive([
cacheKey: 'work_order_status', cacheKey: 'work_order_status',
clearable: true, clearable: true,
filterable: true, filterable: true,
filterable: true,
}, },
component: shallowRef(fvSelect), component: shallowRef(fvSelect),
}, { }, {
@@ -83,7 +83,7 @@ const searchConfig = reactive([
}, },
{ {
label: '创建日期', label: '创建日期',
prop: 'requirementName', prop: 'requirementDate',
props: { props: {
placeholder: '请选择', placeholder: '请选择',
clearable: true, clearable: true,
@@ -92,7 +92,7 @@ const searchConfig = reactive([
component: 'el-date-picker', component: 'el-date-picker',
}, { }, {
label: '处理时间', label: '处理时间',
prop: 'requirementName', prop: 'requirementDate',
props: { props: {
placeholder: '请选择', placeholder: '请选择',
clearable: true, clearable: true,
@@ -101,7 +101,7 @@ const searchConfig = reactive([
component: 'el-date-picker', component: 'el-date-picker',
}, { }, {
label: '完成时间', label: '完成时间',
prop: 'requirementName', prop: 'requirementDate',
props: { props: {
placeholder: '请选择', placeholder: '请选择',
clearable: true, clearable: true,
@@ -121,22 +121,25 @@ const tableConfig = reactive({
width: 80, width: 80,
}, },
{ {
prop: 'workOrderNumber', prop: 'orderNumber',
label: '工单号', label: '工单号',
align: 'center' align: 'center',
width: 200
}, },
{ {
prop: 'workOrderNumber', prop: 'siteName',
label: '工单名称', label: '工单名称',
align: 'center' align: 'center',
width: 200
}, },
{ {
prop: 'workOrderNumber', prop: 'orderContent',
label: '工单内容', label: '工单内容',
align: 'center' align: 'center',
width: 200
}, },
{ {
prop: 'state', prop: 'orderState',
label: '工单状态', label: '工单状态',
align: 'center', align: 'center',
showOverflowTooltip: false, showOverflowTooltip: false,
@@ -162,29 +165,29 @@ const tableConfig = reactive({
} }
}, },
{ {
prop: 'workOrderNumber', prop: 'operationUser',
label: '处理人', label: '处理人',
align: 'center' align: 'center'
}, },
{ {
prop: 'workOrderNumber', prop: 'processedContent',
label: '处理内容', label: '处理内容',
align: 'center' align: 'center'
}, },
{ {
prop: 'workOrderTime', prop: 'createTime',
label: '创建时间', label: '创建时间',
align: 'center', align: 'center',
width: 200 width: 200
}, },
{ {
prop: 'workOrderTime', prop: 'processedTime',
label: '处理时间', label: '处理时间',
align: 'center', align: 'center',
width: 200 width: 200
}, },
{ {
prop: 'workOrderTime', prop: 'completionTime',
label: '完成时间', label: '完成时间',
align: 'center', align: 'center',
width: 200 width: 200
@@ -197,6 +200,8 @@ const tableConfig = reactive({
width: 150, width: 150,
showOverflowTooltip: false, showOverflowTooltip: false,
currentRender: ({ row, index }) => { currentRender: ({ row, index }) => {
// console.log(row);
let btn = [] let btn = []
btn.push({ label: '详情', prem: auths.detail, func: () => handleDetail(row), type: 'primary' }) btn.push({ label: '详情', prem: auths.detail, func: () => handleDetail(row), type: 'primary' })
btn.push({ label: '关单', prem: auths.detail, func: () => handleClose(row), type: 'primary' }) btn.push({ label: '关单', prem: auths.detail, func: () => handleClose(row), type: 'primary' })
@@ -220,14 +225,14 @@ const tableConfig = reactive({
} }
} }
], ],
api: '', api: '/order/list',
params: {}, params: {},
btns: [ btns: [
// {name: '新增', key: 'add', color: '#DED0B2', auth: auths.report}, // {name: '新增', key: 'add', color: '#DED0B2', auth: auths.report},
] ]
}) })
const headBtnClick = (key) => { const headBtnClick = (key) => {
console.log(key); // console.log(key);
switch (key) { switch (key) {
case 'add': case 'add':
@@ -238,19 +243,23 @@ const headBtnClick = (key) => {
const handleDetail = (row) => { const handleDetail = (row) => {
workDialogRef.value.open(row) workDialogRef.value.open(row)
rowData.value = row
} }
const handleClose = (row) => { const handleClose = async (row) => {
// console.log(row.orderNumber);
ElMessageBox.confirm( ElMessageBox.confirm(
'确定要关单吗?', '确定要关单吗?',
'温馨提示', '温馨提示',
{ {
confirmButtonText: 'OK', confirmButtonText: '确定',
cancelButtonText: 'Cancel', cancelButtonText: '取消',
type: 'warning', type: 'warning',
} }
) )
.then(() => { .then(async () => {
await orderdClose(row.orderNumber)
ElMessage({ ElMessage({
type: 'success', type: 'success',
message: '关闭成功', message: '关闭成功',
@@ -264,17 +273,19 @@ const handleClose = (row) => {
}) })
} }
const handleDelete = (row) => { const handleDelete = async (row) => {
ElMessageBox.confirm( ElMessageBox.confirm(
'确定要删除吗?', '确定要删除吗?',
'温馨提示', '温馨提示',
{ {
confirmButtonText: 'OK', confirmButtonText: '确定',
cancelButtonText: 'Cancel', cancelButtonText: '取消',
type: 'warning', type: 'warning',
} }
) )
.then(() => { .then(async () => {
await orderdDetele(row.orderNumber)
ElMessage({ ElMessage({
type: 'success', type: 'success',
message: '删除成功', message: '删除成功',

View File

@@ -1,17 +1,18 @@
<template> <template>
<fvSearchForm :searchConfig="searchConfig" @search="search"> <fvSearchForm :searchConfig="searchConfig" @search="search">
<FvSelect></FvSelect>
</fvSearchForm> </fvSearchForm>
<fvTable ref="tableIns" :tableConfig="tableConfig" :data="mockData" @headBtnClick="headBtnClick"></fvTable> <fvTable ref="tableIns" :tableConfig="tableConfig" :data="mockData" @headBtnClick="headBtnClick"></fvTable>
<WorkDialog ref="workDialogRef"></WorkDialog> <WorkDialog ref="workDialogRef" :rowData="rowData" />
</template> </template>
<script setup lang="jsx"> <script setup lang="jsx">
import { shallowRef } from 'vue'; import { isShallow, reactive, shallowRef } from 'vue';
import fvSelect from '@/fvcomponents/fvSelect/index.vue' import fvSelect from '@/fvcomponents/fvSelect/index.vue'
import WorkDialog from '../components/WorkDialog.vue'; import WorkDialog from '../components/WorkDialog.vue';
import { orderdDetele, orderdClose, orderAdd } from "@/api/order/order.js"
const rowData = ref()
const isShow = ref(false)
const workDialogRef = ref() const workDialogRef = ref()
const router = useRouter() const router = useRouter()
const tableIns = ref() const tableIns = ref()
@@ -59,7 +60,6 @@ const searchConfig = reactive([
cacheKey: 'work_order_status', cacheKey: 'work_order_status',
clearable: true, clearable: true,
filterable: true, filterable: true,
filterable: true,
}, },
component: shallowRef(fvSelect), component: shallowRef(fvSelect),
}, { }, {
@@ -83,7 +83,7 @@ const searchConfig = reactive([
}, },
{ {
label: '创建日期', label: '创建日期',
prop: 'requirementName', prop: 'requirementDate',
props: { props: {
placeholder: '请选择', placeholder: '请选择',
clearable: true, clearable: true,
@@ -92,7 +92,7 @@ const searchConfig = reactive([
component: 'el-date-picker', component: 'el-date-picker',
}, { }, {
label: '处理时间', label: '处理时间',
prop: 'requirementName', prop: 'requirementDate',
props: { props: {
placeholder: '请选择', placeholder: '请选择',
clearable: true, clearable: true,
@@ -101,7 +101,7 @@ const searchConfig = reactive([
component: 'el-date-picker', component: 'el-date-picker',
}, { }, {
label: '完成时间', label: '完成时间',
prop: 'requirementName', prop: 'requirementDate',
props: { props: {
placeholder: '请选择', placeholder: '请选择',
clearable: true, clearable: true,
@@ -121,22 +121,25 @@ const tableConfig = reactive({
width: 80, width: 80,
}, },
{ {
prop: 'workOrderNumber', prop: 'orderNumber',
label: '工单号', label: '工单号',
align: 'center' align: 'center',
width: 200
}, },
{ {
prop: 'workOrderNumber', prop: 'siteName',
label: '工单名称', label: '工单名称',
align: 'center' align: 'center',
width: 200
}, },
{ {
prop: 'workOrderNumber', prop: 'orderContent',
label: '工单内容', label: '工单内容',
align: 'center' align: 'center',
width: 200
}, },
{ {
prop: 'state', prop: 'orderState',
label: '工单状态', label: '工单状态',
align: 'center', align: 'center',
showOverflowTooltip: false, showOverflowTooltip: false,
@@ -162,29 +165,29 @@ const tableConfig = reactive({
} }
}, },
{ {
prop: 'workOrderNumber', prop: 'operationUser',
label: '处理人', label: '处理人',
align: 'center' align: 'center'
}, },
{ {
prop: 'workOrderNumber', prop: 'processedContent',
label: '处理内容', label: '处理内容',
align: 'center' align: 'center'
}, },
{ {
prop: 'workOrderTime', prop: 'createTime',
label: '创建时间', label: '创建时间',
align: 'center', align: 'center',
width: 200 width: 200
}, },
{ {
prop: 'workOrderTime', prop: 'processedTime',
label: '处理时间', label: '处理时间',
align: 'center', align: 'center',
width: 200 width: 200
}, },
{ {
prop: 'workOrderTime', prop: 'completionTime',
label: '完成时间', label: '完成时间',
align: 'center', align: 'center',
width: 200 width: 200
@@ -197,6 +200,8 @@ const tableConfig = reactive({
width: 150, width: 150,
showOverflowTooltip: false, showOverflowTooltip: false,
currentRender: ({ row, index }) => { currentRender: ({ row, index }) => {
// console.log(row);
let btn = [] let btn = []
btn.push({ label: '详情', prem: auths.detail, func: () => handleDetail(row), type: 'primary' }) btn.push({ label: '详情', prem: auths.detail, func: () => handleDetail(row), type: 'primary' })
btn.push({ label: '关单', prem: auths.detail, func: () => handleClose(row), type: 'primary' }) btn.push({ label: '关单', prem: auths.detail, func: () => handleClose(row), type: 'primary' })
@@ -220,14 +225,14 @@ const tableConfig = reactive({
} }
} }
], ],
api: '', api: '/order/list',
params: {}, params: {},
btns: [ btns: [
// {name: '新增', key: 'add', color: '#DED0B2', auth: auths.report}, // {name: '新增', key: 'add', color: '#DED0B2', auth: auths.report},
] ]
}) })
const headBtnClick = (key) => { const headBtnClick = (key) => {
console.log(key); // console.log(key);
switch (key) { switch (key) {
case 'add': case 'add':
@@ -238,19 +243,23 @@ const headBtnClick = (key) => {
const handleDetail = (row) => { const handleDetail = (row) => {
workDialogRef.value.open(row) workDialogRef.value.open(row)
rowData.value = row
} }
const handleClose = (row) => { const handleClose = async (row) => {
// console.log(row.orderNumber);
ElMessageBox.confirm( ElMessageBox.confirm(
'确定要关单吗?', '确定要关单吗?',
'温馨提示', '温馨提示',
{ {
confirmButtonText: 'OK', confirmButtonText: '确定',
cancelButtonText: 'Cancel', cancelButtonText: '取消',
type: 'warning', type: 'warning',
} }
) )
.then(() => { .then(async () => {
await orderdClose(row.orderNumber)
ElMessage({ ElMessage({
type: 'success', type: 'success',
message: '关闭成功', message: '关闭成功',
@@ -264,17 +273,19 @@ const handleClose = (row) => {
}) })
} }
const handleDelete = (row) => { const handleDelete = async (row) => {
ElMessageBox.confirm( ElMessageBox.confirm(
'确定要删除吗?', '确定要删除吗?',
'温馨提示', '温馨提示',
{ {
confirmButtonText: 'OK', confirmButtonText: '确定',
cancelButtonText: 'Cancel', cancelButtonText: '取消',
type: 'warning', type: 'warning',
} }
) )
.then(() => { .then(async () => {
await orderdDetele(row.orderNumber)
ElMessage({ ElMessage({
type: 'success', type: 'success',
message: '删除成功', message: '删除成功',