|
@@ -255,7 +255,7 @@
|
|
|
<el-table-column label="库房" align="center" prop="storeHouse" />
|
|
|
<!-- <el-table-column label="库房" align="center" prop="unitId" /> -->
|
|
|
<el-table-column label="单位" align="center" prop="unitId1" />
|
|
|
- <el-table-column
|
|
|
+ <!-- <el-table-column
|
|
|
label="操作"
|
|
|
align="center"
|
|
|
class-name="small-padding fixed-width"
|
|
@@ -278,7 +278,7 @@
|
|
|
>删除</el-button
|
|
|
>
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
+ </el-table-column> -->
|
|
|
</el-table>
|
|
|
|
|
|
<pagination
|
|
@@ -314,13 +314,32 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="使用单位" prop="unitId1">
|
|
|
- <el-input v-model="form.unitId1" placeholder="请输入使用单位" />
|
|
|
+ <!-- <el-input v-model="form.unitId1" placeholder="请输入使用单位" /> -->
|
|
|
+ <treeselect
|
|
|
+ v-model="form.unitId1"
|
|
|
+ :options="deptOptions"
|
|
|
+ placeholder="选择单位"
|
|
|
+ @select="selectPeo"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="使用人" prop="receiveId">
|
|
|
- <el-input v-model="form.receiveId" placeholder="请输入使用人" />
|
|
|
+ <!-- <el-input v-model="form.receiveId" placeholder="请输入使用人" /> -->
|
|
|
+ <el-select v-model="form.receiveId" placeholder="请选择使用人">
|
|
|
+ <el-option
|
|
|
+ v-for="(item, i) in renYuan"
|
|
|
+ :key="i"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="出库数量" prop="putOut">
|
|
|
- <el-input v-model="form.putOut" placeholder="请输入出库数量" />
|
|
|
+ <el-input
|
|
|
+ v-model="form.putOut"
|
|
|
+ placeholder="请输入出库数量"
|
|
|
+ @blur="shuLiang"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="出库位置" prop="place">
|
|
|
<el-input v-model="form.place" placeholder="请输入出库位置" />
|
|
@@ -339,13 +358,13 @@
|
|
|
<div class="jiben">药品用途</div>
|
|
|
<el-form-item prop="purpose">
|
|
|
<el-input
|
|
|
- v-model="form.remarks"
|
|
|
+ v-model="form.purpose"
|
|
|
type="textarea"
|
|
|
placeholder="请输入用途内容"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<div class="jiben">出库说明</div>
|
|
|
- <el-form-item prop="purpose">
|
|
|
+ <el-form-item prop="remarks">
|
|
|
<el-input
|
|
|
v-model="form.remarks"
|
|
|
type="textarea"
|
|
@@ -397,10 +416,18 @@ import {
|
|
|
exportBdgldurgputout,
|
|
|
} from "@/api/medicalhealth/bdgldurgputout";
|
|
|
import { exportYao } from "@/api/medicalhealth/bdgldurgputin";
|
|
|
-import { getDept } from "@/api/medicalhealth/bdgldurgarchives";
|
|
|
+import { getDept2 } from "@/api/medicalhealth/bdgldurgarchives";
|
|
|
+// 导入树形结构
|
|
|
+import Treeselect from "@riophae/vue-treeselect";
|
|
|
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
+// 人员
|
|
|
+import { getZhuChiRen } from "@/api/grassrootsregistration/bdglmeeting";
|
|
|
|
|
|
export default {
|
|
|
name: "Bdgldurgputout",
|
|
|
+ components: {
|
|
|
+ Treeselect,
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
// 遮罩层
|
|
@@ -450,27 +477,56 @@ export default {
|
|
|
rules: {},
|
|
|
// 药品列表
|
|
|
yaoList: [],
|
|
|
+ // 树形单位
|
|
|
+ deptOptions: [],
|
|
|
+ // 人员
|
|
|
+ renYuan: [],
|
|
|
+ yaoPingShu: "",
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
this.getList();
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 数量的判断
|
|
|
+ shuLiang() {
|
|
|
+ if (this.form.putOut > this.yaoPingShu) {
|
|
|
+ return this.$modal.msgWarning(`库存数量为${this.yaoPingShu}`);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 新增选择单位触发
|
|
|
+ selectPeo(val) {
|
|
|
+ this.form.unitId = val.id;
|
|
|
+ // 选中单位触发获取人员
|
|
|
+ this.getZhuChi(this.form.unitId);
|
|
|
+ this.form.unitId = null;
|
|
|
+ },
|
|
|
+ /** 查询部门下拉树结构 */
|
|
|
+ getTreeselect() {
|
|
|
+ getDept2().then((response) => {
|
|
|
+ this.deptOptions = response.data;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 获取主持人
|
|
|
+ getZhuChi(id) {
|
|
|
+ getZhuChiRen(id).then((res) => {
|
|
|
+ this.renYuan = res.data;
|
|
|
+ });
|
|
|
+ },
|
|
|
// 药品名称触发赋值
|
|
|
yapPing(data) {
|
|
|
- // console.log(data);
|
|
|
- this.form.unitId = data.unitId;
|
|
|
- this.form.unitName = data.unitName;
|
|
|
this.form.manufacturer = data.manufacturer;
|
|
|
this.form.specifications = data.specifications;
|
|
|
this.form.storeHouse = data.storeHouse;
|
|
|
this.form.durgArchivesId = data.id;
|
|
|
this.form.durgBrand = data.durgBrand;
|
|
|
+ this.yaoPingShu = data.amount;
|
|
|
},
|
|
|
// 查询药品名称列表
|
|
|
getYaoPing() {
|
|
|
exportYao().then((response) => {
|
|
|
this.yaoList = response.data;
|
|
|
+ console.log(response.data);
|
|
|
});
|
|
|
},
|
|
|
/** 查询药品出库登记列表 */
|
|
@@ -531,6 +587,7 @@ export default {
|
|
|
/** 新增按钮操作 */
|
|
|
handleAdd() {
|
|
|
this.reset();
|
|
|
+ this.getTreeselect();
|
|
|
this.getYaoPing();
|
|
|
this.open = true;
|
|
|
this.title = "添加药品出库登记";
|
|
@@ -551,14 +608,20 @@ export default {
|
|
|
this.$refs["form"].validate((valid) => {
|
|
|
if (valid) {
|
|
|
if (this.form.id != null) {
|
|
|
+ if (this.form.putOut > this.yaoPingShu) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
updateBdgldurgputout(this.form).then((response) => {
|
|
|
- this.msgSuccess("修改成功");
|
|
|
+ this.$modal.msgSuccess("修改成功");
|
|
|
this.open = false;
|
|
|
this.getList();
|
|
|
});
|
|
|
} else {
|
|
|
+ if (this.form.putOut > this.yaoPingShu) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
addBdgldurgputout(this.form).then((response) => {
|
|
|
- this.msgSuccess("新增成功");
|
|
|
+ this.$modal.msgSuccess("新增成功");
|
|
|
this.open = false;
|
|
|
this.getList();
|
|
|
});
|
|
@@ -583,7 +646,7 @@ export default {
|
|
|
})
|
|
|
.then(() => {
|
|
|
this.getList();
|
|
|
- this.msgSuccess("删除成功");
|
|
|
+ this.$modal.msgSuccess("删除成功");
|
|
|
})
|
|
|
.catch(() => {});
|
|
|
},
|