Commit b16ab542 by liuguorong93

退役犬新增 绑定接口

parent 5ec615c9
......@@ -4,7 +4,6 @@
v-loading="loading"
>
<div class="contents">
{{detailInfo}}
<el-form
:model="detailInfo"
ref="detailInfoRef"
......@@ -225,10 +224,10 @@
label="备注"
class="elItemClass"
style="width:48%;"
prop="remark"
prop="xxlyms"
>
<el-input
v-model.trim="detailInfo.remark"
v-model.trim="detailInfo.xxlyms"
:clearable="true"
placeholder="请输入备注"
type="textarea"
......@@ -345,23 +344,24 @@ export default {
name: "",
birthDate: "",
artisanName: "",
artisanCard: "",
trainingUnitName: "",
trainingUnit: "",
retiredDate: "",
acceptArtisanCard: "",
gsdwGajgjgdm1: "",
unitNameCode1: "",
personName1: "",
acceptDate: "",
auditStaffCard: "",
gsdwGajgjgdm2: "",
unitNameCode2: "",
personName2: "",
auditDate: "",
unitNameCode: "",
remark: "",
xxlyms: "",
xxdjryXm: "",
xxdjryGmsfhm: "",
xxdjdwGajgmc: "",
......@@ -536,26 +536,328 @@ export default {
}
},
methods: {
resetDogInfoField() {},
handleTiQuDogInfo(flag) {},
resetAcceptInfoField() {},
handleTiQuAcceptInfo(flag) {},
resetCheckInfoField() {},
handleTiQuCheckInfo(flag) {},
resetDogInfoField() {
this.detailInfo.name = "";
this.detailInfo.birthDate = "";
this.detailInfo.artisanName = "";
this.detailInfo.artisanCard = "";
this.detailInfo.trainingUnitName = "";
this.detailInfo.trainingUnit = "";
},
handleTiQuDogInfo(flag) {
this.$refs.detailInfoRef.validateField("chipCode", (result) => {
if (!result) {
let params = {
chipCode: this.detailInfo.chipCode,
};
extractRetireDog(params)
.then((res) => {
if (
res.code === 200 &&
res.success &&
res.data &&
res.data.data
) {
let tqDatas = res.data.data;
this.detailInfo.name = tqDatas.name || "";
this.detailInfo.birthDate = tqDatas.birthDate || "";
this.detailInfo.artisanName = tqDatas.artisanName || "";
this.detailInfo.artisanCard = tqDatas.artisanCard || "";
this.detailInfo.trainingUnitName =
tqDatas.trainingUnitName || "";
this.detailInfo.trainingUnit = tqDatas.trainingUnit || "";
if (flag === "click") {
this.$message({
message: "提取成功",
type: "success",
duration: 3000,
});
}
return;
}
if (flag === "click") {
this.$message({
message: res.message,
type: "warning",
duration: 3000,
});
}
this.resetDogInfoField();
})
.catch(() => {
if (flag === "click") {
this.$message({
message: "提取失败",
type: "warning",
duration: 3000,
});
}
this.resetDogInfoField();
});
}
});
},
resetAcceptInfoField() {
this.detailInfo.gsdwGajgjgdm1 = "";
this.detailInfo.unitNameCode1 = "";
this.detailInfo.personName1 = "";
},
handleTiQuAcceptInfo(flag) {
this.$refs.detailInfoRef.validateField("acceptArtisanCard", (result) => {
if (!result) {
let params = {
idNo: this.detailInfo.acceptArtisanCard,
};
extractPersion(params)
.then((res) => {
if (
res.code === 200 &&
res.success &&
res.data &&
res.data.data
) {
let tqDatas = res.data.data;
this.detailInfo.gsdwGajgjgdm1 = tqDatas.gsdwGajgjgdm || "";
this.detailInfo.unitNameCode1 = tqDatas.unitNameCode || "";
this.detailInfo.personName1 = tqDatas.personName || "";
if (flag === "click") {
this.$message({
message: "提取成功",
type: "success",
duration: 3000,
});
}
return;
}
if (flag === "click") {
this.$message({
message: res.message,
type: "warning",
duration: 3000,
});
}
this.resetAcceptInfoField();
})
.catch(() => {
if (flag === "click") {
this.$message({
message: "提取失败",
type: "warning",
duration: 3000,
});
}
this.resetAcceptInfoField();
});
}
});
},
resetCheckInfoField() {
this.detailInfo.gsdwGajgjgdm2 = "";
this.detailInfo.unitNameCode2 = "";
this.detailInfo.personName2 = "";
},
handleTiQuCheckInfo(flag) {
this.$refs.detailInfoRef.validateField("auditStaffCard", (result) => {
if (!result) {
let params = {
idNo: this.detailInfo.auditStaffCard,
};
extractPersion(params)
.then((res) => {
if (
res.code === 200 &&
res.success &&
res.data &&
res.data.data
) {
let tqDatas = res.data.data;
this.detailInfo.gsdwGajgjgdm2 = tqDatas.gsdwGajgjgdm || "";
this.detailInfo.unitNameCode2 = tqDatas.unitNameCode || "";
this.detailInfo.personName2 = tqDatas.personName || "";
if (flag === "click") {
this.$message({
message: "提取成功",
type: "success",
duration: 3000,
});
}
return;
}
if (flag === "click") {
this.$message({
message: res.message,
type: "warning",
duration: 3000,
});
}
this.resetCheckInfoField();
})
.catch(() => {
if (flag === "click") {
this.$message({
message: "提取失败",
type: "warning",
duration: 3000,
});
}
this.resetCheckInfoField();
});
}
});
},
goBack() {
this.$router.push({ name: "poDogRetireManage" });
},
getDetail(id) {
console.log(id);
let params = {
id,
};
this.loading = true;
getRetireDogDetail(params)
.then((res) => {
if (res.code === 200 && res.success && res.data && res.data.data) {
let datas = res.data.data;
// 处理接收&审核信息
datas.gsdwGajgjgdm1 = "";
datas.unitNameCode1 = "";
datas.personName1 = "";
datas.gsdwGajgjgdm2 = "";
datas.unitNameCode2 = "";
datas.personName2 = "";
if (datas.acceptUnitName)
datas.gsdwGajgjgdm1 = datas.acceptUnitName;
if (datas.acceptUnit) datas.unitNameCode1 = datas.acceptUnit;
if (datas.acceptArtisan) datas.personName1 = datas.acceptArtisan;
if (datas.auditUnitName) datas.gsdwGajgjgdm2 = datas.auditUnitName;
if (datas.auditUnit) datas.unitNameCode2 = datas.auditUnit;
if (datas.auditStaff) datas.personName2 = datas.auditStaff;
this.detailInfo = datas;
this.loading = false;
return;
}
this.detailInfo = {};
this.loading = false;
this.$message({ message: "查询失败,请稍后再试", type: "warning" });
})
.catch((error) => {
this.detailInfo = {};
this.loading = false;
});
},
saveData() {
this.$refs.detailInfoRef.validate((result) => {
if (result) {
console.log("ok");
let params = {
chipCode: this.detailInfo.chipCode,
name: this.detailInfo.name,
birthDate: this.detailInfo.birthDate,
artisanCard: this.detailInfo.artisanCard,
trainingUnit: this.detailInfo.trainingUnit,
fyqx: String(this.detailInfo.fyqx),
retiredDate: this.detailInfo.retiredDate,
acceptArtisanCard: this.detailInfo.acceptArtisanCard,
acceptUnit: this.detailInfo.unitNameCode1,
acceptArtisan: this.detailInfo.personName1,
acceptDate: this.detailInfo.acceptDate,
auditStaffCard: this.detailInfo.auditStaffCard,
auditUnit: this.detailInfo.unitNameCode2,
auditStaff: this.detailInfo.personName2,
auditDate: this.detailInfo.auditDate,
xxlyms: this.detailInfo.xxlyms,
xxdjryXm: this.detailInfo.xxdjryXm,
xxdjryGmsfhm: this.detailInfo.xxdjryGmsfhm,
xxdjdwGajgmc: this.detailInfo.xxdjdwGajgmc,
xxdjdwGajgjgdm: this.detailInfo.xxdjdwGajgjgdm,
djsj: this.detailInfo.djsj,
id: this.detailInfo.id || "",
};
if (this.routeName === "poDogRetireManageEdit") {
this.editParams(params);
} else {
this.addParams(params);
}
}
});
},
editParams(params) {
this.loading = true;
editRetireDog(params)
.then((res) => {
if (res.code === 200 && res.success) {
this.$message({
message: "保存成功",
type: "success",
duration: 1000,
});
this.loading = false;
this.goBack();
return;
}
this.loading = false;
this.$message({
message: res.message,
type: "warning",
duration: 1000,
});
})
.catch((e) => {
console.log(e);
this.loading = false;
this.$message({
message: "更新失败",
type: "warning",
duration: 1000,
});
});
},
addParams(params) {
this.loading = true;
addRetireDog(params)
.then((res) => {
if (res.code === 200 && res.success) {
this.$message({
message: "保存成功",
type: "success",
duration: 1000,
});
this.loading = false;
this.goBack();
return;
}
this.loading = false;
this.$message({
message: res.message,
type: "warning",
duration: 1000,
});
})
.catch((e) => {
console.log(e);
this.loading = false;
this.$message({
message: "更新失败",
type: "warning",
duration: 1000,
});
});
},
},
};
</script>
......
......@@ -449,7 +449,50 @@ export default {
this.$message("已取消删除");
});
},
exportData() {},
exportData() {
this.tableLoading = true;
let params = {
pageNow: 1,
pageSize: 99999,
chipCode: this.formData.chipCode,
name: this.formData.name,
birthkssj:
this.formData.birthDate && this.formData.birthDate.length
? this.formData.birthDate[0]
: "",
birthjssj:
this.formData.birthDate && this.formData.birthDate.length
? this.formData.birthDate[1]
: "",
retiredkssj:
this.formData.retiredDate && this.formData.retiredDate.length
? this.formData.retiredDate[0]
: "",
retiredjssj:
this.formData.retiredDate && this.formData.retiredDate.length
? this.formData.retiredDate[1]
: "",
trainingUnit: this.formData.trainingUnit,
};
axios
.post(exportRetireDogUrl, JSON.stringify(params), {
headers: { "Content-Type": "application/json" },
responseType: "blob",
})
.then((res) => {
if (!res.data) {
this.tableLoading = false;
return;
}
let obj = {
data: res.data,
filename: "警用退役犬信息.xlsx",
};
handleDownFile(obj);
this.tableLoading = false;
});
},
// 配置表头
handleHeaderSettings() {
this.showHeaderSettingBox = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment