1、基础数据修复bug
2、客商模块修复bug
This commit is contained in:
@@ -24,10 +24,9 @@
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
plain
|
||||
v-if="hasPermission('process_config_add')"
|
||||
@click="$refs.crud.rowAdd()"
|
||||
>新增
|
||||
>新建过程配置
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
@@ -53,13 +52,23 @@
|
||||
</el-tag>
|
||||
</template>
|
||||
|
||||
<template #includedNodes="{ row }">
|
||||
<span class="process-config-page__node-value">
|
||||
{{ formatProcessNodes(row.includedNodes) }}
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<template #basicInfo-form>
|
||||
<div class="process-config-page__section">
|
||||
<div class="dialog-section-title">基本信息</div>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12">
|
||||
<el-col :span="8">
|
||||
<div class="process-config-page__field">
|
||||
<span class="process-config-page__field-label">配置名称</span>
|
||||
<span
|
||||
class="process-config-page__field-label process-config-page__field-label--required"
|
||||
>
|
||||
配置名称
|
||||
</span>
|
||||
<el-input
|
||||
v-model="form.configName"
|
||||
:disabled="dialogReadonly"
|
||||
@@ -68,9 +77,13 @@
|
||||
/>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-col :span="8">
|
||||
<div class="process-config-page__field">
|
||||
<span class="process-config-page__field-label">项目</span>
|
||||
<span
|
||||
class="process-config-page__field-label process-config-page__field-label--required"
|
||||
>
|
||||
项目
|
||||
</span>
|
||||
<el-select
|
||||
v-model="selectedProjectId"
|
||||
clearable
|
||||
@@ -92,33 +105,33 @@
|
||||
</el-select>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-col :span="8">
|
||||
<div class="process-config-page__field">
|
||||
<span class="process-config-page__field-label">默认后台完成运输天数</span>
|
||||
<span class="process-config-page__field-label">运输完成时限</span>
|
||||
<div class="process-config-page__finish-days">
|
||||
<span>默认</span>
|
||||
<el-input
|
||||
v-model="form.defaultFinishDays"
|
||||
:disabled="dialogReadonly"
|
||||
maxlength="3"
|
||||
placeholder="X"
|
||||
placeholder="请输入"
|
||||
@input="handleFinishDaysInput"
|
||||
/>
|
||||
<span>天后台完成运输</span>
|
||||
<span>天后完成运输</span>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-col :span="24">
|
||||
<div class="process-config-page__field">
|
||||
<span class="process-config-page__field-label">备注</span>
|
||||
<el-input
|
||||
v-model="form.remark"
|
||||
:disabled="dialogReadonly"
|
||||
:rows="3"
|
||||
maxlength="500"
|
||||
placeholder="请输入"
|
||||
show-word-limit
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
:disabled="dialogReadonly"
|
||||
maxlength="500"
|
||||
show-word-limit
|
||||
placeholder="请输入"
|
||||
/>
|
||||
</div>
|
||||
</el-col>
|
||||
@@ -196,7 +209,7 @@
|
||||
<el-radio-group
|
||||
v-model="row.confirmMode"
|
||||
:disabled="dialogReadonly || !row.enabled"
|
||||
@change="syncNodeFields"
|
||||
@change="handleReturnConfirmChange(row)"
|
||||
>
|
||||
<el-radio label="yes">是</el-radio>
|
||||
<el-radio label="no_confirm_complete">无需确认完成</el-radio>
|
||||
@@ -390,6 +403,7 @@
|
||||
<script>
|
||||
import * as api from '@/api/business/process-config';
|
||||
import { getList as getProjectList } from '@/api/business/project-apply';
|
||||
import { getDeptTree } from '@/api/system/dept';
|
||||
import { exportBlob } from '@/api/common';
|
||||
import { config, option } from '@/option/business/process-config';
|
||||
import { getToken } from '@/utils/auth';
|
||||
@@ -513,11 +527,35 @@ export default {
|
||||
created() {
|
||||
this.resetNodeRows();
|
||||
this.loadProjectOptions('');
|
||||
this.initDeptOptions();
|
||||
},
|
||||
methods: {
|
||||
hasPermission(code) {
|
||||
return this.isAdmin || this.validData(this.permission && this.permission[code], false);
|
||||
},
|
||||
handleReturnConfirmChange(row) {
|
||||
row.confirmInternal = row.confirmMode === 'yes';
|
||||
this.syncNodeFields();
|
||||
},
|
||||
initDeptOptions() {
|
||||
getDeptTree(this.userInfo.tenantId).then(res => {
|
||||
const deptColumn = this.findColumn(this.option.column, 'searchDeptId');
|
||||
if (deptColumn) {
|
||||
deptColumn.dicData = this.flattenDept(res.data.data || []);
|
||||
}
|
||||
});
|
||||
},
|
||||
flattenDept(tree, level = 0) {
|
||||
return tree.flatMap(item => [
|
||||
{
|
||||
label: `${' '.repeat(level)}${item.title || item.deptName || item.name}`,
|
||||
value: item.id,
|
||||
},
|
||||
...(item.children && item.children.length
|
||||
? this.flattenDept(item.children, level + 1)
|
||||
: []),
|
||||
]);
|
||||
},
|
||||
displayStatus(status) {
|
||||
const statusMap = {
|
||||
0: '草稿',
|
||||
@@ -526,6 +564,13 @@ export default {
|
||||
};
|
||||
return statusMap[status] || status || '未知';
|
||||
},
|
||||
formatProcessNodes(nodes) {
|
||||
return String(nodes || '')
|
||||
.split(/[,,]/)
|
||||
.map(item => item.trim())
|
||||
.filter(Boolean)
|
||||
.join('-');
|
||||
},
|
||||
statusTagType(status) {
|
||||
if (status === 1) return 'success';
|
||||
if (status === 2) return 'info';
|
||||
@@ -558,7 +603,7 @@ export default {
|
||||
voucherTypes: [],
|
||||
frequencyDays: '1',
|
||||
timeStart: '00:00',
|
||||
timeEnd: '24:00',
|
||||
timeEnd: '23:59',
|
||||
supportCargo: false,
|
||||
supportVoucher: false,
|
||||
voucherOptions: [],
|
||||
@@ -705,7 +750,7 @@ export default {
|
||||
result.push(`打卡定位:${node.location ? '是' : '否'}`);
|
||||
if (node.punch) {
|
||||
result.push(`打卡频次:每${node.frequencyDays || 1}天打卡1次`);
|
||||
result.push(`打卡时段:${node.timeStart || '00:00'}-${node.timeEnd || '24:00'}`);
|
||||
result.push(`打卡时段:${node.timeStart || '00:00'}-${node.timeEnd || '23:59'}`);
|
||||
}
|
||||
} else {
|
||||
result.push(`打卡操作:${node.punch ? '是' : '否'}`);
|
||||
@@ -744,9 +789,15 @@ export default {
|
||||
this.$message.warning('项目不能为空');
|
||||
return false;
|
||||
}
|
||||
if (row.defaultFinishDays && !/^[1-9]\d{0,2}$/.test(String(row.defaultFinishDays))) {
|
||||
this.$message.warning('请输入正整数');
|
||||
return false;
|
||||
if (row.defaultFinishDays !== undefined && row.defaultFinishDays !== '') {
|
||||
if (!Number.isInteger(Number(row.defaultFinishDays)) || Number(row.defaultFinishDays) < 0) {
|
||||
this.$message.warning('完成天数不能小于0');
|
||||
return false;
|
||||
}
|
||||
if (Number(row.defaultFinishDays) > 999) {
|
||||
this.$message.warning('完成天数不能超过999');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (row.remark && row.remark.length > 500) {
|
||||
this.$message.warning('备注不能超过500个字符');
|
||||
@@ -774,43 +825,61 @@ export default {
|
||||
loading();
|
||||
}
|
||||
},
|
||||
rowSave(row, done, loading) {
|
||||
this.syncNodeFields();
|
||||
const submitRow = this.normalizeRow(row);
|
||||
if (!this.validateRow(submitRow)) {
|
||||
this.stopSubmitLoading(loading);
|
||||
return;
|
||||
needsDuplicateVoucherConfirm() {
|
||||
const signNode = this.nodeRows.find(item => item.key === 'sign');
|
||||
const returnNode = this.nodeRows.find(item => item.key === 'return');
|
||||
const hasSignVoucher =
|
||||
signNode &&
|
||||
signNode.enabled &&
|
||||
signNode.uploadVoucher &&
|
||||
signNode.voucherTypes.includes('签收单');
|
||||
const hasReturnVoucher =
|
||||
returnNode &&
|
||||
returnNode.enabled &&
|
||||
returnNode.uploadVoucher &&
|
||||
returnNode.voucherTypes.includes('签收单');
|
||||
return hasSignVoucher && hasReturnVoucher;
|
||||
},
|
||||
confirmDuplicateVoucher() {
|
||||
if (!this.needsDuplicateVoucherConfirm()) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
api.submit(submitRow).then(
|
||||
() => {
|
||||
this.onLoad(this.page);
|
||||
this.$message({ type: 'success', message: '操作成功!' });
|
||||
done();
|
||||
},
|
||||
error => {
|
||||
window.console.log(error);
|
||||
this.stopSubmitLoading(loading);
|
||||
return this.$confirm(
|
||||
'签收与回单同时勾选了上传凭证,司机将需重复上传凭证,是否确认?',
|
||||
'提示',
|
||||
{
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
);
|
||||
},
|
||||
rowUpdate(row, index, done, loading) {
|
||||
submitRow(row, done, loading) {
|
||||
this.syncNodeFields();
|
||||
const submitRow = this.normalizeRow(row);
|
||||
if (!this.validateRow(submitRow)) {
|
||||
this.stopSubmitLoading(loading);
|
||||
return;
|
||||
}
|
||||
api.submit(submitRow).then(
|
||||
() => {
|
||||
this.confirmDuplicateVoucher()
|
||||
.then(() => api.submit(submitRow))
|
||||
.then(() => {
|
||||
this.onLoad(this.page);
|
||||
this.$message({ type: 'success', message: '操作成功!' });
|
||||
done();
|
||||
},
|
||||
error => {
|
||||
window.console.log(error);
|
||||
})
|
||||
.catch(error => {
|
||||
if (error !== 'cancel' && error !== 'close') {
|
||||
window.console.log(error);
|
||||
}
|
||||
this.stopSubmitLoading(loading);
|
||||
}
|
||||
);
|
||||
});
|
||||
},
|
||||
rowSave(row, done, loading) {
|
||||
this.submitRow(row, done, loading);
|
||||
},
|
||||
rowUpdate(row, index, done, loading) {
|
||||
this.submitRow(row, done, loading);
|
||||
},
|
||||
rowDel(row) {
|
||||
this.$confirm('确定将选择数据删除?', {
|
||||
@@ -914,7 +983,11 @@ export default {
|
||||
onLoad(page, params = {}) {
|
||||
this.loading = true;
|
||||
api
|
||||
.getList(page.currentPage, page.pageSize, { ...params, ...this.query, allDept: 0 })
|
||||
.getList(page.currentPage, page.pageSize, {
|
||||
...params,
|
||||
...this.query,
|
||||
allDept: this.isAdmin ? 1 : 0,
|
||||
})
|
||||
.then(res => {
|
||||
const result = res.data.data || {};
|
||||
this.page.total = result.total || 0;
|
||||
@@ -928,7 +1001,7 @@ export default {
|
||||
buildExportParams() {
|
||||
return {
|
||||
...this.query,
|
||||
allDept: 0,
|
||||
allDept: this.isAdmin ? 1 : 0,
|
||||
ids: this.ids,
|
||||
[this.website.tokenHeader]: getToken(),
|
||||
};
|
||||
@@ -1004,6 +1077,17 @@ export default {
|
||||
font-weight: 500;
|
||||
text-align: right;
|
||||
white-space: nowrap;
|
||||
|
||||
&--required::before {
|
||||
margin-right: 4px;
|
||||
color: #f56c6c;
|
||||
content: '*';
|
||||
}
|
||||
}
|
||||
|
||||
&__node-value {
|
||||
white-space: normal;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
&__finish-days {
|
||||
|
||||
Reference in New Issue
Block a user