任务清单-->日常任务包列表处理 下发任务 修改任务处理
This commit is contained in:
@ -23,7 +23,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import axios from "axios";
|
||||
import request from "@/utils/request";
|
||||
import { ElMessage } from "element-plus";
|
||||
import { qcckPost, qcckGet } from "@/api/qcckApi.js";
|
||||
import { useStore } from "vuex";
|
||||
@ -62,6 +62,10 @@ watch(() => props.lx, (val) => {
|
||||
baseUrl.value = '/mosty-api/mosty-jcgl/tpjcglZnzb/importData'
|
||||
modelUrl.value = '/mosty-api/mosty-jcgl/tpjcglZnzb/importTemplate'
|
||||
break;
|
||||
case 'rcrwb':
|
||||
baseUrl.value = '/mosty-api/mosty-yjzl/tbZdxlFgxlrw/importListByMb'
|
||||
// modelUrl.value = '/mosty-api/mosty-jcgl/tpjcglZnzb/importTemplate'
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -100,6 +104,14 @@ function downloadModel() {
|
||||
window.open(modelUrl.value, "_self");
|
||||
}
|
||||
|
||||
const upload = (data) => {
|
||||
return request({
|
||||
url: baseUrl.value,
|
||||
method: "POST",
|
||||
headers: { "Content-type": "multipart/form-data" },
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
// 确定上传
|
||||
function onComfirm() {
|
||||
if (filesList.value.length <= 0) {
|
||||
@ -109,10 +121,18 @@ function onComfirm() {
|
||||
let formData = new FormData();
|
||||
formData.append("file", file);
|
||||
formData.append("updateSupport", isSelect.value);
|
||||
axios.post(baseUrl.value, formData, { "Content-type": "multipart/form-data" })
|
||||
upload(formData)
|
||||
.then((res) => {
|
||||
if (res.status == 200) {
|
||||
let { data, message, code } = res.data;
|
||||
if (res.status == 200 || res) {
|
||||
if (!res?.data) {
|
||||
if (!res) ElMessage({ type: 'warning', message: message, dangerouslyUseHTMLString: true });
|
||||
if (res) ElMessage({ type: 'success', message: '导入成功', dangerouslyUseHTMLString: true });
|
||||
|
||||
emits("handleImport");
|
||||
handleClose();
|
||||
return
|
||||
}
|
||||
let { data, message, code } = res?.data;
|
||||
if (code == -1) ElMessage({ type: 'warning', message: message, dangerouslyUseHTMLString: true });
|
||||
if (code == 10000) ElMessage({ type: 'success', message: data, dangerouslyUseHTMLString: true });
|
||||
emits("handleImport");
|
||||
@ -166,4 +186,4 @@ function onComfirm() {
|
||||
.el-upload-list__item-name {
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user