xy 2 years ago
parent 92ba08a9f1
commit 1cc34fc78f

@ -4,6 +4,10 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="Expires" content="0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= webpackConfig.name %></title>

@ -8,10 +8,11 @@ export function save(data) {
})
}
export function listdept() {
export function listdept(isLoading=false) {
return request({
url: '/api/admin/department',
method: 'get'
method: 'get',
isLoading
})
}

@ -1,32 +1,36 @@
import request from '@/utils/request'
export function login(data) {
export function login(data,isLoading=false) {
return request({
url: '/api/admin/auth/login',
method: 'post',
data
data,
isLoading
})
}
export function getInfo(token) {
export function getInfo(token,isLoading=false) {
return request({
url: '/api/admin/auth/me',
method: 'post',
params: { token }
params: { token },
isLoading
})
}
export function logout() {
export function logout(isLoading=false) {
return request({
url: '/api/admin/auth/logout',
method: 'post'
method: 'post',
isLoading
})
}
export function getAuthMenu(token) {
export function getAuthMenu(token,isLoading=false) {
return request({
url: '/api/admin/auth/permissions',
method: 'get',
params: { token }
params: { token },
isLoading
})
}
}

@ -20,6 +20,8 @@ export default {
type: String,
default: "data",
}, //
formatListData: Function,//
btnCondition: Function,//
//
auths: {
@ -740,13 +742,15 @@ export default {
let dom = [];
_this.auths.forEach((item, index) => {
if (this.btnToMore && _this.moreAuths.find(j => j === item)) return
if (_this.$scopedSlots[item]) {
flag = index;
dom.push(_this.$scopedSlots[item](scope, item, index));
} else {
if (btns.get(item)) {
if (!this.btnCondition || (this.btnCondition && typeof this.btnCondition === 'function' && this.btnCondition(scope, item, index))) {
if (_this.$scopedSlots[item]) {
flag = index;
dom.push(btns.get(item));
dom.push(_this.$scopedSlots[item](scope, item, index));
} else {
if (btns.get(item)) {
flag = index;
dom.push(btns.get(item));
}
}
}
})
@ -762,11 +766,19 @@ export default {
},
},
computed: {
tableFormat() {
tableFormat () {
return this.tableItem.filter((item) => {
return this.checkTable.indexOf(item.prop) !== -1;
});
},
tableData () {
if (this.formatListData && typeof this.formatListData === 'function') {
console.log(this.formatListData(this.action ? this.listData : this.list))
return this.formatListData(this.action ? this.listData : this.list)
} else {
return this.action ? this.listData : this.list
}
}
},
watch:{
tableItem(newVal){
@ -807,7 +819,7 @@ export default {
class="v-table"
v-loading={this.loading}
ref="table"
data={this.action ? this.listData : this.list}
data={this.tableData}
height={this.height ?? this.tableHeight}
max-height={this.maxHeight}
stripe={this.stripe}

@ -18,7 +18,7 @@ export function mergeTableRow (config) {
const rowVal = v[firstMerge] + '-' + v[m]
// 需要合并行的第二行以及之后行会走if
// m === firstMerge 判断需要合并的列是否是基准列,如果是则只满足前面的条件,如果不是则需满足前面+后面的条件
if (mList[rowVal] && mList[rowVal].newIndex === index && (m === firstMerge ? true : data[index][firstMerge + '-span'].rowspan === 0)) {
if (mList[rowVal] && mList[rowVal].newIndex === index && (m === firstMerge ? true : data[index][firstMerge + '-span']?.rowspan === 0)) {
// 判断受影响的列是否是需要合并的列
const flag = firstMergeColNames.filter((f) => {
return f === m
@ -28,7 +28,7 @@ export function mergeTableRow (config) {
return mc === firstMerge
}).length === 0
// 判断基准列只有一行的时候直接赋值rowspan和colspan为1
if ((mcFlag && flag) || (flag && data[index][firstMerge + '-span'] && data[index][firstMerge + '-span'].rowspan === 1)) {
if ((mcFlag && flag) || (flag && data[index][firstMerge + '-span'] && data[index][firstMerge + '-span']?.rowspan === 1)) {
v[m + '-span'] = {
rowspan: 1,
colspan: 1

@ -15,7 +15,7 @@
end_time: '关闭时间'
}"
@refresh="getTransfer(true)"
@showDetail="d => ($refs['detailTransfer'].setData(d),$refs['detailTransfer'].show())"></transferBoard>
@showDetail="({ item, isShow }) => ($refs['detailTransfer'].readonly = isShow,$refs['detailTransfer'].setData(item),$refs['detailTransfer'].show())"></transferBoard>
</div>
<div class="board-item">
<dv-border-box-10 class="board-item__title fw-b">执行中</dv-border-box-10>
@ -27,7 +27,7 @@
end_time: '关闭时间',
}"
@refresh="getTransfer(true)"
@showDetail="d => ($refs['detailTransfer'].setData(d),$refs['detailTransfer'].show())"></transferBoard>
@showDetail="({ item, isShow }) => ($refs['detailTransfer'].readonly = isShow,$refs['detailTransfer'].setData(item),$refs['detailTransfer'].show())"></transferBoard>
</div>
<div class="board-item">
<dv-border-box-10 class="board-item__title fw-b">已完成</dv-border-box-10>
@ -40,7 +40,7 @@
act_end_time: '关闭执行时间',
}"
@refresh="getTransfer(true)"
@showDetail="d => ($refs['detailTransfer'].setData(d),$refs['detailTransfer'].show())"></transferBoard>
@showDetail="({ item, isShow }) => ($refs['detailTransfer'].readonly = isShow,$refs['detailTransfer'].setData(item),$refs['detailTransfer'].show())"></transferBoard>
</div>
</div>
</div>

@ -44,7 +44,7 @@
<td>执行状态</td>
<td>
<template v-if="data.status === 2">
<div class="sign-container">
<div class="sign-container" v-if="!readonly">
<vEsign style="flex: 1;" ref="esign" line-color="#eee" bg-color="" :line-width="5"></vEsign>
@ -56,7 +56,7 @@
</div>
</template>
<template v-else-if="data.status === 3">
<div class="sign-container">
<div class="sign-container" v-if="!readonly">
<vEsign style="flex: 1;" ref="esign" line-color="#eee" bg-color="" :line-width="5"></vEsign>
<div class="btns">
@ -74,10 +74,10 @@
</div>
</div>
<vEsign style="flex: 1;" ref="esign" line-color="#eee" bg-color="" :line-width="5"></vEsign>
<vEsign v-if="!readonly" style="flex: 1;" ref="esign" line-color="#eee" bg-color="" :line-width="5"></vEsign>
<div class="btns">
<div class="btns" v-if="!readonly">
<Button type="primary" ghost @click="$refs['esign'].reset()"></Button>
<Button type="primary" @click="esignConfirm(false)"></Button>
<Button type="primary" @click="esignConfirm(true)"></Button>
@ -93,9 +93,9 @@
</div>
</div>
<vEsign style="flex: 1;" ref="esign" line-color="#eee" bg-color="" :line-width="5"></vEsign>
<vEsign v-if="!readonly" style="flex: 1;" ref="esign" line-color="#eee" bg-color="" :line-width="5"></vEsign>
<div class="btns">
<div class="btns" v-else-if="!readonly">
<Button type="primary" ghost @click="$refs['esign'].reset()"></Button>
<Button type="primary" @click="esignConfirm(true)"></Button>
</div>
@ -137,6 +137,7 @@ export default {
data() {
return {
isShow: false,
readonly: false,
data: {},
typeMap: new Map([
[1,'待下发'],

@ -9,14 +9,17 @@
line-height: ${heights[index]}px;
transition: all .2s;
`"
@click="showDetail(item)">
@click="showDetail(item,true)">
<dv-border-box-13 style="width: 100%;height: 100%;min-height: .5px;" :style="{ 'opacity': heights[index] ? 1 : 0}">
<div style="width: 100%;height: 100%;padding: 30px 20px;line-height: 1;" class="d-flex flex-column jc-between flex-1">
<div class="board-item__top d-flex jc-between ai-center">
<dv-decoration-11 style="width: 160px;height: 48px;">{{ item.equipment_id_equipments_id_relation ? item.equipment_id_equipments_id_relation.name : '' }}</dv-decoration-11>
<template v-if="item.status === 3 || item.status === 2">
<dv-decoration-11 style="width: 160px;height: 48px;" :style="{ 'color': item.level === 2 ? 'red' : '#fff' }">{{ item.equipment_id_equipments_id_relation ? item.equipment_id_equipments_id_relation.name : '' }}</dv-decoration-11>
<template v-if="item.level === 2">
<Icon type="ios-alert" color="red" style="font-size: 26px;flex: 1;" class="d-flex ai-left"/>
</template>
<template v-if="[2,3,4,5].find(i => i === item.status)">
<dv-percent-pond :config="{
value: item.status === 2 ? 0 : 50,
value: (item.status === 2 || item.status === 4) ? 0 : 50,
colors: ['#01c4f9', '#c135ff'],
lineDash: [6,3]
}"
@ -83,10 +86,37 @@ export default {
}
},
methods: {
showDetail (item) {
this.nowRow = deepCopy(item);
console.log(this.nowRow)
this.$emit('showDetail',item)
showDetail (item,isShow=false) {
if (isShow) {
this.nowRow = deepCopy(item);
this.$emit('showDetail', { item,isShow })
return
}
if (item.status === 2 || item.status === 4) {
this.$confirm("确认要通知现场?","提示",{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
customClass: "big-screen-modal"
}).then(res => {
let copyData = deepCopy(item);
copyData.status = item.status === 2 ? 3 : 5;
for (let key in copyData) {
if (/_relation/g.test(key)) {
delete copyData[key]
}
}
save({
table_name: 'transfers',
...copyData
}).then(_ => {
this.$emit('refresh')
})
})
} else {
this.nowRow = deepCopy(item);
this.$emit('showDetail',item)
}
},
setTransferStatus (data) {
@ -210,9 +240,9 @@ export default {
setStatusText () {
return function (status) {
const textMap = new Map([
[2,'确认开启'],
[2,'通知现场'],
[3,'确认开启'],
[4,'确认关闭'],
[4,'通知现场'],
[5,'确认关闭']
])
return textMap.get(status)

@ -827,6 +827,10 @@ export default {
message: `成功创建${res.length}条调令`,
});
this.$bus.$emit("createdTransfer");
if (isNeed) {
this.$router.push('/dispatch/handle')
}
})
.catch((_) => {
loadingInstance.close();

@ -272,7 +272,7 @@
</template>
<Button type="primary" @click="cloneTransfer"></Button>
<template #distribute>
<Button type="primary" @click="pickNoDistribute"></Button>
<Button type="primary" @click="pickNoDistribute"></Button>
<Button type="primary" @click="distributeTransfers"></Button>
</template>
</header-content>
@ -283,6 +283,9 @@
<!--$refs['drawer'].setId(row.id);
$refs['drawer'].show();-->
<xy-table
:btnCondition="btnCondition"
:span-method="objectSpanMethod"
:format-list-data="mergeData"
:is-page="false"
:btn-width="300"
:auths="auths_auth_mixin"
@ -323,7 +326,6 @@
</template>
<template #oa="{ row }">
<Button
v-if="row.shifouzouliucheng && (row.liuchengzhuangtai == 1 || !row.liuchengzhuangtai)"
size="small"
type="primary"
@click="toOa(row)"
@ -332,18 +334,20 @@
</template>
<template #distribute="{ row }">
<Button
v-if="row.status === 1"
v-if="row.status === 1 || row.status === 7"
size="small"
type="primary"
@click="setTransferStatus(2,row)"
>下发</Button
>
</template>
<template #cancel="{ row }">
<Button
v-if="row.status === 2"
size="small"
type="primary"
ghost
@click="setTransferStatus(1,row)"
@click="setTransferStatus(7,row)"
>取消</Button
>
</template>
@ -393,6 +397,7 @@ import drawer from "@/views/component/drawer.vue";
import imports from "@/views/component/imports.vue";
import callback from "@/views/order/component/callback.vue";
import {deepCopy} from "@/utils";
import {mergeTableRow} from "@/utils/mergeTableRow";
export default {
components: {
LxHeader,
@ -455,6 +460,46 @@ export default {
};
},
methods: {
btnCondition ({ row }, item, index) {
if (row.status === 7) {
if (item === 'oa') {
return false
}
}
if ([2,3,4,5,6].find(i => i === row.status)) {
if (item === 'delete' || item === 'oa') {
return false
}
}
if ([3,4,5,6].find(i => i === row.status)) {
if (item === 'edit') {
return false
}
}
if (row.liuchengzhuangtai === 2 || row.liuchengzhuangtai === 3) {
if (item === 'delete' || item === 'edit') {
return false
}
}
return true
},
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
const span = column["property"] + "-span";
if (row[span]) {
return row[span];
}
},
mergeData(list) {
return mergeTableRow({
data: list,
mergeColNames: ["equipment_id_equipments_id_relation.area","equipment_id_equipments_id_relation.name"], //
firstMergeColNames: ["equipment_id_equipments_id_relation.area","equipment_id_equipments_id_relation.name"], // firstMerge
firstMerge: "equipment_id", //
});
},
pickNoDistribute () {
this.$refs['xyTable'].getListData()?.forEach(item => {
console.log(item)
@ -506,7 +551,7 @@ export default {
'65aa1a442705f': row.content
}
let url =
`${process.env.VUE_APP_OA_URL}/admin/flow/create/34?diaoling_oatoken=${this.oaToken}&default_json=${JSON.stringify(jsonInfo)}`
`${process.env.VUE_APP_OA_URL}/admin/flow/create/34?diaoling_oatoken=${this.oaToken}&out_diaoling_id=${row.id}&default_json=${JSON.stringify(jsonInfo)}`
window.open(url, 'diaoling',
`top=${this.window.top},left=${this.window.left},width=${this.window.width},height=${this.window.height},location=0`
)
@ -801,6 +846,14 @@ export default {
)
);
});
this.table.unshift({
width: 100,
label: "范围",
prop: "equipment_id_equipments_id_relation.area",
formatter:(data,row,val) => {
return this.areas.find(i => i.value === val)?.key
}
});
this.table.unshift({
type: "index",
width: 60,

Loading…
Cancel
Save