This commit is contained in:
parent
5413b1a310
commit
f8e8dd339b
5
App.vue
5
App.vue
|
|
@ -35,9 +35,8 @@ export default {
|
|||
page {
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
height: auto;
|
||||
white-space: pre-wrap;
|
||||
word-wrap: break-word;
|
||||
/* white-space: pre-wrap;
|
||||
word-wrap: break-word; */
|
||||
}
|
||||
::v-deep .uni-system-preview-image {
|
||||
z-index: 10080 !important;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,109 @@
|
|||
import request from '@/utils/request';
|
||||
|
||||
// 到货确认单-列表
|
||||
export function getOutPageList(data) {
|
||||
return request({
|
||||
url: '/app/aapController/getOutPageList',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 到货确认单-上传
|
||||
export function uploadFile(data) {
|
||||
return request({
|
||||
url: '/app/aapController/uploadFile',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 到货确认单-计划详情
|
||||
export function getDispatchCarListData(data) {
|
||||
return request({
|
||||
url: '/app/aapController/getDispatchCarListData',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 到货确认单-派车详情
|
||||
export function getDispatchCarData(data) {
|
||||
return request({
|
||||
url: '/app/aapController/getDispatchCarData',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 派车分配-列表
|
||||
export function getPlanList(data) {
|
||||
return request({
|
||||
url: '/app/aapController/getPlanList',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 派车分配-供应商-列表
|
||||
export function getContractSupList(data) {
|
||||
return request({
|
||||
url: '/app/aapController/getContractSupList',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 派车分配-供应商-分配
|
||||
export function addPlanSupInfo(data) {
|
||||
return request({
|
||||
url: '/app/aapController/addPlanSupInfo',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 派车分配-详情
|
||||
export function getPlanDetails(data) {
|
||||
return request({
|
||||
url: '/app/aapController/getPlanDetails',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 派车审核-列表
|
||||
export function getAuditList(data) {
|
||||
return request({
|
||||
url: '/app/aapController/getAuditList',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 派车审核-审核
|
||||
export function dispatchAudit(data) {
|
||||
return request({
|
||||
url: '/app/aapController/dispatchAudit',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 派车审核-详情
|
||||
export function getOutDetails(data) {
|
||||
return request({
|
||||
url: '/app/aapController/getOutDetails',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 派车审核-审核记录
|
||||
export function getAuditRecord(data) {
|
||||
return request({
|
||||
url: '/app/aapController/getAuditRecord',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
// 应用全局配置
|
||||
module.exports = {
|
||||
// baseUrl: 'https://vue.ruoyi.vip/prod-api',
|
||||
// baseUrl: 'http://192.168.0.39:21995',
|
||||
baseUrl: 'http://192.168.0.14:21520',
|
||||
baseUrl: 'http://192.168.0.39:21522/gz_car', // 车辆
|
||||
// baseUrl: 'http://192.168.0.14:21520',
|
||||
// baseUrl: 'http://localhost:8080',
|
||||
uploadFileUrl: '/app/common/appUploadFile',
|
||||
// fileUrl: 'http://192.168.0.39:21995/statics', // 图片预览
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"crypto-js": "^4.2.0"
|
||||
"crypto-js": "^4.2.0",
|
||||
"image-tools": "^1.4.0"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,7 +74,8 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { getInventoryList } from '@/api/aqSafety'
|
||||
import { pathToBase64, base64ToPath } from 'image-tools'
|
||||
import { getOutPageList, uploadFile } from '@/api/carManage'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
|
|
@ -112,7 +113,7 @@ export default {
|
|||
}
|
||||
},
|
||||
onLoad() {
|
||||
// this.getList()
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
handleSearch() {
|
||||
|
|
@ -127,7 +128,7 @@ export default {
|
|||
pageSize: this.pageSize
|
||||
}
|
||||
console.log('🚀 ~ getList ~ params', params)
|
||||
const res = await getInventoryList(params)
|
||||
const res = await getOutPageList(params)
|
||||
console.log('🚀 ~ getList ~ res', res)
|
||||
this.tableList = res.data.list
|
||||
this.total = res.data.total
|
||||
|
|
@ -155,11 +156,11 @@ export default {
|
|||
this.imgModal = true
|
||||
if (item) {
|
||||
this.readonly = true
|
||||
this.imgModelTitle = '查看到货确认单'
|
||||
this.imgModelTitle = '查看到货确认单照片'
|
||||
this.imgList = item.imgList
|
||||
} else {
|
||||
this.readonly = false
|
||||
this.imgModelTitle = '上传到货确认单'
|
||||
this.imgModelTitle = '上传到货确认单照片'
|
||||
this.imgList = []
|
||||
}
|
||||
},
|
||||
|
|
@ -197,6 +198,19 @@ export default {
|
|||
}
|
||||
})
|
||||
},
|
||||
// 图片转base64
|
||||
imgToBase64(data) {
|
||||
return new Promise((resolve, reject) => {
|
||||
pathToBase64(data)
|
||||
.then(base64 => {
|
||||
resolve(base64)
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error)
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
},
|
||||
handleDetail(item) {
|
||||
console.log('🚀 ~ handleDetail ~ item', item)
|
||||
const params = {
|
||||
|
|
|
|||
|
|
@ -6,15 +6,17 @@
|
|||
<div class="item" :class="{ active: active == 2 }" @click="handleTab(2)">派车详情</div>
|
||||
<div class="item" :class="{ active: active == 3 }" @click="handleTab(3)" v-if="!opt.isArrival">审核记录</div>
|
||||
</div>
|
||||
<!-- <div v-if="opt.isDetail" style="height: 45px"></div> -->
|
||||
|
||||
<PlanDetails v-if="active == 1" :opt="opt" />
|
||||
<PlanAuditDetails v-if="active == 2" :opt="opt" />
|
||||
<AuditRecord v-if="active == 3" :opt="opt" />
|
||||
<div class="content">
|
||||
<PlanDetails v-if="active == 1" :opt="opt" />
|
||||
<PlanAuditDetails v-if="active == 2" :opt="opt" />
|
||||
<AuditRecord v-if="active == 3" :opt="opt" />
|
||||
</div>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getDispatchCarListData, getDispatchCarData } from '@/api/carManage'
|
||||
import AuditRecord from './components/AuditRecord'
|
||||
import PlanDetails from './components/PlanDetails'
|
||||
import PlanAuditDetails from './components/PlanAuditDetails'
|
||||
|
|
@ -34,9 +36,7 @@ export default {
|
|||
this.active = this.opt.active
|
||||
if (this.opt.isPlan) {
|
||||
this.navbarTitle = '计划详情'
|
||||
} else if (this.opt.isAudit) {
|
||||
this.navbarTitle = '派车详情'
|
||||
} else if (this.opt.isDetail && !this.opt.isArrival) {
|
||||
} else if (this.opt.isAudit || (this.opt.isDetail && !this.opt.isArrival)) {
|
||||
this.navbarTitle = '派车详情'
|
||||
} else {
|
||||
this.navbarTitle = '详情'
|
||||
|
|
@ -45,6 +45,24 @@ export default {
|
|||
methods: {
|
||||
handleTab(index) {
|
||||
this.active = index
|
||||
},
|
||||
// 派车详情
|
||||
getDispatchCarDetails() {
|
||||
if (this.opt.isArrival) {
|
||||
this.getDispatchCarListData()
|
||||
this.getDispatchCarData()
|
||||
} else {
|
||||
}
|
||||
},
|
||||
// 获取派车详情
|
||||
async getDispatchCarData() {
|
||||
const res = await getDispatchCarData({ id: this.opt.id })
|
||||
console.log('🚀 ~ getDispatchCarData ~ res', res)
|
||||
},
|
||||
// 获取派车列表
|
||||
async getDispatchCarListData() {
|
||||
const res = await getDispatchCarListData({ id: this.opt.id })
|
||||
console.log('🚀 ~ getDispatchCarListData ~ res', res)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -56,9 +74,6 @@ page {
|
|||
}
|
||||
.tabs {
|
||||
width: 100%;
|
||||
/* position: fixed;
|
||||
top: 44px;
|
||||
left: 0; */
|
||||
background-color: #fff;
|
||||
z-index: 99;
|
||||
display: flex;
|
||||
|
|
@ -82,4 +97,8 @@ page {
|
|||
}
|
||||
}
|
||||
}
|
||||
.content {
|
||||
height: calc(100vh - 112px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -4,19 +4,13 @@
|
|||
<div class="item" :class="{ active: active == 1 }" @click="handleTab(1)">派车分配</div>
|
||||
<div class="item" :class="{ active: active == 2 }" @click="handleTab(2)">派车审核</div>
|
||||
</div>
|
||||
<div style="height: 45px"></div>
|
||||
<!-- 搜索 -->
|
||||
<div class="search">
|
||||
<div class="search flex align-center">
|
||||
<div v-if="active == 2" style="width: 30%">
|
||||
<u-cell-group :border="false">
|
||||
<u-cell
|
||||
:value="checkStatus"
|
||||
isLink
|
||||
:label="checkStatus ? '' : '审核状态'"
|
||||
:border="false"
|
||||
@click="showPicker = true"
|
||||
></u-cell>
|
||||
</u-cell-group>
|
||||
<div class="search-item" @click="showPicker = true">
|
||||
{{ checkStatus || '审核状态' }}
|
||||
<u-icon name="arrow-down"></u-icon>
|
||||
</div>
|
||||
</div>
|
||||
<u-input
|
||||
v-model="keyWord"
|
||||
|
|
@ -28,51 +22,60 @@
|
|||
></u-input>
|
||||
</div>
|
||||
<!-- 列表 -->
|
||||
<div class="list-cont" v-for="(item, index) in tableList" :key="index" @click="handleDetail(item)">
|
||||
<u-row justify="space-between" customStyle="margin-bottom: 10px; padding: 0 15px;">
|
||||
<u-col span="6">
|
||||
<div>{{ item.code }}</div>
|
||||
</u-col>
|
||||
<u-col span="6" v-if="active == 1">
|
||||
<div style="display: flex; justify-content: flex-end">
|
||||
<u-tag text="已派车" type="success" v-if="item.isSend"></u-tag>
|
||||
<u-tag text="待派车" type="warning" v-else></u-tag>
|
||||
<div class="list">
|
||||
<div class="list-cont" v-for="(item, index) in tableList" :key="index" @click="handleDetail(item)">
|
||||
<u-row justify="space-between" customStyle="margin-bottom: 10px; padding: 0 15px;">
|
||||
<u-col span="6">
|
||||
<div>{{ item.code }}</div>
|
||||
</u-col>
|
||||
<u-col span="6" v-if="active == 1">
|
||||
<div style="display: flex; justify-content: flex-end">
|
||||
<u-tag text="已派车" type="success" v-if="item.isSend"></u-tag>
|
||||
<u-tag text="待派车" type="warning" v-else></u-tag>
|
||||
</div>
|
||||
</u-col>
|
||||
</u-row>
|
||||
<u-line style="margin-bottom: 5px"></u-line>
|
||||
<div class="list-item">
|
||||
<span>工程名称:</span>
|
||||
<span>{{ item.proName }}</span>
|
||||
</div>
|
||||
<div class="list-item df-item">
|
||||
<div>
|
||||
<span>计划类型:</span>
|
||||
<span>{{ item.plan }}</span>
|
||||
</div>
|
||||
<div>
|
||||
<u-tag v-if="active == 1 && !item.isSend" type="primary" text="派车分配" @click="openModal(item)"></u-tag>
|
||||
<u-tag
|
||||
v-else-if="active == 2 && item.status == 0"
|
||||
type="warning"
|
||||
text="审核"
|
||||
@click="openModal(item)"
|
||||
></u-tag>
|
||||
<u-tag text="已通过" type="success" v-else-if="active == 2 && item.status == 1"></u-tag>
|
||||
</div>
|
||||
</u-col>
|
||||
</u-row>
|
||||
<u-line style="margin-bottom: 5px"></u-line>
|
||||
<div class="list-item">
|
||||
<span>工程名称:</span>
|
||||
<span>{{ item.proName }}</span>
|
||||
</div>
|
||||
<div class="list-item df-item">
|
||||
<div>
|
||||
<span>计划类型:</span>
|
||||
<span>{{ item.plan }}</span>
|
||||
</div>
|
||||
<div>
|
||||
<u-tag v-if="active == 1 && !item.isSend" type="primary" text="派车分配" @click="openModal"></u-tag>
|
||||
<u-tag v-else-if="active == 2 && item.status == 0" type="warning" text="审核" @click="openModal"></u-tag>
|
||||
<u-tag text="已通过" type="success" v-else-if="active == 2 && item.status == 1"></u-tag>
|
||||
<div class="list-item">
|
||||
<span>供 应 商:</span>
|
||||
<span>{{ item.sub }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="list-item">
|
||||
<span>供 应 商:</span>
|
||||
<span>{{ item.sub }}</span>
|
||||
</div>
|
||||
<!-- 空状态 -->
|
||||
<u-empty v-if="tableList.length == 0" mode="data"></u-empty>
|
||||
</div>
|
||||
|
||||
<!-- 弹框 -->
|
||||
<u-modal :show="showModal" :title="modalTitle" showCancelButton @cancel="showModal = false" @confirm="submit">
|
||||
<view class="slot-content">
|
||||
<div v-if="active == 1">
|
||||
<u-radio-group v-model="radioValue" placement="column" @change="groupChange">
|
||||
<u-radio-group v-model="supId" placement="column" @change="groupChange">
|
||||
<u-radio
|
||||
:customStyle="{ marginBottom: '8px' }"
|
||||
v-for="(item, index) in radioList"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:name="item.value"
|
||||
:label="item.supName"
|
||||
:name="item.supId"
|
||||
></u-radio>
|
||||
</u-radio-group>
|
||||
</div>
|
||||
|
|
@ -82,7 +85,7 @@
|
|||
<div class="item" :class="{ active: !isPass }" @click="isPass = false">不通过</div>
|
||||
</div>
|
||||
<u-textarea
|
||||
v-model="opinion"
|
||||
v-model="remark"
|
||||
placeholder="不通过必须填写审核不通过意见"
|
||||
:rows="5"
|
||||
maxlength="200"
|
||||
|
|
@ -103,14 +106,11 @@
|
|||
></u-picker>
|
||||
|
||||
<u-loadmore :status="status" line v-if="tableList.length > 10" />
|
||||
|
||||
<!-- 空状态 -->
|
||||
<u-empty v-if="tableList.length == 0" mode="data"></u-empty>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getInventoryList } from '@/api/aqSafety'
|
||||
import { getPlanList, getAuditList, getContractSupList, addPlanSupInfo, dispatchAudit } from '@/api/carManage'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
|
|
@ -141,29 +141,22 @@ export default {
|
|||
// 单选
|
||||
radioList: [
|
||||
{
|
||||
name: '苹果',
|
||||
value: '1',
|
||||
disabled: false
|
||||
supId: 1,
|
||||
supName: '供应商1',
|
||||
contractId: 1
|
||||
},
|
||||
{
|
||||
name: '香蕉',
|
||||
value: '2',
|
||||
disabled: false
|
||||
},
|
||||
{
|
||||
name: '橙子',
|
||||
value: '3',
|
||||
disabled: false
|
||||
},
|
||||
{
|
||||
name: '榴莲',
|
||||
value: '4',
|
||||
disabled: false
|
||||
supId: 2,
|
||||
supName: '供应商2',
|
||||
contractId: 2
|
||||
}
|
||||
],
|
||||
radioValue: '', // 选中的值
|
||||
opinion: '', // 审批意见
|
||||
isPass: true // 是否通过
|
||||
supId: '', // 供应商id
|
||||
supName: '', // 供应商名称
|
||||
contractId: '', // 合同id
|
||||
remark: '', // 审批意见
|
||||
isPass: true, // 是否通过
|
||||
row: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
|
@ -172,11 +165,14 @@ export default {
|
|||
}
|
||||
},
|
||||
onLoad() {
|
||||
// this.getList()
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
handleTab(index) {
|
||||
this.active = index
|
||||
this.pageNum = 1
|
||||
this.pageSize = 10
|
||||
this.getList()
|
||||
if (index == 1) {
|
||||
this.tableList = [
|
||||
{
|
||||
|
|
@ -216,18 +212,24 @@ export default {
|
|||
}
|
||||
},
|
||||
handleSearch() {
|
||||
console.log('搜索', this.keyWord.trim())
|
||||
this.pageSize = 10
|
||||
this.getList()
|
||||
},
|
||||
async getList() {
|
||||
try {
|
||||
const params = {
|
||||
encryptedData: JSON.stringify({ keyWord: this.keyWord }),
|
||||
encryptedData: JSON.stringify({ keyWord: this.keyWord.trim() }),
|
||||
pageNum: this.pageNum,
|
||||
pageSize: this.pageSize
|
||||
}
|
||||
console.log('🚀 ~ getList ~ params', params)
|
||||
const res = await getInventoryList(params)
|
||||
let res = null
|
||||
if (this.active == 1) {
|
||||
res = await getPlanList(params)
|
||||
} else {
|
||||
res = await getAuditList(params)
|
||||
}
|
||||
console.log('🚀 ~ getList ~ res', res)
|
||||
this.tableList = res.data.list
|
||||
this.total = res.data.total
|
||||
|
|
@ -251,25 +253,41 @@ export default {
|
|||
console.log('加载..', this.pageSize)
|
||||
},
|
||||
// 打开弹窗
|
||||
openModal() {
|
||||
openModal(item) {
|
||||
this.row = item
|
||||
this.showModal = true
|
||||
if (this.active == 1) {
|
||||
this.getContractSupList(item)
|
||||
this.modalTitle = '指定派车供应商'
|
||||
this.radioValue = ''
|
||||
this.supId = ''
|
||||
this.supName = ''
|
||||
} else {
|
||||
this.modalTitle = '派车审核'
|
||||
this.isPass = true
|
||||
this.opinion = ''
|
||||
this.remark = ''
|
||||
}
|
||||
},
|
||||
// 获取供应商列表
|
||||
async getContractSupList(item) {
|
||||
console.log('🚀 ~ 供应商-列表 ~ item:', item)
|
||||
const params = {
|
||||
encryptedData: JSON.stringify({ type: item.type })
|
||||
}
|
||||
const res = await getContractSupList(params)
|
||||
console.log('🚀 ~ getContractSupList ~ res', res)
|
||||
},
|
||||
confirm(e) {
|
||||
console.log('🚀 ~ confirm ~ e', e)
|
||||
this.checkStatus = e.value[0].label
|
||||
this.checkStatusId = e.value[0].value
|
||||
this.showPicker = false
|
||||
},
|
||||
groupChange() {
|
||||
console.log('🚀 ~ radioValue', this.radioValue)
|
||||
groupChange(e) {
|
||||
console.log('🚀 ~ supId', e)
|
||||
this.supId = e
|
||||
this.supName = this.radioList.find((item) => item.supId == e).supName
|
||||
this.contractId = this.radioList.find((item) => item.supId == e).contractId
|
||||
console.log('🚀 ~ supName', this.supName, this.contractId)
|
||||
},
|
||||
// 查看详情
|
||||
handleDetail(item) {
|
||||
|
|
@ -299,29 +317,58 @@ export default {
|
|||
url: `/pages/sendACarSystem/details?params=${JSON.stringify(params)}`
|
||||
})
|
||||
},
|
||||
// 提交
|
||||
// 提交-派车分配/审核
|
||||
submit() {
|
||||
console.log('提交')
|
||||
if (this.active == 1) {
|
||||
console.log('派车分配', this.radioValue)
|
||||
if (!this.radioValue) {
|
||||
console.log('派车分配', this.supId)
|
||||
if (!this.supId) {
|
||||
uni.showToast({
|
||||
title: '请选择派车供应商',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
this.addPlanSupInfo()
|
||||
} else {
|
||||
console.log('派车审核', this.isPass, this.opinion)
|
||||
if (!this.isPass && !this.opinion) {
|
||||
console.log('派车审核', this.isPass, this.remark)
|
||||
if (!this.isPass && !this.remark) {
|
||||
uni.showToast({
|
||||
title: '请填写审核不通过意见',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
this.dispatchAudit()
|
||||
}
|
||||
this.showModal = false
|
||||
},
|
||||
// 确认分配供应商
|
||||
async addPlanSupInfo() {
|
||||
const params = {
|
||||
encryptedData: JSON.stringify({
|
||||
type: this.row.type,
|
||||
id: this.row.id,
|
||||
supId: this.supId,
|
||||
supName: this.supName,
|
||||
contractId: this.contractId
|
||||
})
|
||||
}
|
||||
const res = await addPlanSupInfo(params)
|
||||
console.log('🚀 ~ addPlanSupInfo ~ res', res)
|
||||
},
|
||||
// 派车审核
|
||||
async dispatchAudit() {
|
||||
const params = {
|
||||
encryptedData: JSON.stringify({
|
||||
id: this.row.id,
|
||||
planId: this.row.planId,
|
||||
status: this.isPass ? 1 : 2,
|
||||
remark: this.remark
|
||||
})
|
||||
}
|
||||
const res = await dispatchAudit(params)
|
||||
console.log('🚀 ~ dispatchAudit ~ res', res)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -334,9 +381,23 @@ page {
|
|||
.search {
|
||||
margin: 15px;
|
||||
display: flex;
|
||||
.search-item {
|
||||
margin-right: 10px;
|
||||
border: 1px solid #e8e8e8;
|
||||
padding: 7px 10px;
|
||||
border-radius: 30px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
.list {
|
||||
height: calc(100vh - 112px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
.list-cont {
|
||||
margin: 15px;
|
||||
margin-top: 0;
|
||||
padding: 15px 0;
|
||||
margin-bottom: 15px;
|
||||
background-color: #fff;
|
||||
|
|
@ -355,9 +416,7 @@ page {
|
|||
}
|
||||
.tabs {
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
top: 44px;
|
||||
left: 0;
|
||||
height: 45px;
|
||||
background-color: #fff;
|
||||
z-index: 99;
|
||||
display: flex;
|
||||
|
|
|
|||
|
|
@ -62,22 +62,23 @@ const user = {
|
|||
// 获取用户信息
|
||||
GetInfo({ commit, state }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
getInfo().then(res => {
|
||||
const user = res.user;
|
||||
const avatar = (user == null || user.avatar == "" || user.avatar == null) ? require("@/static/images/profile.jpg") : baseUrl + user.avatar;
|
||||
const username = (user == null || user.userName == "" || user.userName == null) ? "" : user.userName;
|
||||
if (res.roles && res.roles.length > 0) {
|
||||
commit('SET_ROLES', res.roles);
|
||||
commit('SET_PERMISSIONS', res.permissions);
|
||||
} else {
|
||||
commit('SET_ROLES', ['ROLE_DEFAULT']);
|
||||
}
|
||||
commit('SET_NAME', username);
|
||||
commit('SET_AVATAR', avatar);
|
||||
resolve(res);
|
||||
}).catch(error => {
|
||||
reject(error);
|
||||
});
|
||||
resolve('success');
|
||||
// getInfo().then(res => {
|
||||
// const user = res.user;
|
||||
// const avatar = (user == null || user.avatar == "" || user.avatar == null) ? require("@/static/images/profile.jpg") : baseUrl + user.avatar;
|
||||
// const username = (user == null || user.userName == "" || user.userName == null) ? "" : user.userName;
|
||||
// if (res.roles && res.roles.length > 0) {
|
||||
// commit('SET_ROLES', res.roles);
|
||||
// commit('SET_PERMISSIONS', res.permissions);
|
||||
// } else {
|
||||
// commit('SET_ROLES', ['ROLE_DEFAULT']);
|
||||
// }
|
||||
// commit('SET_NAME', username);
|
||||
// commit('SET_AVATAR', avatar);
|
||||
// resolve(res);
|
||||
// }).catch(error => {
|
||||
// reject(error);
|
||||
// });
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -97,11 +97,11 @@ const request = config => {
|
|||
return
|
||||
}
|
||||
// res = JSON.parse(decryptCBC(res.data))
|
||||
console.log('🚀 ~ request.js ~ line 100 ~ res', res)
|
||||
// console.log('🚀 ~ request.js ~ line 100 ~ res', res)
|
||||
const code = res.data.code || 200
|
||||
console.log('🚀 ~ ~ code', code)
|
||||
const msg = errorCode[code] || res.data.msg || errorCode['default']
|
||||
console.log('🚀 ~ ~ msg', msg)
|
||||
// console.log('🚀 ~ ~ msg', msg)
|
||||
if (code === 401) {
|
||||
showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
|
||||
if (res.confirm) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue