1 parent
f583bb5932
commit
d9a4383cd1
2 files changed
+121
-1
No files matched your search
@@ -140,7 +140,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="录音" prop="recordCount" width="70" align="center" />
|
||||
<el-table-column label="操作" width="210" fixed="right">
|
||||
<el-table-column label="操作" width="280" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
@@ -149,6 +149,15 @@
|
||||
@click="handleDetail(scope.row)"
|
||||
v-hasPermi="['apt:jcxx:query']"
|
||||
>详情</el-button>
|
||||
<el-button
|
||||
v-if="canRecall(scope.row)"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-refresh-left"
|
||||
:loading="recallingId === scope.row.id"
|
||||
@click="handleRecall(scope.row)"
|
||||
v-hasPermi="['apt:jcxx:changeStatus']"
|
||||
>复叫</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
@@ -308,6 +317,7 @@ export default {
|
||||
return {
|
||||
loading: false,
|
||||
submitting: false,
|
||||
recallingId: null,
|
||||
detailLoading: false,
|
||||
showSearch: true,
|
||||
errorText: '',
|
||||
@@ -440,6 +450,53 @@ export default {
|
||||
return 'info'
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 复叫可用性:与后端 apt.duty.state 的 RE_CALL 口径保持一致。
|
||||
* 1) 已应答待离寓(ryzt=3,finish_jc 必然为 1):允许再叫一轮;
|
||||
* 2) 已停止(stoped=1) 或 叫乘报警(ryzt=2) 且叫乘未完成;
|
||||
* 3) 已离寓(finish_ly=1)一律不可复叫。
|
||||
*/
|
||||
canRecall(row) {
|
||||
if (!row || String(row.finishLy) === '1') {
|
||||
return false
|
||||
}
|
||||
const ryzt = String(row.ryzt)
|
||||
const finishJc = String(row.finishJc)
|
||||
if (ryzt === '3' && finishJc === '1') {
|
||||
return true
|
||||
}
|
||||
return finishJc === '0' && (String(row.stoped) === '1' || ryzt === '2')
|
||||
},
|
||||
handleRecall(row) {
|
||||
this.$modal
|
||||
.confirm('确定为该记录发起复叫?系统将先呼叫值班员,再呼叫房间。')
|
||||
.then(() => {
|
||||
this.recallingId = row.id
|
||||
return submitJcxxCommand(row.id, {
|
||||
commandId: 'UIR-' + Date.now() + '-' + Math.random().toString(36).slice(2, 8),
|
||||
command: 'RE_CALL',
|
||||
reason: '管理端手动复叫'
|
||||
})
|
||||
})
|
||||
.then(response => {
|
||||
const result = (response && response.data) || {}
|
||||
this.$modal.msgSuccess(
|
||||
result.duplicated ? '命令重复,已按幂等处理(未再次复叫)' : '复叫已提交:' + (result.stateAfter || '')
|
||||
)
|
||||
this.getList()
|
||||
})
|
||||
.catch(error => {
|
||||
// 取消确认框时不提示业务错误
|
||||
if (error === 'cancel' || error === 'close') {
|
||||
return
|
||||
}
|
||||
const picked = pickAptError(error)
|
||||
this.$modal.msgError(formatAptError(picked.code, picked.reason))
|
||||
})
|
||||
.finally(() => {
|
||||
this.recallingId = null
|
||||
})
|
||||
},
|
||||
openCommand(row) {
|
||||
this.currentRow = row
|
||||
this.commandForm = { command: 'STOP', leaveType: 'MANUAL', reason: '' }
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
-- =============================================================================
|
||||
-- IT-7 叫乘记录三时间字段(可重放)
|
||||
-- 依据:叫乘任务要求「每条记录包含 叫乘时间 / 复叫时间 / 应离寓时间」,
|
||||
-- 到点分别触发:首轮呼叫、自动复叫、离寓报警。
|
||||
-- 口径:
|
||||
-- 1) jcsj 已存在(叫乘时间,权威);本次只补 fjsj(复叫时间,计划)与
|
||||
-- ylysj(应离寓时间);
|
||||
-- 2) fjsj 与既有 fjsj_s 分工:fjsj=计划复叫时间(到点判定),
|
||||
-- fjsj_s=实际复叫时刻(执行留痕,防重复触发);
|
||||
-- 3) ryzt / finish_jc / finish_ly / stoped 仍只有 apt.duty.state 一个写入口,
|
||||
-- 本脚本不写任何业务数据;
|
||||
-- 4) 幂等:补列走 apt_add_column_if_missing,索引先查 information_schema。
|
||||
-- =============================================================================
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- 1. gy_jcxx 三时间字段补齐
|
||||
-- -----------------------------------------------------------------------------
|
||||
CALL apt_add_column_if_missing('gy_jcxx', 'fjsj',
|
||||
"fjsj DATETIME(3) NULL COMMENT '复叫时间(计划;到点自动复叫)'");
|
||||
|
||||
CALL apt_add_column_if_missing('gy_jcxx', 'ylysj',
|
||||
"ylysj DATETIME(3) NULL COMMENT '应离寓时间(到点未离寓转离寓报警)'");
|
||||
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- 2. 到点扫描索引(复叫到点 + 应离寓超时)
|
||||
-- -----------------------------------------------------------------------------
|
||||
SET @apt_idx_fjsj = (SELECT COUNT(*) FROM information_schema.STATISTICS
|
||||
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'gy_jcxx'
|
||||
AND INDEX_NAME = 'idx_jcxx_fjsj');
|
||||
SET @apt_sql_fjsj = IF(@apt_idx_fjsj = 0,
|
||||
'ALTER TABLE gy_jcxx ADD KEY idx_jcxx_fjsj (gyid, fjsj)',
|
||||
'SELECT 1');
|
||||
PREPARE apt_stmt_fjsj FROM @apt_sql_fjsj;
|
||||
EXECUTE apt_stmt_fjsj;
|
||||
DEALLOCATE PREPARE apt_stmt_fjsj;
|
||||
|
||||
SET @apt_idx_ylysj = (SELECT COUNT(*) FROM information_schema.STATISTICS
|
||||
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'gy_jcxx'
|
||||
AND INDEX_NAME = 'idx_jcxx_ylysj');
|
||||
SET @apt_sql_ylysj = IF(@apt_idx_ylysj = 0,
|
||||
'ALTER TABLE gy_jcxx ADD KEY idx_jcxx_ylysj (gyid, ylysj)',
|
||||
'SELECT 1');
|
||||
PREPARE apt_stmt_ylysj FROM @apt_sql_ylysj;
|
||||
EXECUTE apt_stmt_ylysj;
|
||||
DEALLOCATE PREPARE apt_stmt_ylysj;
|
||||
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- 3. 校验
|
||||
-- -----------------------------------------------------------------------------
|
||||
SELECT '=== IT-7 gy_jcxx 三时间字段(应 3:jcsj / fjsj / ylysj)===' AS section;
|
||||
SELECT COLUMN_NAME, COLUMN_TYPE, IS_NULLABLE, COLUMN_COMMENT
|
||||
FROM information_schema.COLUMNS
|
||||
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'gy_jcxx'
|
||||
AND COLUMN_NAME IN ('jcsj','fjsj','ylysj')
|
||||
ORDER BY COLUMN_NAME;
|
||||
|
||||
SELECT '=== IT-7 到点扫描索引(应 2)===' AS section;
|
||||
SELECT TABLE_NAME, INDEX_NAME, GROUP_CONCAT(COLUMN_NAME ORDER BY SEQ_IN_INDEX) AS cols
|
||||
FROM information_schema.STATISTICS
|
||||
WHERE TABLE_SCHEMA = DATABASE()
|
||||
AND INDEX_NAME IN ('idx_jcxx_fjsj','idx_jcxx_ylysj')
|
||||
GROUP BY TABLE_NAME, INDEX_NAME;
|
||||
Reference in new issue
Block a user