| | |
| | | <Maintain ref="seeRef" @myadd="onMaintainAdd"/> |
| | | <Inspect ref="spectRef" @myadd="onInspectAdd"/> |
| | | <OpenAdd ref="addRef" @myAdd="onMyAdd" /> |
| | | <OpenEdit ref="editRef" @myAdd="onMyAdds" /> |
| | | <!-- <upData ref="upShow"></upData>--> |
| | | </div> |
| | | </template> |
| | |
| | | import OpenAdd from '/@/views/contingencyManagement/emergencyResources/emergencySupplies/component/openAdd.vue'; |
| | | import Maintain from '/@/views/contingencyManagement/emergencyResources/emergencySupplies/component/maintain.vue'; |
| | | import Inspect from '/@/views/contingencyManagement/emergencyResources/emergencySupplies/component/inspect.vue'; |
| | | import OpenEdit from '/@/views/contingencyManagement/emergencyResources/emergencySupplies/component/openEdit.vue'; |
| | | import UpData from '/@/views/contingencyManagement/panManagement/component/upData.vue'; |
| | | import {emergencySuppliesApi} from '/@/api/emergencyResources'; |
| | | |
| | |
| | | components: { |
| | | OpenAdd, |
| | | Maintain, |
| | | // OpenEdit, |
| | | View, |
| | | OpenEdit, |
| | | EditPen, |
| | | Plus, |
| | | Edit, |
| | |
| | | UpData, |
| | | }, |
| | | setup() { |
| | | // const multipleTableRef = ref<InstanceType<typeof ElTable>>(); |
| | | // const multipleSelection = ref<User[]>([]); |
| | | // 列表参数 |
| | | const listQuery = reactive({ |
| | | pageIndex: 1, |
| | |
| | | for (let i = 0; i < valId.length; i++) { |
| | | arr.push(valId[i].id); |
| | | } |
| | | deletAll.value = arr.toString(); |
| | | deletAll.value = arr; |
| | | // console.log(deletAll.value); |
| | | if (val.length == 1) { |
| | | warning.value = false; |
| | |
| | | } |
| | | }; |
| | | // 打开修改用户弹窗 |
| | | const editRef = ref(); |
| | | const onEdit = (val: string, row: object) => { |
| | | if (val == '详情') { |
| | | addRef.value.openDialog('查看应急物资代码',row,true); |
| | | editRef.value.openDialog('查看应急物资代码',row,true); |
| | | } else { |
| | | addRef.value.openDialog('修改应急物资代码',row,false); |
| | | editRef.value.openDialog('修改应急物资代码',row,false); |
| | | } |
| | | }; |
| | | // 新增后刷新 |
| | | const onMyAdds = (e: boolean) => { |
| | | if (e) { |
| | | listApi(); |
| | | } else { |
| | | listApi(); |
| | | } |
| | | }; |
| | | // 删除用户 |
| | | const onRowDel = (data: any) => { |
| | | const onRowDel = (id: number) => { |
| | | let arr = []; |
| | | arr.push(id) |
| | | ElMessageBox.confirm('确定删除所选项吗?', '提示', { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: '取消', |
| | |
| | | }) |
| | | .then(() => { |
| | | emergencySuppliesApi() |
| | | .deleteEmergencySupplies(data) |
| | | .deleteEmergencySupplies(arr) |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | ElMessage({ |
| | |
| | | listQuery.pageIndex = val; |
| | | }; |
| | | return { |
| | | // multipleSelection, |
| | | // multipleTableRef, |
| | | // upButton, |
| | | // upShow, |
| | | tableData, |
| | |
| | | submitReset, |
| | | onMyAdd, |
| | | onEdit, |
| | | editRef, |
| | | onDeleteAll, |
| | | handleSelectionChange, |
| | | warning, |
| | |
| | | onInspect, |
| | | onMaintainAdd, |
| | | onInspectAdd, |
| | | onMyAdds, |
| | | }; |
| | | }, |
| | | }); |