删除草稿箱,编辑对话框

zhangtao
laozt 1 year ago
parent 3da23d1037
commit 56433015b2

@ -20,7 +20,7 @@ export function getEnterprise(id) {
// 新增计划企业 // 新增计划企业
export function addEnterprise(data) { export function addEnterprise(data) {
return request({ return request({
url: '/system/enterprise', url: '/pharmaceuticals/bPlanEnterprise',
method: 'post', method: 'post',
data: data data: data
}) })
@ -29,7 +29,7 @@ export function addEnterprise(data) {
// 修改计划企业 // 修改计划企业
export function updateEnterprise(data) { export function updateEnterprise(data) {
return request({ return request({
url: '/system/enterprise', url: '/pharmaceuticals/bPlanEnterprise',
method: 'put', method: 'put',
data: data data: data
}) })
@ -38,7 +38,7 @@ export function updateEnterprise(data) {
// 删除计划企业 // 删除计划企业
export function delEnterprise(id) { export function delEnterprise(id) {
return request({ return request({
url: '/system/enterprise/' + id, url: '/pharmaceuticals/bPlanEnterprise?idList=' + id,
method: 'delete' method: 'delete'
}) })
} }

@ -6,7 +6,7 @@
* @LastEditors: JC9527 * @LastEditors: JC9527
* @LastEditTime: 2023-09-30 00:52:32 * @LastEditTime: 2023-09-30 00:52:32
*/ */
import request from '@/utils/request' import request from "@/utils/request";
export default { export default {
// 行政区划 // 行政区划
@ -31,60 +31,59 @@ export default {
url: "/pharmaceuticals/info/list", url: "/pharmaceuticals/info/list",
method: "get", method: "get",
params, params,
}) });
}, },
// 查看,新增,修改,删除计划管理表 get\delete 传参是params put\post 传参是data // 查看,新增,修改,删除计划管理表 get\delete 传参是params put\post 传参是data
bPlanManage(method,data = null, params = null, id){ bPlanManage(method, data = null, params = null, id) {
return request({ return request({
url: `/pharmaceuticals/bPlanManage${id ? `/${id}` : ''}`, url: `/pharmaceuticals/bPlanManage${id ? `/${id}` : ""}`,
method, method,
data, data,
params params,
}); });
}, },
bPlanManageTwo(id){ bPlanManageTwo(id) {
return request({ return request({
url: `/pharmaceuticals/bPlanEnterprise/${id}`, url: `/pharmaceuticals/bPlanEnterprise/${id}`,
method:'get', method: "get",
}); });
}, },
dictdata(params){ dictdata(params) {
return request({ return request({
url: `/pharmaceuticals/dictdata`, url: `/pharmaceuticals/dictdata`,
method:'get', method: "get",
params params,
}); });
}, },
bPlanEnterprise(method,data = null, params = null, id){ bPlanEnterprise(method, data = null, params = null, id) {
return request({ return request({
url: `/pharmaceuticals/bPlanEnterprise${id ? `/${id}` : ''}`, url: `/pharmaceuticals/bPlanEnterprise${id ? `/${id}` : ""}`,
method, method,
data, data,
params params,
}); });
}, },
// 查看计划明细 // 查看计划明细
planmx(params){ planmx(params) {
return request({ return request({
url: `/pharmaceuticals/bPlanEnterprise/planmx`, url: `/pharmaceuticals/bPlanEnterprise/planmx`,
method:'post', method: "post",
params, params,
}); });
}, },
// 查询计划企业列表 // 查询计划企业列表
bPlanEnterpriseList(){ bPlanEnterpriseList() {
return request({ return request({
url: `/pharmaceuticals/bPlanEnterprise/list`, url: `/pharmaceuticals/bPlanEnterprise/list`,
method:'get', method: "get",
}); });
}, },
// 根据行政区划查询重点企业数量 // 根据行政区划查询重点企业数量
getBydistrict(params){ getBydistrict(params) {
return request({ return request({
url: `/pharmaceuticals/bKeyEnterprise/getBydistrict`, url: `/pharmaceuticals/bKeyEnterprise/getBydistrict`,
method:'get', method: "get",
params params,
}); });
}, },
}; };

@ -54,7 +54,7 @@
<tab2 @nextTab="selectTab" /> <tab2 @nextTab="selectTab" />
</div> </div>
<div v-show="activeTab == 2"> <div v-show="activeTab == 2">
<tab3 /> <tab3 ref="tabs" />
</div> </div>
</div> </div>
</div> </div>
@ -87,6 +87,9 @@ export default {
selectTab(index) { selectTab(index) {
console.log(index); console.log(index);
this.activeTab = index; this.activeTab = index;
if (index == 2) {
this.$refs.tabs.getList();
}
}, },
// //
openDialog(item, dept) { openDialog(item, dept) {

@ -137,7 +137,7 @@
<div class="next"> <div class="next">
<div class="selected"> <div class="selected">
草稿箱(<span> {{ 100 }} </span>) 草稿箱(<span> {{ enterpriseTotal }} </span>)
</div> </div>
<div class="btn" ref="next" @click="btnNext"></div> <div class="btn" ref="next" @click="btnNext"></div>
</div> </div>
@ -153,6 +153,13 @@ import dictzh from "@/utils/dictzh.js";
// //
import executive from "../../yingji/echarts/executive.vue"; import executive from "../../yingji/echarts/executive.vue";
import { listNew, getNew, delNew, addNew, updateNew } from "@/api/yingji/new"; import { listNew, getNew, delNew, addNew, updateNew } from "@/api/yingji/new";
import {
listEnterprise,
getEnterprise,
delEnterprise,
addEnterprise,
updateEnterprise,
} from "@/api/yingji/enterprise";
export default { export default {
dicts: [ dicts: [
@ -203,12 +210,47 @@ export default {
form: {}, form: {},
// //
rules: {}, rules: {},
//
queryPlanEnterpriseParams: {
pageNum: 1,
pageSize: 10,
enterpriseId: null,
createId: null,
updateId: null,
userId: null,
deptId: null,
district: null,
plannedYear: null,
isPoint: "",
enterpriseName: null,
lawSort: null,
lawAreas: null,
lawLevel: null,
lawHierarchy: null,
plannedMonth: null,
status: 1,
checkStatus: null,
checkId: null,
checkAgeing: null,
},
enterpriseList: [],
enterpriseTotal: 0,
//
formPlanEnterprise: {},
}; };
}, },
created() { created() {
this.getList(); this.getList();
this.getPlanEnterpriseList();
}, },
methods: { methods: {
/** 查询计划企业列表 */
getPlanEnterpriseList() {
listEnterprise(this.queryPlanEnterpriseParams).then((response) => {
this.enterpriseList = response.data;
this.enterpriseTotal = response.data.length;
});
},
/** 查询企业新列表 */ /** 查询企业新列表 */
getList() { getList() {
this.loading = true; this.loading = true;
@ -222,7 +264,53 @@ export default {
this.$emit("nextTab", 1); this.$emit("nextTab", 1);
}, },
// 稿 // 稿
handleAddDrafts(row) {}, handleAddDrafts(row) {
// console.log("1", row);
this.resetPlanEnterprise();
this.formPlanEnterprise.plannedYear = this.$moment(new Date()).format(
"yyyy"
);
this.formPlanEnterprise.plannedMonth = "";
this.formPlanEnterprise.enterpriseId = row.enterpriseId;
this.formPlanEnterprise.enterpriseName = row.enterpriseName;
this.formPlanEnterprise.district = row.district;
this.formPlanEnterprise.status = 0;
// console.log("2", this.formPlanEnterprise);
addEnterprise(this.formPlanEnterprise).then((response) => {
this.$modal.msgSuccess("加入成功");
this.getList(); //稿
this.getPlanEnterpriseList();
});
},
//
resetPlanEnterprise() {
this.formPlanEnterprise = {
id: null,
enterpriseId: null,
createId: null,
createBy: null,
createTime: null,
updateId: null,
updateBy: null,
updateTime: null,
remark: null,
userId: null,
deptId: null,
district: null,
plannedYear: null,
isPoint: null,
enterpriseName: null,
lawSort: null,
lawAreas: null,
lawLevel: null,
lawHierarchy: null,
plannedMonth: null,
status: null,
checkStatus: null,
checkId: null,
checkAgeing: null,
};
},
// //
handleInfo(row) { handleInfo(row) {
this.$refs.firmDialog.open(row); this.$refs.firmDialog.open(row);

@ -137,7 +137,7 @@
<div class="next"> <div class="next">
<div class="selected"> <div class="selected">
草稿箱(<span> {{ 100 }} </span>) 草稿箱(<span> {{ enterpriseTotal }} </span>)
</div> </div>
<div class="btn" ref="next" @click="btnNext"></div> <div class="btn" ref="next" @click="btnNext"></div>
</div> </div>
@ -153,6 +153,13 @@ import dictzh from "@/utils/dictzh.js";
// //
import executive from "../../yingji/echarts/executive.vue"; import executive from "../../yingji/echarts/executive.vue";
import { listNew, getNew, delNew, addNew, updateNew } from "@/api/yingji/new"; import { listNew, getNew, delNew, addNew, updateNew } from "@/api/yingji/new";
import {
listEnterprise,
getEnterprise,
delEnterprise,
addEnterprise,
updateEnterprise,
} from "@/api/yingji/enterprise";
export default { export default {
dicts: [ dicts: [
@ -203,12 +210,47 @@ export default {
form: {}, form: {},
// //
rules: {}, rules: {},
//
queryPlanEnterpriseParams: {
pageNum: 1,
pageSize: 10,
enterpriseId: null,
createId: null,
updateId: null,
userId: null,
deptId: null,
district: null,
plannedYear: null,
isPoint: "",
enterpriseName: null,
lawSort: null,
lawAreas: null,
lawLevel: null,
lawHierarchy: null,
plannedMonth: null,
status: 1,
checkStatus: null,
checkId: null,
checkAgeing: null,
},
enterpriseList: [],
enterpriseTotal: 0,
//
formPlanEnterprise: {},
}; };
}, },
created() { created() {
this.getList(); this.getList();
this.getPlanEnterpriseList();
}, },
methods: { methods: {
/** 查询计划企业列表 */
getPlanEnterpriseList() {
listEnterprise(this.queryPlanEnterpriseParams).then((response) => {
this.enterpriseList = response.data;
this.enterpriseTotal = response.data.length;
});
},
/** 查询企业新列表 */ /** 查询企业新列表 */
getList() { getList() {
this.loading = true; this.loading = true;
@ -222,7 +264,53 @@ export default {
this.$emit("nextTab", 2); this.$emit("nextTab", 2);
}, },
// 稿 // 稿
handleAddDrafts(row) {}, handleAddDrafts(row) {
// console.log("1", row);
this.resetPlanEnterprise();
this.formPlanEnterprise.plannedYear = this.$moment(new Date()).format(
"yyyy"
);
this.formPlanEnterprise.plannedMonth = "";
this.formPlanEnterprise.enterpriseId = row.enterpriseId;
this.formPlanEnterprise.enterpriseName = row.enterpriseName;
this.formPlanEnterprise.district = row.district;
this.formPlanEnterprise.status = 0;
// console.log("2", this.formPlanEnterprise);
addEnterprise(this.formPlanEnterprise).then((response) => {
this.$modal.msgSuccess("加入成功");
this.getList(); //稿
this.getPlanEnterpriseList();
});
},
//
resetPlanEnterprise() {
this.formPlanEnterprise = {
id: null,
enterpriseId: null,
createId: null,
createBy: null,
createTime: null,
updateId: null,
updateBy: null,
updateTime: null,
remark: null,
userId: null,
deptId: null,
district: null,
plannedYear: null,
isPoint: null,
enterpriseName: null,
lawSort: null,
lawAreas: null,
lawLevel: null,
lawHierarchy: null,
plannedMonth: null,
status: null,
checkStatus: null,
checkId: null,
checkAgeing: null,
};
},
// //
handleInfo(row) { handleInfo(row) {
this.$refs.firmDialog.open(row); this.$refs.firmDialog.open(row);

@ -64,7 +64,7 @@
<div class="next"> <div class="next">
<div class="selected"> <div class="selected">
草稿箱(<span> {{ 100 }} </span>) 草稿箱(<span> {{ total }} </span>)
</div> </div>
<div class="btn" ref="next">正式提交</div> <div class="btn" ref="next">正式提交</div>
</div> </div>
@ -130,7 +130,7 @@ export default {
lawLevel: null, lawLevel: null,
lawHierarchy: null, lawHierarchy: null,
plannedMonth: null, plannedMonth: null,
status: 1, status: 0,
checkStatus: null, checkStatus: null,
checkId: null, checkId: null,
checkAgeing: null, checkAgeing: null,
@ -147,6 +147,7 @@ export default {
methods: { methods: {
// //
editMonth(row) { editMonth(row) {
let _this = this;
this.$prompt("请输入月份", "编辑", { this.$prompt("请输入月份", "编辑", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
@ -158,6 +159,14 @@ export default {
}) })
.then(({ value }) => { .then(({ value }) => {
// //
if (row.id != null) {
row.createTime = null;
row.plannedMonth = value;
updateEnterprise(row).then((response) => {
this.$modal.msgSuccess("修改成功");
_this.getList();
});
}
}) })
.catch(() => { .catch(() => {
this.$message({ this.$message({
@ -176,7 +185,18 @@ export default {
}); });
}, },
// //
handleDelete(row) {}, handleDelete(row) {
this.$modal
.confirm("是否确认删除计划企业数据项?")
.then(function () {
return delEnterprise(row.id);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
// //
componendDistrict(district) { componendDistrict(district) {
let fullName; let fullName;

Loading…
Cancel
Save