|
@@ -36,6 +36,12 @@ import {Close, Delete, Edit, Plus, SuccessFilled} from "@element-plus/icons-vue"
|
|
|
import DiyElForm from "@/components/common/DiyElForm.vue";
|
|
|
import {computed, onBeforeMount, ref} from "vue";
|
|
|
import {MemorandumManageForm} from "@/data/all-form";
|
|
|
+import {elAlert, handleMes} from "@/units/element-ui/tip";
|
|
|
+import axios from "axios";
|
|
|
+import {
|
|
|
+ proInsertXyxxBwl,
|
|
|
+ proUpdateXyxxBwl
|
|
|
+} from "@/service/policy-and-regulation-manage/memorandum-manage/memorandum-manage";
|
|
|
export default {
|
|
|
name: "MemorandumManageSettingDialog",
|
|
|
components:{DiyElForm},
|
|
@@ -77,6 +83,7 @@ export default {
|
|
|
form.value = {
|
|
|
...props.currentDialogObj
|
|
|
}
|
|
|
+ form.value.slt = props.currentDialogObj.NAME;
|
|
|
})
|
|
|
function onChange(files){
|
|
|
debugger
|
|
@@ -88,7 +95,7 @@ export default {
|
|
|
formDialogRef.value.refEl.validate(isValid => {
|
|
|
if (isValid){
|
|
|
debugger
|
|
|
- if(!form.value.UUID){
|
|
|
+ if(!props.currentDialogObj.CODE){
|
|
|
let month = new Date().getMonth() + 1 < 10 ? "0" + (new Date().getMonth() + 1) : new Date().getMonth() + 1;
|
|
|
let strDate = new Date().getDate() < 10 ? "0" + new Date().getDate() : new Date().getDate();
|
|
|
let time4 = new Date().getFullYear() + "-" + month + "-" + strDate;
|
|
@@ -98,11 +105,49 @@ export default {
|
|
|
let formData = new FormData();
|
|
|
formData.append("file",file.value.raw);
|
|
|
formData.append("fileName",fileName + suffixName);
|
|
|
- formData.append("type",form.value.TYPE)
|
|
|
+ formData.append("type","bwl")
|
|
|
+ axios.post('http://localhost:8081/upload/xypt',formData,{'Content-type':'multipart/form-data'}).then(res =>{
|
|
|
+ console.log(res);
|
|
|
+ if(res.data[0].success=='true'){
|
|
|
+ insertBwl(fileName,suffixName)
|
|
|
+ }else{
|
|
|
+ elAlert("文件上传失败")
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ updateBwl()
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+ function insertBwl(fileName,suffixName){
|
|
|
+ proInsertXyxxBwl({
|
|
|
+ wenhao: form.value.WENHAO,
|
|
|
+ name: form.value.NAME,
|
|
|
+ username: localStorage.getItem("xyxx_username"),
|
|
|
+ suffixName: suffixName,
|
|
|
+ fileName: fileName,
|
|
|
+ }).then(res =>{
|
|
|
+ handleMes(res,() => {
|
|
|
+ emit('getTableData');
|
|
|
+ handleClose()
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ function updateBwl(){
|
|
|
+ proUpdateXyxxBwl({
|
|
|
+ code:props.currentDialogObj.CODE,
|
|
|
+ wenhao: form.value.WENHAO,
|
|
|
+ name: form.value.NAME,
|
|
|
+ suffixName: "",
|
|
|
+ fileName: "",
|
|
|
+ }).then(res =>{
|
|
|
+ handleMes(res,() => {
|
|
|
+ emit('getTableData');
|
|
|
+ handleClose()
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
function handleClose(){
|
|
|
emit('update:dialogVisible',false);
|
|
|
}
|