Merge remote-tracking branch 'origin/master'

yangwl
zhaoxiaolin 8 months ago
commit 7a54a58cba

@ -190,8 +190,9 @@ export default {
/** 重置按钮操作 */
resetQuery() {
this.queryParams.equipmentTypeCode = null;
this.resetForm("queryForm");
this.queryParams.itemCode = null;
this.queryParams.itemName = null;
this.handleQuery();
},
@ -203,6 +204,11 @@ export default {
this.multiple = !selection.length;
},
cancel() {
this.showFlag = false;
this.resetQuery();
},
submitForm() {
if (this.$refs.multipleTable.selection.length > 1) {
Message.warning("只能选择一个维修人,请勿选择多个!");
@ -210,7 +216,7 @@ export default {
console.log(this.$refs.multipleTable.selection);
this.$emit("onSelected", this.$refs.multipleTable.selection);
this.showFlag = false;
this.getList();
this.resetQuery();
}
},
},

@ -248,8 +248,6 @@ export default {
},
/** 查询备品备件台账管理列表 */
getList() {
this.sparePartsLedgerList = null;
this.total = 0;
this.loading = true;
listSparePartsLedger(this.queryParams).then((response) => {
this.sparePartsLedgerList = response.rows;
@ -260,8 +258,7 @@ export default {
//
cancel() {
this.showFlag = false;
this.reset();
this.getList();
this.resetQuery();
},
//
reset() {
@ -331,6 +328,7 @@ export default {
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 提交按钮 */
submitForm() {
console.log("data:", this.sparePartsLedgerList);
@ -338,16 +336,21 @@ export default {
this.$refs.multipleTable.selection.forEach((item) => {
if (item.spareQuantity > item.amount - item.storageAmount) {
Message.warning(
'备件编码"' +
'申领失败!备件编码"' +
item.materialCode +
'"的申领数量大于可用数量,请重新填写!'
);
this.$refs.multipleTable.clearSelection();
}
if(item.spareQuantity == null){
Message.warning('申领失败!请填写"'+item.materialCode+'"的申领数量!');
this.$refs.multipleTable.clearSelection();
}
});
this.$emit("onSelected", this.$refs.multipleTable.selection);
this.showFlag = false;
this.getList();
//
this.resetQuery();
},
},
};

@ -548,7 +548,7 @@ export default {
},
//
onItemSelectedPerson(obj) {
this.form.applyPeople = obj;
this.form.applyPeople = obj[0].userName;;
},
//
indexMethod(index) {

@ -6,7 +6,7 @@
:modal="false"
width="800px"
center
:before-close="cancelEquipmentForm"
:before-close="cancel"
>
<el-row :gutter="20">
<!--人员数据-->
@ -53,8 +53,8 @@
<el-table
v-loading="loading"
:data="itemList"
@selection-change="handleEquipmentSelectionChange"
ref="myTable"
@selection-change="handleSelectionChange"
ref="multipleTable"
>
<el-table-column
width="50"
@ -75,7 +75,8 @@
key="itemCode"
prop="userName"
v-if="columns[0].visible"
></el-table-column>
>
</el-table-column>
<el-table-column
label="人员名称"
align="left"
@ -96,14 +97,16 @@
</el-col>
</el-row>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitPersonForm"> </el-button>
<el-button @click="cancelEquipmentForm"> </el-button>
<el-button type="primary" @click="submitForm" :disabled="multiple"
> </el-button
>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { getMaintenancePersonList } from "@/api/device/repairOrder";
import { getRepairPersonList } from "@/api/device/faultReport";
import { Message } from "element-ui";
export default {
@ -132,6 +135,8 @@ export default {
itemName: undefined,
itemCodeGet: "",
itemCode: undefined,
nickName: null,
userName: null,
},
//
columns: [
@ -155,7 +160,7 @@ export default {
this.resetForm("form");
},
handleEquipmentSelectionChange(val) {
handleSelectionChange(val) {
this.itemList = val;
},
@ -165,24 +170,18 @@ export default {
},
//
/** 查询设备编码列表*/
/** 查询人员列表*/
getList() {
this.loading = true;
getMaintenancePersonList(this.queryParams).then((response) => {
this.queryParams.userName = this.queryParams.itemCode;
this.queryParams.nickName = this.queryParams.itemName;
getRepairPersonList(this.queryParams).then((response) => {
this.itemList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
handleNodeClick(data) {
console.log("id", data.id);
this.queryParams.equipmentTypeCode = data.equipmentTypeCode;
console.log(this.equipmentTypeCode);
this.handleQuery();
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
@ -191,33 +190,33 @@ export default {
/** 重置按钮操作 */
resetQuery() {
this.queryParams.equipmentTypeCode = null;
this.resetForm("queryForm");
this.queryParams.itemCode = null;
this.queryParams.itemName = null;
this.handleQuery();
},
//
handleEquipmentSelectionChange(selection) {
this.ids = selection.map((item) => item.nickName);
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.userId);
this.userCodes = selection.map((item) => item.userName);
this.single = selection.length !== 1;
this.multiple = !selection.length;
console.log("多选框", this.ids);
},
submitPersonForm() {
const data = this.ids;
const nickName = data.toString();
if (data.length > 1) {
cancel() {
this.showFlag = false;
this.resetQuery();
},
submitForm() {
if (this.$refs.multipleTable.selection.length > 1) {
Message.warning("只能选择一个维修人,请勿选择多个!");
} else {
if (this.queryParams.itemCodeGet == "") {
this.queryParams.itemCodeGet = nickName;
}
this.selectedRows = this.queryParams.itemCodeGet;
this.$emit("onSelected", this.selectedRows);
this.getList();
console.log(this.$refs.multipleTable.selection);
this.$emit("onSelected", this.$refs.multipleTable.selection);
this.showFlag = false;
this.queryParams.itemCodeGet = "";
this.resetQuery();
}
},
},

@ -245,8 +245,6 @@ export default {
},
/** 查询备品备件台账管理列表 */
getList() {
this.sparePartsLedgerList = null;
this.total = 0;
this.loading = true;
listSparePartsLedger(this.queryParams).then((response) => {
this.sparePartsLedgerList = response.rows;
@ -258,6 +256,7 @@ export default {
cancel() {
this.showFlag = false;
this.reset();
this.resetQuery();
},
//
reset() {
@ -338,7 +337,8 @@ export default {
} else {
this.$emit("onSelected", this.$refs.multipleTable.selection);
this.showFlag = false;
this.getList();
//
this.resetQuery();
}
},
},

@ -1238,7 +1238,7 @@ export default {
},
queryAuxiliaryEquipmentParams: {
pageNum: 1,
pageSize: 1000,
pageSize: 10000,
equipmentCategory: null,
equipmentCode: null,
},
@ -1325,7 +1325,7 @@ export default {
/**查询人员**/
getEquipmentHead() {
this.queryEquipmentHeadParams.pageNum = 1;
this.queryEquipmentHeadParams.pageSize = 2000;
this.queryEquipmentHeadParams.pageSize = 10000;
listTeamMembers(this.queryHeadParams).then((response) => {
this.equipmentHeadOption = response.rows;
});
@ -1471,7 +1471,7 @@ export default {
handleAdd() {
this.reset();
getWorkCenterList().then((response) => {
this.options1 = response.rows;
this.options1 = response.data;
});
this.repairRecordSteps = 0;
this.rightList = [];
@ -1500,7 +1500,7 @@ export default {
const equipmentId = row.equipmentId || this.ids;
getWorkCenterList().then((response) => {
this.options1 = response.rows;
this.options1 = response.data;
});
getEquipment(equipmentId).then((response) => {

@ -336,7 +336,7 @@ export default {
getTeamMembers() {
//
this.queryParams.pageNum = 1;
this.queryParams.pageSize = 2000;
this.queryParams.pageSize = 10000;
listTeamMembers(this.queryParams).then(response => {
console.log(response.rows);
for(let i in response.rows){

Loading…
Cancel
Save