fix: BUG修改

This commit is contained in:
kun 2023-09-08 19:01:18 +08:00
parent a33495c12f
commit 6db9107fe7
9 changed files with 252 additions and 58 deletions

View File

@ -341,7 +341,7 @@ const remove = (row: UploadFile) => {
if (i >= 0) {
fileList.value.splice(i, 1);
successList.value.splice(i, 1);
/** 释放创建的图像资源 */
if (row.url) window.URL.revokeObjectURL(row.url);
}
@ -464,6 +464,7 @@ const reset = () => {
* TODO: 关闭前操作
*/
const beforeClose = () => {
console.log(successList.value);
emit("update:files", [...successList.value]);
props.reset && reset();

View File

@ -593,8 +593,24 @@ const onUpload = async (row: any, index: any) => {
if (row.fileList.length > 0) {
let arr: any = [];
row.fileList.map(item => {
if (item.response) {
arr.push({
response: { ...item.response, url: item.response.url },
name: item.response.originalFilename,
url: item.response.url,
size: +item.response.size,
type: item.response.contentType
});
} else {
arr.push({
response: { ...item, url: item.fileUrl },
name: item.fileName,
url: item.fileUrl,
size: +item.fileSize,
type: item.contentType
});
}
delete item.response;
arr.push(item);
});
current.value.files = arr;
console.log(current.value.files);
@ -714,6 +730,7 @@ watch(
towerPermanentDown: "",
towerPermanentStandard: ""
};
activeName.value = "first";
}
}
);

View File

@ -117,7 +117,11 @@
prop="removeUnit"
v-if="(formData.examineState == 1 && formData.installationType == 6) || formData.installationType == 7"
>
<el-input v-model="formData.removeUnit" placeholder="请输入" :disabled="formData.installationType == 7" />
<el-input
v-model="formData.removeUnit"
placeholder="请输入"
:disabled="formData.installationType == 7 && formData.examineState == 1"
/>
</el-form-item>
<el-form-item
label="拆卸日期:"
@ -125,7 +129,7 @@
v-if="(formData.examineState == 1 && formData.installationType == 6) || formData.installationType == 7"
>
<el-date-picker
:disabled="formData.installationType == 7"
:disabled="formData.installationType == 7 && formData.examineState == 1"
style="width: 100%"
v-model="formData.removeTime"
format="YYYY-MM-DD"
@ -139,14 +143,22 @@
prop="removeContact"
v-if="(formData.examineState == 1 && formData.installationType == 6) || formData.installationType == 7"
>
<el-input v-model="formData.removeContact" placeholder="请输入" :disabled="formData.installationType == 7" />
<el-input
v-model="formData.removeContact"
placeholder="请输入"
:disabled="formData.installationType == 7 && formData.examineState == 1"
/>
</el-form-item>
<el-form-item
label="拆卸单位联系电话:"
prop="removePhone"
v-if="(formData.examineState == 1 && formData.installationType == 6) || formData.installationType == 7"
>
<el-input v-model="formData.removePhone" placeholder="请输入" :disabled="formData.installationType == 7" />
<el-input
v-model="formData.removePhone"
placeholder="请输入"
:disabled="formData.installationType == 7 && formData.examineState == 1"
/>
</el-form-item>
</el-form>
</div>
@ -392,15 +404,31 @@ const onDownLoad = async (row: any) => {
}
};
//
const onUpload = async (row: any) => {
const onUpload = async (row: any, index: any) => {
console.log(row);
showFilesUpload.value = true;
documentDataIndex.value = index;
if (row.fileList.length > 0) {
let arr: any = [];
row.fileList.map(item => {
if (item.response) {
arr.push({
response: { ...item.response, url: item.response.url },
name: item.response.originalFilename,
url: item.response.url,
size: +item.response.size,
type: item.response.contentType
});
} else {
arr.push({
response: { ...item, url: item.fileUrl },
name: item.fileName,
url: item.fileUrl,
size: +item.fileSize,
type: item.contentType
});
}
delete item.response;
arr.push(item);
});
current.value.files = arr;
console.log(current.value.files);

View File

@ -11,6 +11,7 @@
style="cursor: pointer"
v-for="(item, i) in stepOptions"
:key="item.dictCode"
:icon="item.icon"
:title="item.dictValue"
@click="changeStep(i)"
/>
@ -193,7 +194,9 @@
</el-col>
<el-col :span="12">
<el-form-item label="设备用途:" prop="equipmentUseType" required>
<el-input v-model="formData.equipmentUseType" placeholder="请输入" disabled />
<el-select v-model="formData.equipmentUseType" disabled placeholder="请选择" style="width: 100%">
<el-option v-for="item in useList" :key="item.value" :label="item.label" :value="item.value"> </el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
@ -573,11 +576,16 @@ import FilesUploadPlus from "@/components/FilesUploadPlus/FilesUpload.vue";
import DownLoad from "@/utils/annexDowload";
import type { FormInstance, FormRules } from "element-plus";
import { getRelevanceList } from "@/api/modules/common";
import { Document, Setting, MessageBox, SwitchButton } from "@element-plus/icons-vue";
const props = defineProps({
operateDialog: Boolean,
relativeId: String
});
const emits = defineEmits(["update:operateDialog"]);
const useList = ref([
{ label: "自用", value: 1 },
{ label: "租赁", value: 2 }
]);
const detailsData = ref({});
const operateTitle = ref("新增");
const formRef = ref<FormInstance>();
@ -641,11 +649,11 @@ const rules = ref({
const typeList = ref([]);
const formData = ref<any>({});
const active = ref(0),
stepOptions = ref<ResDictData["result"]>([
{ dictValue: "产权备案", dictCode: 1 },
{ dictValue: "安装拆卸", dictCode: 2 },
{ dictValue: "报废", dictCode: 3 },
{ dictValue: "注销", dictCode: 4 }
stepOptions = ref([
{ dictValue: "产权备案", dictCode: 1, icon: Document },
{ dictValue: "安装拆卸", dictCode: 2, icon: Setting },
{ dictValue: "报废", dictCode: 3, icon: MessageBox },
{ dictValue: "注销", dictCode: 4, icon: SwitchButton }
]);
const visible = ref(false);
const engineeringList = ref([]);
@ -653,14 +661,24 @@ const searchSn = ref("");
//
const disableOperate = () => {
if (active.value == 0) {
if (formData.value.equipmentType == 1 || formData.value.equipmentType == 2 || formData.value.equipmentType == 3) {
if (
formData.value.equipmentType == 1 ||
formData.value.equipmentType == 2 ||
formData.value.equipmentType == 3 ||
formData.value.equipmentType == 6 ||
formData.value.equipmentType == 7
) {
return true;
} else {
return false;
}
} else if (active.value == 1) {
if (
(formData.value.equipmentType == 1 || formData.value.equipmentType == 2 || formData.value.equipmentType == 3) &&
(formData.value.equipmentType == 1 ||
formData.value.equipmentType == 2 ||
formData.value.equipmentType == 3 ||
formData.value.equipmentType == 6 ||
formData.value.equipmentType == 7) &&
!formData.value.engineeringSn
) {
return true;
@ -668,7 +686,13 @@ const disableOperate = () => {
return false;
}
} else if (active.value == 2) {
if (formData.value.equipmentType == 1 || formData.value.equipmentType == 2 || formData.value.equipmentType == 3) {
if (
formData.value.equipmentType == 1 ||
formData.value.equipmentType == 2 ||
formData.value.equipmentType == 3 ||
formData.value.equipmentType == 6 ||
formData.value.equipmentType == 7
) {
return true;
} else {
return false;
@ -678,7 +702,9 @@ const disableOperate = () => {
formData.value.equipmentType == 1 ||
formData.value.equipmentType == 2 ||
formData.value.equipmentType == 3 ||
formData.value.equipmentType == 5
formData.value.equipmentType == 5 ||
formData.value.equipmentType == 6 ||
formData.value.equipmentType == 7
) {
return true;
} else {
@ -753,8 +779,24 @@ const onUpload = async (row: any, index: any) => {
if (row.fileList.length > 0) {
let arr: any = [];
row.fileList.map(item => {
if (item.response) {
arr.push({
response: { ...item.response, url: item.response.url },
name: item.response.originalFilename,
url: item.response.url,
size: +item.response.size,
type: item.response.contentType
});
} else {
arr.push({
response: { ...item, url: item.fileUrl },
name: item.fileName,
url: item.fileUrl,
size: +item.fileSize,
type: item.contentType
});
}
delete item.response;
arr.push(item);
});
current.value.files = arr;
console.log(current.value.files);
@ -843,19 +885,32 @@ const cancelApply = (arr: any, index: any) => {
const addApplyRecord = () => {
if (active.value == 0) {
if (activeName.value == "first") {
delayApplyRecord.value.unshift({
applyReason: "",
fileList: []
let findItem = delayApplyRecord.value.find(item => {
return item.type == "insert";
});
if (!findItem) {
delayApplyRecord.value.unshift({
applyReason: "",
fileList: [],
type: "insert"
});
}
} else {
missAppendRecord.value.unshift({
applyReason: "",
fileList: []
let findItem = missAppendRecord.value.find(item => {
return item.type == "insert";
});
if (!findItem) {
missAppendRecord.value.unshift({
applyReason: "",
fileList: [],
type: "insert"
});
}
}
} else if (active.value == 1) {
operateTitle.value = "新增";
detailsDialog.value = true;
current.value.files = [];
// operateRecord.value.unshift({
// installRegion: "",
// addTime: "",
@ -866,15 +921,27 @@ const addApplyRecord = () => {
// formRef.value[0].resetFields();
// }, 200);
} else if (active.value == 2) {
scrapRecord.value.unshift({
applyReason: "",
fileList: []
let findItem = scrapRecord.value.find(item => {
return item.type == "insert";
});
if (!findItem) {
scrapRecord.value.unshift({
applyReason: "",
fileList: [],
type: "insert"
});
}
} else if (active.value == 3) {
cancelRecord.value.unshift({
applyReason: "",
fileList: []
let findItem = cancelRecord.value.find(item => {
return item.type == "insert";
});
if (!findItem) {
cancelRecord.value.unshift({
applyReason: "",
fileList: [],
type: "insert"
});
}
}
};
// /
@ -923,6 +990,29 @@ const getApplyRecordList = async (type: number = 2) => {
operateRecord.value = result;
break;
}
} else {
switch (type) {
case 2:
//
delayApplyRecord.value = [];
break;
case 3:
//
missAppendRecord.value = [];
break;
case 4:
//
scrapRecord.value = [];
break;
case 5:
//
cancelRecord.value = [];
break;
case 6:
// /
operateRecord.value = [];
break;
}
}
};
//
@ -1048,6 +1138,7 @@ watch(
getTypeDicMainList();
getInfo();
getApplyRecordList();
active.value = 0;
}
visible.value = n;
}
@ -1365,4 +1456,11 @@ onMounted(() => {
:deep(#tab-second) {
border-radius: 0 4px 4px 0;
}
:deep() {
.el-step__head.is-finish > .el-step__line > .el-step__line-inner {
width: 100% !important;
border-width: 1px !important;
background-color: #008bff;
}
}
</style>

View File

@ -115,12 +115,15 @@ const columns: ColumnProps[] = [
prop: "equipmentType",
label: "设备状态",
enum: [
{ label: "已驳回", value: -1 },
{ label: "提交未审核", value: 0 },
{ label: "正常", value: 1 },
{ label: "产权备案", value: 1 },
{ label: "临期", value: 2 },
{ label: "延期", value: 3 },
{ label: "注销禁用", value: 4 },
{ label: "报废", value: 5 }
{ label: "报废", value: 4 },
{ label: "注销禁用", value: 5 },
{ label: "已安装", value: 6 },
{ label: "已拆卸", value: 7 }
]
},
// {

View File

@ -10,10 +10,12 @@
<el-step
style="cursor: pointer"
v-for="(item, i) in stepOptions"
:key="item.dictCode"
:key="item.dictValue"
:icon="item.icon"
:title="item.dictValue"
@click="changeStep(i)"
/>
>
</el-step>
</el-steps>
</div>
<div class="info-data" v-if="active != 1">
@ -187,7 +189,9 @@
</el-col>
<el-col :span="12">
<el-form-item label="设备用途:" prop="equipmentUseType" required>
<el-input v-model="formData.equipmentUseType" placeholder="请输入" />
<el-select v-model="formData.equipmentUseType" disabled placeholder="请选择" style="width: 100%">
<el-option v-for="item in useList" :key="item.value" :label="item.label" :value="item.value"> </el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
@ -481,8 +485,16 @@
</div>
<template #footer>
<span class="audit-footer">
<el-button v-if="active == 0" class="btn btn-cancel" @click="applyAudit(2, formData)">驳回</el-button>
<el-button v-if="active == 0" class="btn btn-submit" type="primary" @click="applyAudit(1, formData)">通过</el-button>
<el-button v-if="active == 0 && formData.equipmentType == 0" class="btn btn-cancel" @click="applyAudit(2, formData)"
>驳回</el-button
>
<el-button
v-if="active == 0 && formData.equipmentType == 0"
class="btn btn-submit"
type="primary"
@click="applyAudit(1, formData)"
>通过</el-button
>
</span>
</template>
</el-dialog>
@ -537,11 +549,16 @@ import FilesUploadPlus from "@/components/FilesUploadPlus/FilesUpload.vue";
import DownLoad from "@/utils/annexDowload";
import type { FormInstance, FormRules } from "element-plus";
import { getRelevanceList } from "@/api/modules/common";
import { Document, Setting, MessageBox, SwitchButton } from "@element-plus/icons-vue";
const props = defineProps({
operateDialog: Boolean,
relativeId: String
});
const emits = defineEmits(["update:operateDialog", "confirm"]);
const useList = ref([
{ label: "自用", value: 1 },
{ label: "租赁", value: 2 }
]);
const detailsData = ref({});
const operateTitle = ref("新增");
const formRef = ref<FormInstance>();
@ -605,11 +622,11 @@ const rules = ref({
const typeList = ref([]);
const formData = ref<any>({});
const active = ref(0),
stepOptions = ref<ResDictData["result"]>([
{ dictValue: "产权备案", dictCode: 1 },
{ dictValue: "安装拆卸", dictCode: 2 },
{ dictValue: "报废", dictCode: 3 },
{ dictValue: "注销", dictCode: 4 }
stepOptions = ref([
{ dictValue: "产权备案", dictCode: 1, icon: Document },
{ dictValue: "安装拆卸", dictCode: 2, icon: Setting },
{ dictValue: "报废", dictCode: 3, icon: MessageBox },
{ dictValue: "注销", dictCode: 4, icon: SwitchButton }
]);
const visible = ref(false);
const engineeringList = ref([]);
@ -630,7 +647,7 @@ const applyAudit = async (state: number, obj: any) => {
} else {
getApplyRecordList(requestData.type);
}
if (requestData.type == 1) {
if (formData.value.equipmentType == 0) {
visible.value = false;
emits("confirm");
}
@ -873,6 +890,7 @@ watch(
getTypeDicMainList();
getInfo();
getApplyRecordList();
active.value = 0;
}
visible.value = n;
}
@ -1199,4 +1217,11 @@ onMounted(() => {
:deep(#tab-second) {
border-radius: 0 4px 4px 0;
}
:deep() {
.el-step__head.is-finish > .el-step__line > .el-step__line-inner {
width: 100% !important;
border-width: 1px !important;
background-color: #008bff;
}
}
</style>

View File

@ -159,12 +159,15 @@ const columns: ColumnProps[] = [
prop: "equipmentType",
label: "设备状态",
enum: [
{ label: "已驳回", value: -1 },
{ label: "提交未审核", value: 0 },
{ label: "正常", value: 1 },
{ label: "产权备案", value: 1 },
{ label: "临期", value: 2 },
{ label: "延期", value: 3 },
{ label: "注销禁用", value: 4 },
{ label: "报废", value: 5 }
{ label: "报废", value: 4 },
{ label: "注销禁用", value: 5 },
{ label: "已安装", value: 6 },
{ label: "已拆卸", value: 7 }
]
},
// {
@ -276,7 +279,7 @@ const getTableList = (params: any) => {
delete newParams.timeLimit;
}
if (selectedIndex.value != 0) {
newParams.identification = statisticsOption.value[selectedIndex.value].value;
newParams.equipmentType = statisticsOption.value[selectedIndex.value].value;
}
return hoistEquipPage(newParams);
};

View File

@ -11,6 +11,7 @@
style="cursor: pointer"
v-for="(item, i) in stepOptions"
:key="item.dictCode"
:icon="item.icon"
:title="item.dictValue"
@click="changeStep(i)"
/>
@ -187,7 +188,9 @@
</el-col>
<el-col :span="12">
<el-form-item label="设备用途:" prop="equipmentUseType" required>
<el-input v-model="formData.equipmentUseType" placeholder="请输入" />
<el-select v-model="formData.equipmentUseType" disabled placeholder="请选择" style="width: 100%">
<el-option v-for="item in useList" :key="item.value" :label="item.label" :value="item.value"> </el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
@ -510,11 +513,16 @@ import FilesUploadPlus from "@/components/FilesUploadPlus/FilesUpload.vue";
import DownLoad from "@/utils/annexDowload";
import type { FormInstance, FormRules } from "element-plus";
import { getRelevanceList } from "@/api/modules/common";
import { Document, Setting, MessageBox, SwitchButton } from "@element-plus/icons-vue";
const props = defineProps({
operateDialog: Boolean,
relativeId: String
});
const emits = defineEmits(["update:operateDialog"]);
const useList = ref([
{ label: "自用", value: 1 },
{ label: "租赁", value: 2 }
]);
const detailsData = ref({});
const operateTitle = ref("新增");
const formRef = ref<FormInstance>();
@ -578,11 +586,11 @@ const rules = ref({
const typeList = ref([]);
const formData = ref<any>({});
const active = ref(0),
stepOptions = ref<ResDictData["result"]>([
{ dictValue: "产权备案", dictCode: 1 },
{ dictValue: "安装拆卸", dictCode: 2 },
{ dictValue: "报废", dictCode: 3 },
{ dictValue: "注销", dictCode: 4 }
stepOptions = ref([
{ dictValue: "产权备案", dictCode: 1, icon: Document },
{ dictValue: "安装拆卸", dictCode: 2, icon: Setting },
{ dictValue: "报废", dictCode: 3, icon: MessageBox },
{ dictValue: "注销", dictCode: 4, icon: SwitchButton }
]);
const visible = ref(false);
const engineeringList = ref([]);
@ -816,6 +824,7 @@ watch(
getTypeDicMainList();
getInfo();
getApplyRecordList();
active.value = 0;
}
visible.value = n;
}
@ -1142,4 +1151,11 @@ onMounted(() => {
:deep(#tab-second) {
border-radius: 0 4px 4px 0;
}
:deep() {
.el-step__head.is-finish > .el-step__line > .el-step__line-inner {
width: 100% !important;
border-width: 1px !important;
background-color: #008bff;
}
}
</style>

View File

@ -121,12 +121,15 @@ const columns: ColumnProps[] = [
prop: "equipmentType",
label: "设备状态",
enum: [
{ label: "已驳回", value: -1 },
{ label: "提交未审核", value: 0 },
{ label: "正常", value: 1 },
{ label: "产权备案", value: 1 },
{ label: "临期", value: 2 },
{ label: "延期", value: 3 },
{ label: "注销禁用", value: 4 },
{ label: "报废", value: 5 }
{ label: "报废", value: 4 },
{ label: "注销禁用", value: 5 },
{ label: "已安装", value: 6 },
{ label: "已拆卸", value: 7 }
]
},
// {