Merge remote-tracking branch 'origin/master'

master
mengjiao 8 months ago
commit 4c035dda23

@ -17,6 +17,13 @@ export function getProduct(userCode) {
}); });
} }
export function getInfoById(id) {
return request({
url: '/quality/material/getInfoById/' + id,
method: 'get'
});
}
// 新增用户物料关联 // 新增用户物料关联
export function addProduct(data) { export function addProduct(data) {
return request({ return request({

@ -904,7 +904,7 @@ export default {
for (let i = 0; i < response.data.length; i++) { for (let i = 0; i < response.data.length; i++) {
this.personList.push({ this.personList.push({
label: response.data[i].nickName + '(' + response.data[i].userName + ')', label: response.data[i].nickName + '(' + response.data[i].userName + ')',
key: response.data[i].userName, key: response.data[i].userId,
}) })
} }
}); });

@ -949,7 +949,7 @@ export default {
for (let i = 0; i < response.data.length; i++) { for (let i = 0; i < response.data.length; i++) {
this.personList.push({ this.personList.push({
label: response.data[i].nickName + '(' + response.data[i].userName + ')', label: response.data[i].nickName + '(' + response.data[i].userName + ')',
key: response.data[i].userName, key: response.data[i].userId,
}) })
} }
}); });

@ -73,14 +73,6 @@
/> />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="二级类型" align="center" prop="attr1" width="150">
<template slot-scope="scope">
<dict-tag
:options="dict.type.order_type_ll"
:value="scope.row.attr1"
/>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@ -146,20 +138,6 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row>
<el-col :span="15">
<el-form-item v-if="form.typeCode=='material'" label="来料类别" prop="attr1">
<el-select v-model="form.attr1" placeholder="请输入来料类别" >
<el-option
v-for="dict in dict.type.order_type_ll"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitForm"> </el-button>
@ -173,7 +151,15 @@
<el-table-column label="序号" align="center" type="index" width="50" /> <el-table-column label="序号" align="center" type="index" width="50" />
<el-table-column label="员工编号" align="center" prop="userCode" /> <el-table-column label="员工编号" align="center" prop="userCode" />
<el-table-column label="姓名" align="center" prop="userName" /> <el-table-column label="姓名" align="center" prop="userName" />
<el-table-column fixed="right" label="操作" width="90"> <el-table-column label="来料类别" align="center" prop="attr1" >
<template slot-scope="scope">
<dict-tag
:options="dict.type.order_type_ll"
:value="scope.row.attr1"
/>
</template>
</el-table-column>
<el-table-column fixed="right" align="center" label="操作" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="small" size="small"
@ -196,13 +182,14 @@
<ItemSelectUser <ItemSelectUser
ref="itemSelectUser" ref="itemSelectUser"
@onSelected="onSelectUser" @onSelected="onSelectUser"
:materialCode="materialCode"
></ItemSelectUser> ></ItemSelectUser>
</div> </div>
</template> </template>
<script> <script>
import { listCheckType, getCheckType, delCheckType, addCheckType, updateCheckType } from "@/api/quality/checkType"; import { listCheckType, getCheckType, delCheckType, addCheckType, updateCheckType } from "@/api/quality/checkType";
import{ getSelectedUsers, addUserBind,deleteByMaterialCode} from "@/api/quality/userbind"; import{ getSelectedUsers, addUserBind, deleteByMaterialCode} from "@/api/quality/userbind";
import ItemSelectUser from "./selectUser.vue"; import ItemSelectUser from "./selectUser.vue";
export default { export default {
name: "CheckType", name: "CheckType",
@ -376,13 +363,12 @@ export default {
handleBind(row){ handleBind(row){
//this.reset(); //this.reset();
this.userloading = true; this.userloading = true;
let sr = row;
//使 //使
this.materialCode = sr.orderCode; this.materialCode = row.orderCode;
this.materialName = sr.checkName; this.materialName = row.checkName;
this.attr1 = sr.attr1; this.attr1 = row.attr1;
this.getUserParams.materialCode = sr.orderCode; this.getUserParams.materialCode = row.orderCode;
// //
getSelectedUsers(this.getUserParams).then(response => { getSelectedUsers(this.getUserParams).then(response => {
this.userList = response.rows; this.userList = response.rows;
@ -392,7 +378,6 @@ export default {
}); });
}, },
getSelectUserList() { getSelectUserList() {
this.userloading = true; this.userloading = true;
//this.getUserParams.materialCode = orderCode; //this.getUserParams.materialCode = orderCode;
@ -418,19 +403,21 @@ export default {
// //
addUser() { addUser() {
this.$refs.itemSelectUser.showFlag = true; this.$refs.itemSelectUser.showFlag = true;
this.$refs.itemSelectUser.getList();
}, },
// //
onSelectUser(obj) { onSelectUser(obj) {
let data = { let data = {
materialCode: this.materialCode, materialCode: this.materialCode,
materialName: this.materialName, materialName: this.materialName,
attr1: this.attr1, attr1List: [],
userCodes: [], userCodes: [],
userNames: [], userNames: [],
} }
obj.forEach((item, index) => { obj.forEach((item, index) => {
data.userCodes.push(item.userCode); data.userCodes.push(item.userCode);
data.userNames.push(item.userName); data.userNames.push(item.userName);
data.attr1List.push(item.attr1);
}); });
addUserBind(data).then(response => { addUserBind(data).then(response => {
if(response.code === 200) { if(response.code === 200) {

@ -64,8 +64,19 @@
<el-table-column label="员工姓名" align="left" key="userName" prop="userName" :show-overflow-tooltip="true" /> <el-table-column label="员工姓名" align="left" key="userName" prop="userName" :show-overflow-tooltip="true" />
<el-table-column label="员工部门" align="left" key="deptName" prop="deptName" :show-overflow-tooltip="true" /> <el-table-column label="员工部门" align="left" key="deptName" prop="deptName" :show-overflow-tooltip="true" />
<el-table-column label="手机号" align="left" key="phonenumber" prop="phonenumber" :show-overflow-tooltip="true" /> <el-table-column label="手机号" align="left" key="phonenumber" prop="phonenumber" :show-overflow-tooltip="true" />
<el-table-column label="来料类型分配" v-if="materialCode === 'checkTypeLL'" align="left" prop="attr1" width="150">
<template slot-scope="scope">
<el-select v-model="scope.row.attr1" placeholder="请选择来料类别" clearable>
<el-option
v-for="dict in dict.type.order_type_ll"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</template>
</el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="total>0" v-show="total>0"
:total="total" :total="total"
@ -75,7 +86,7 @@
/> />
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitBomForm"> </el-button> <el-button type="primary" @click="submitBomForm"> </el-button>
<el-button @click="showFlag=false"> </el-button> <el-button @click="cancel"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
</template> </template>
@ -87,7 +98,9 @@ import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default { export default {
name: "itemSelectUser", name: "itemSelectUser",
dicts: ["order_type_ll"],
components: { Treeselect }, components: { Treeselect },
props: { materialCode: { type: String, default: "" }},
data() { data() {
return { return {
showFlag:false, showFlag:false,
@ -125,7 +138,6 @@ export default {
this.getList(); this.getList();
this.getDeptTree(); this.getDeptTree();
}, },
methods: { methods: {
/** 查询表格列表*/ /** 查询表格列表*/
@ -150,7 +162,10 @@ export default {
this.resetForm("queryUserForm"); this.resetForm("queryUserForm");
this.handleQuery(); this.handleQuery();
}, },
cancel() {
this.showFlag = false;
this.itemList = [];
},
// //
handleBomSelectionChange(selection) { handleBomSelectionChange(selection) {
@ -167,6 +182,7 @@ export default {
submitBomForm() { submitBomForm() {
this.$emit('onSelected', this.selectedRows); this.$emit('onSelected', this.selectedRows);
this.itemList = [];
this.showFlag = false; this.showFlag = false;
} }
} }

@ -59,7 +59,6 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="设备类别" prop="equipmentCategory"> <el-form-item label="设备类别" prop="equipmentCategory">
<el-select <el-select
v-model="queryParams.equipmentCategory" v-model="queryParams.equipmentCategory"
@ -75,6 +74,22 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="工厂车间" prop="factoryWorkshop">
<el-select
v-model="queryParams.factoryWorkshop"
placeholder="工厂车间"
style="width: 200px"
clearable
>
<el-option
v-for="dict in dict.type.factory_workshop"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button
type="primary" type="primary"
@ -279,6 +294,19 @@
prop="workshopName" prop="workshopName"
width="150" width="150"
/> />
<el-table-column
prop="factoryWorkshop"
label="工厂车间"
width="150"
align="center"
>
<template slot-scope="scope">
<dict-tag
:options="dict.type.factory_workshop"
:value="scope.row.factoryWorkshop"
/>
</template>
</el-table-column>
<el-table-column label="设备IP" align="center" prop="plcIp" width="150" /> <el-table-column label="设备IP" align="center" prop="plcIp" width="150" />
<el-table-column <el-table-column
label="设备端口号" label="设备端口号"
@ -560,6 +588,23 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="8">
<el-form-item label="设备类别" prop="equipmentCategory">
<el-select
@change="changeHandler"
v-model="form.equipmentCategory"
placeholder="请选择设备类别"
style="width: 195px"
>
<el-option
v-for="dict in dict.type.equipment_category"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="sap线体编码" prop="sapCode"> <el-form-item label="sap线体编码" prop="sapCode">
<el-input <el-input
@ -576,15 +621,17 @@
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row>
<el-row :gutter="10" class="mb8">
<el-col :span="8"> <el-col :span="8">
<el-form-item label="设备类别" prop="equipmentCategory"> <el-form-item label="工厂车间" prop="factoryWorkshop">
<el-select <el-select
v-model="form.equipmentCategory" v-model="form.factoryWorkshop"
placeholder="请选择设备类别" placeholder="请选择工厂车间"
style="width: 195px" style="width: 195px"
> >
<el-option <el-option
v-for="dict in dict.type.equipment_category" v-for="dict in dict.type.factory_workshop"
:key="dict.value" :key="dict.value"
:label="dict.label" :label="dict.label"
:value="dict.value" :value="dict.value"
@ -592,7 +639,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="24"> <el-col :span="24">
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
@ -875,7 +922,7 @@
form.equipmentTypeName form.equipmentTypeName
}}</el-descriptions-item> }}</el-descriptions-item>
<el-descriptions-item label="所属工作中心">{{ <el-descriptions-item label="所属工作中心">{{
form.workCenter form.workshopName
}}</el-descriptions-item> }}</el-descriptions-item>
<el-descriptions-item label="工作中心编码">{{ <el-descriptions-item label="工作中心编码">{{
form.workshopCode form.workshopCode
@ -907,6 +954,9 @@
<el-descriptions-item label="设备类别">{{ <el-descriptions-item label="设备类别">{{
form.equipmentCategory form.equipmentCategory
}}</el-descriptions-item> }}</el-descriptions-item>
<el-descriptions-item label="工厂车间">{{
form.factoryWorkshop
}}</el-descriptions-item>
</el-descriptions> </el-descriptions>
<el-divider content-position="center">设备使用状况</el-divider> <el-divider content-position="center">设备使用状况</el-divider>
@ -1130,6 +1180,7 @@ export default {
"equ_type", "equ_type",
"equipment_status", "equipment_status",
"equipment_category", "equipment_category",
"factory_workshop",
], ],
components: { ItemSelectPerson, ItemEquipment, ItemWXRecords, ItemBYRecords }, components: { ItemSelectPerson, ItemEquipment, ItemWXRecords, ItemBYRecords },
data() { data() {
@ -1263,6 +1314,7 @@ export default {
equipmentLocation: null, equipmentLocation: null,
hourlyUnitPrice: null, hourlyUnitPrice: null,
equipmentCategory: null, equipmentCategory: null,
factoryWorkshop: null,
}, },
queryEquipmentHeadParams: { queryEquipmentHeadParams: {
pageNum: 1, pageNum: 1,
@ -1333,6 +1385,8 @@ export default {
equipmentCategory: [ equipmentCategory: [
{ required: true, message: "设备类别不能为空", trigger: "blur" }, { required: true, message: "设备类别不能为空", trigger: "blur" },
], ],
sapName: [],
sapCode: [],
}, },
}; };
}, },
@ -1346,7 +1400,26 @@ export default {
this.sparePartsList(); this.sparePartsList();
this.selectEquipmentTypeDept(); this.selectEquipmentTypeDept();
}, },
methods: { methods: {
//线
changeHandler(value) {
console.log("监听设备类型是不是组线",value);
if (value == "1") {
this.rules.sapCode.push({
required: true,
// message: "线Sap",
});
this.rules.sapName.push({
required: true,
// message: "线Sap",
});
}
else {
this.rules.sapCode.pop();
this.rules.sapName.pop();
}
},
// //
stepLast() { stepLast() {
this.repairRecordSteps--; this.repairRecordSteps--;
@ -1466,6 +1539,7 @@ export default {
unitMeasurement: null, unitMeasurement: null,
sapCode: null, sapCode: null,
sapName: null, sapName: null,
factoryWorkshop: null,
}; };
this.resetForm("form"); this.resetForm("form");
}, },
@ -1617,6 +1691,14 @@ export default {
}); });
this.form.barCodeFileList = newFiles; this.form.barCodeFileList = newFiles;
} }
if (this.form.equipmentCategory == "1") {
this.rules.sapCode.push({
required: true,
});
this.rules.sapName.push({
required: true,
});
}
this.form.workCenter = this.form.workshopCode; this.form.workCenter = this.form.workshopCode;
this.repairRecordSteps = 0; this.repairRecordSteps = 0;
this.queryAuxiliaryEquipmentParams.equipmentCode = null; this.queryAuxiliaryEquipmentParams.equipmentCode = null;
@ -1679,12 +1761,39 @@ export default {
if (this.form.equipmentId != null) { if (this.form.equipmentId != null) {
this.form.rightData = this.rightList; this.form.rightData = this.rightList;
this.form.auxiliaryEquipmentRightData = this.form.auxiliaryEquipmentRightData =
this.auxiliaryEquipmentRightList; this.auxiliaryEquipmentRightList;
updateEquipment(this.form).then((response) => { //
if (this.form.equipmentCode == null) {
this.$message.error(
"【设备基础信息】设备编码为空,请填写设备编码!"
);
} else if (this.form.equipmentName == null) {
this.$message.error(
"【设备基础信息】设备编名称为空,请填写设备名称!"
);
} else if (this.form.status == null) {
this.$message.error(
"【设备使用状况】设备状态为空,请选择设备状态!"
);
} else if (this.form.equipmentTypeCode == null) {
this.$message.error(
"【设备基础信息】设备类型为空,请选择设备类型!"
);
} else if (this.form.equipmentCategory == null) {
this.$message.error(
"【设备基础信息】设备类别为空,请选择设备类别!"
);
}else if (this.form.equipmentCategory == "1" && (this.form.sapName == null ||this.form.sapCode == null)) {
this.$message.error(
"【设备基础信息】Sap编码、Sap名称有空值请填写"
);
}else{
updateEquipment(this.form).then((response) => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
this.getList(); this.getList();
}); });
}
} else { } else {
if (this.form.equipmentCode == null) { if (this.form.equipmentCode == null) {
this.$message.error( this.$message.error(
@ -1706,6 +1815,10 @@ export default {
this.$message.error( this.$message.error(
"【设备基础信息】设备类别为空,请选择设备类别!" "【设备基础信息】设备类别为空,请选择设备类别!"
); );
}else if (this.form.equipmentCategory == "1" && (this.form.sapName == null ||this.form.sapCode == null)) {
this.$message.error(
"【设备基础信息】Sap编码、Sap名称有空值请填写"
);
} else { } else {
this.form.auxiliaryEquipmentRightData = this.form.auxiliaryEquipmentRightData =
this.auxiliaryEquipmentRightList; this.auxiliaryEquipmentRightList;

Loading…
Cancel
Save