|
@@ -7,6 +7,15 @@
|
|
|
v-show="showSearch"
|
|
|
label-width="68px"
|
|
|
>
|
|
|
+ <el-form-item prop="name">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.name"
|
|
|
+ placeholder="请输入物品名称"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @input="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
<!-- <el-form-item label="物品类型" prop="wuPinType">
|
|
|
<el-select
|
|
|
v-model="queryParams.wuPinType"
|
|
@@ -65,7 +74,7 @@
|
|
|
/>
|
|
|
</el-select>
|
|
|
</el-form-item> -->
|
|
|
- <el-form-item label="" prop="responsibilityUnit">
|
|
|
+ <!-- <el-form-item label="" prop="responsibilityUnit">
|
|
|
<el-input
|
|
|
v-model="queryParams.responsibilityUnit"
|
|
|
placeholder="请输入责任单位"
|
|
@@ -82,7 +91,7 @@
|
|
|
size="small"
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
- </el-form-item>
|
|
|
+ </el-form-item> -->
|
|
|
<!-- <el-form-item label="出库数量" prop="putOut">
|
|
|
<el-input
|
|
|
v-model="queryParams.putOut"
|
|
@@ -337,14 +346,8 @@
|
|
|
prop="responsibilityUnit"
|
|
|
/>
|
|
|
<el-table-column label="发放对象" align="center" prop="outPeople">
|
|
|
- <template slot-scope="scope">
|
|
|
- <dict-tag
|
|
|
- :options="dict.type.distribution_object"
|
|
|
- :value="scope.row.outPeople"
|
|
|
- />
|
|
|
- </template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="接收单位" align="center" prop="outUnit" />
|
|
|
+ <!-- <el-table-column label="接收单位" align="center" prop="outUnit" /> -->
|
|
|
<!-- <el-table-column label="接收人" align="center" prop="recipient" /> -->
|
|
|
<el-table-column label="存放位置" align="center" prop="storageLocation" />
|
|
|
<!-- <el-table-column label="备注" align="center" prop="remark" /> -->
|
|
@@ -356,17 +359,17 @@
|
|
|
/>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="现有数量" align="center" prop="total" />
|
|
|
+ <el-table-column label="库存数量" align="center" prop="total" />
|
|
|
<el-table-column
|
|
|
label="操作"
|
|
|
align="center"
|
|
|
class-name="small-padding fixed-width"
|
|
|
+ width="120"
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
|
size="btu"
|
|
|
type="text"
|
|
|
- icon="el-icon-edit"
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
v-hasPermi="['materialManagement:distribution:edit']"
|
|
|
>修改</el-button
|
|
@@ -374,7 +377,6 @@
|
|
|
<el-button
|
|
|
size="btd"
|
|
|
type="text"
|
|
|
- icon="el-icon-delete"
|
|
|
@click="handleDelete(scope.row)"
|
|
|
v-hasPermi="['materialManagement:distribution:remove']"
|
|
|
>删除</el-button
|
|
@@ -423,7 +425,7 @@
|
|
|
v-for="(item, i) in itemlist"
|
|
|
:key="i"
|
|
|
:value="item.name"
|
|
|
- :label="item.name"
|
|
|
+ :label="item.names"
|
|
|
class="input_xiala"
|
|
|
@click.native="wuPing(item)"
|
|
|
>
|
|
@@ -434,10 +436,15 @@
|
|
|
<el-input
|
|
|
v-model="form.materialSpecification"
|
|
|
placeholder="请输入物品规格"
|
|
|
+ readonly
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="物品型号" prop="materialXh">
|
|
|
- <el-input v-model="form.materialXh" placeholder="请输入物资型号" />
|
|
|
+ <el-input
|
|
|
+ v-model="form.materialXh"
|
|
|
+ placeholder="请输入物资型号"
|
|
|
+ readonly
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="库房" prop="warehouse">
|
|
|
<el-select v-model="form.warehouse" placeholder="请选择库房">
|
|
@@ -456,11 +463,19 @@
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="现有数量" prop="total">
|
|
|
- <el-input v-model="form.total" placeholder="请输入现有数量" />
|
|
|
+ <el-input
|
|
|
+ v-model="form.total"
|
|
|
+ placeholder="请输入现有数量"
|
|
|
+ readonly
|
|
|
+ />
|
|
|
</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="putOutTime">
|
|
@@ -485,10 +500,10 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="价值" prop="price">
|
|
|
- <el-input v-model="form.price" placeholder="请输入价值" />
|
|
|
+ <el-input v-model="form.price" placeholder="请输入价值" readonly />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="发放单位" prop="outUnit">
|
|
|
- <el-input v-model="form.outUnit" />
|
|
|
+ <el-form-item label="发放单位" prop="responsibilityUnit">
|
|
|
+ <el-input v-model="form.responsibilityUnit" readonly />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="发放对象" prop="outPeople">
|
|
|
<el-select v-model="form.outPeople" placeholder="请选择发放对象">
|
|
@@ -496,13 +511,22 @@
|
|
|
v-for="dict in dict.type.distribution_object"
|
|
|
:key="dict.value"
|
|
|
:label="dict.label"
|
|
|
- :value="dict.value"
|
|
|
+ :value="dict.label"
|
|
|
@click.native="dianJi(dict.value)"
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="接收人" prop="recipientId" v-if="ren">
|
|
|
<el-select v-model="form.recipientId" placeholder="请选择接收人">
|
|
|
+ <el-option
|
|
|
+ v-for="item in renYuan"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ class="input_xiala"
|
|
|
+ @click.native="rens(item.name)"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="接收单位" prop="outUnitId" v-if="danWei">
|
|
@@ -510,7 +534,7 @@
|
|
|
v-model="form.outUnitId"
|
|
|
placeholder="请选择接收单位"
|
|
|
:options="deptOptions"
|
|
|
- @select="shuxing"
|
|
|
+ @select="danWeis"
|
|
|
></treeselect>
|
|
|
</el-form-item>
|
|
|
<div class="jiben">备注</div>
|
|
@@ -571,15 +595,12 @@ import {
|
|
|
addDistribution,
|
|
|
updateDistribution,
|
|
|
exportDistribution,
|
|
|
+ exportMaterialRegWuPingList,
|
|
|
} from "@/api/materialManagement/distribution";
|
|
|
// 导入树形结构
|
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
-import {
|
|
|
- listArchives,
|
|
|
- getDept,
|
|
|
- getZhuChiRen,
|
|
|
-} from "@/api/materialManagement/archives";
|
|
|
+import { getDept, getZhuChiRen } from "@/api/materialManagement/archives";
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
@@ -646,29 +667,45 @@ export default {
|
|
|
ren: true,
|
|
|
// 显示与隐藏接收单位
|
|
|
danWei: false,
|
|
|
+ // 人员列表
|
|
|
+ renYuan: [],
|
|
|
+ // 总数量
|
|
|
+ yinJunShu: "",
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
this.getList();
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 数量的判断
|
|
|
+ shuLiang() {
|
|
|
+ if (this.form.putOut > this.yinJunShu) {
|
|
|
+ return this.$modal.msgWarning(`库存数量为${this.yinJunShu}`);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 点击接收单位触发
|
|
|
+ danWeis(data) {
|
|
|
+ this.form.outUnit = data.label;
|
|
|
+ },
|
|
|
+ // 点击选择接收人触发
|
|
|
+ rens(name) {
|
|
|
+ this.form.resipient = name;
|
|
|
+ },
|
|
|
// 点击发放对象
|
|
|
dianJi(value) {
|
|
|
console.log(value);
|
|
|
if (value == "0") {
|
|
|
this.danWei = false;
|
|
|
this.ren = true;
|
|
|
+ this.form.outUnitId = null;
|
|
|
+ this.form.outUnit = null;
|
|
|
} else if (value == "2") {
|
|
|
this.ren = false;
|
|
|
this.danWei = true;
|
|
|
+ this.form.resipient = null;
|
|
|
+ this.form.recipientId = null;
|
|
|
}
|
|
|
},
|
|
|
- // 点击单位触发
|
|
|
- shuxing(data) {
|
|
|
- this.form.unitId = data.id;
|
|
|
- this.form.responsibilityUnit = data.label;
|
|
|
- this.getRenYuan(this.form.unitId);
|
|
|
- },
|
|
|
// 获取人员
|
|
|
getRenYuan(id) {
|
|
|
getZhuChiRen(id).then((res) => {
|
|
@@ -684,14 +721,20 @@ export default {
|
|
|
// 点击物品名称触发
|
|
|
wuPing(data) {
|
|
|
console.log(data);
|
|
|
- this.form.archivesId = data.id;
|
|
|
this.form.responsibilityUnit = data.responsibilityUnit;
|
|
|
- this.form.personLiable = data.personLiable;
|
|
|
- // this.form.yingJuType = data.yingJuType;
|
|
|
+ this.form.price = data.price;
|
|
|
+ this.form.archivesId = data.archivesId;
|
|
|
+ this.form.responsibilityUnitId = data.unitId;
|
|
|
+ this.form.registrationId = data.id;
|
|
|
+ this.form.total = data.total;
|
|
|
+ this.yinJunShu = data.total;
|
|
|
+ this.form.materialSpecification = data.materialSpecification;
|
|
|
+ this.form.materialXh = data.materialXh;
|
|
|
+ this.getRenYuan(data.unitId);
|
|
|
},
|
|
|
// 获取物品名称
|
|
|
getMingCheng() {
|
|
|
- listArchives().then((response) => {
|
|
|
+ exportMaterialRegWuPingList().then((response) => {
|
|
|
this.itemlist = response.rows;
|
|
|
});
|
|
|
},
|
|
@@ -764,10 +807,12 @@ export default {
|
|
|
},
|
|
|
/** 修改按钮操作 */
|
|
|
handleUpdate(row) {
|
|
|
+ this.getTreeselect();
|
|
|
this.reset();
|
|
|
const id = row.id || this.ids;
|
|
|
getDistribution(id).then((response) => {
|
|
|
this.form = response.data;
|
|
|
+ this.getRenYuan(this.form.responsibilityUnitId);
|
|
|
this.open = true;
|
|
|
this.title = "修改物资发放";
|
|
|
});
|
|
@@ -783,6 +828,9 @@ export default {
|
|
|
this.getList();
|
|
|
});
|
|
|
} else {
|
|
|
+ if (this.form.putOut > this.yinJunShu) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
addDistribution(this.form).then((response) => {
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
this.open = false;
|
|
@@ -880,4 +928,7 @@ export default {
|
|
|
::v-deep .el-form .el-input__inner {
|
|
|
height: 36px !important;
|
|
|
}
|
|
|
+::v-deep .vue-treeselect__single-value {
|
|
|
+ color: #fff !important;
|
|
|
+}
|
|
|
</style>
|