This commit is contained in:
caoqianming 2025-12-12 10:35:26 +08:00
commit fcc36bf29b
8 changed files with 111 additions and 85 deletions

View File

@ -81,7 +81,7 @@
<span v-if="item1 < 0 && ind == 5" <span v-if="item1 < 0 && ind == 5"
></span ></span
> >
<span v-if="item1 < 0 && ind == 5" <span v-if="item1 > 0 && ind == 5"
></span ></span
> >
{{ item1 }} {{ item1 }}
@ -131,7 +131,7 @@
<span v-if="item1 < 0 && ind == 6" <span v-if="item1 < 0 && ind == 6"
></span ></span
> >
<span v-if="item1 < 0 && ind == 6" <span v-if="item1 > 0 && ind == 6"
></span ></span
> >
{{ item1 }} {{ item1 }}
@ -181,7 +181,7 @@
<span v-if="item1 < 0 && ind == 6" <span v-if="item1 < 0 && ind == 6"
></span ></span
> >
<span v-if="item1 < 0 && ind == 6" <span v-if="item1 > 0 && ind == 6"
></span ></span
> >
{{ item1 }} {{ item1 }}
@ -231,7 +231,7 @@
<span v-if="item1 < 0 && ind == 6" <span v-if="item1 < 0 && ind == 6"
></span ></span
> >
<span v-if="item1 < 0 && ind == 6" <span v-if="item1 > 0 && ind == 6"
></span ></span
> >
{{ item1 }} {{ item1 }}
@ -508,7 +508,7 @@ export default {
let lastDiff = 0; let lastDiff = 0;
if (arrs[1] !== "/" && arrs[4] !== "/") { if (arrs[1] !== "/" && arrs[4] !== "/") {
lastDiff = arrs[1] - arrs[4]; lastDiff = (arrs[1] - arrs[4]).toFixed(2);
} else { } else {
lastDiff = "/"; lastDiff = "/";
} }
@ -532,10 +532,10 @@ export default {
wrapArr0[index].elec_consume_unit wrapArr0[index].elec_consume_unit
) { ) {
sameRate = sameRate =
((arrs[1] - (((arrs[1] -
wrapArr0[index].elec_consume_unit) / wrapArr0[index].elec_consume_unit) /
wrapArr0[index].elec_consume_unit) * wrapArr0[index].elec_consume_unit) *
100; 100).toFixed(2);
} else { } else {
sameRate = "/"; sameRate = "/";
} }

View File

@ -1231,19 +1231,13 @@ export default {
that.tableDatas[3][2] = 0; that.tableDatas[3][2] = 0;
}else{ }else{
that.tableDatas[1][2] = data4.elec_consume_unit; that.tableDatas[1][2] = data4.production_hour;
that.tableDatas[2][2] = data4.elec_consume; that.tableDatas[2][2] = data4.run_hour;
that.tableDatas[3][2] = data4.production_cost_unit;} that.tableDatas[3][2] = data4.run_rate;
that.tableDatas[4][2] = data4.elec_consume_unit;
that.tableDatas[5][2] = data4.elec_consume;
}
if (data4.imaterial_data.length > 0) {
data4.imaterial_data.forEach((item) => {
if (item.material_name == "湿电石渣消耗") {
that.tableDatas[4][2] = item.amount_consume;
}else if(item.material_name == "湿电石渣进厂"){
that.tableDatas[5][2] = item.amount_consume;
}
});
}
} }
}); });
}, },
@ -1263,40 +1257,32 @@ export default {
that.tableDatas[0][4], that.tableDatas[0][4],
that.tableDatas[0][6] that.tableDatas[0][6]
); );
that.tableDatas[1][4] = data2.elec_consume_unit; that.tableDatas[1][4] = data2.production_hour;
that.tableDatas[1][7] = this.consume_precen( that.tableDatas[1][7] = this.consume_precen(
that.tableDatas[1][4], that.tableDatas[1][4],
that.tableDatas[1][6] that.tableDatas[1][6]
); );
that.tableDatas[2][4] = data2.elec_consume; that.tableDatas[2][4] = data2.run_hour;
that.tableDatas[3][4] = that.tableDatas[3][4] = data2.run_rate;
data2.production_cost_unit;
that.tableDatas[3][7] = this.consume_precen( that.tableDatas[3][7] = this.consume_precen(
that.tableDatas[3][3], that.tableDatas[3][4],
that.tableDatas[3][6] that.tableDatas[3][6]
); );
that.tableDatas[2][7] = this.consume_precen( that.tableDatas[2][7] = this.consume_precen(
that.tableDatas[2][4], that.tableDatas[2][4],
that.tableDatas[2][6] that.tableDatas[2][6]
); );
if (data2.imaterial_data.length > 0) { that.tableDatas[4][4] = data2.elec_consume_unit;
data2.imaterial_data.forEach((item) => { that.tableDatas[4][7] = this.consume_precen(
if (item.material_name == "湿电石渣消耗") { (that.tableDatas[4][4]-that.tableDatas[4][6]),
that.tableDatas[4][4] = (item.amount_consume).toFixed(2);
that.tableDatas[4][7] = this.precen(
that.tableDatas[4][4],
that.tableDatas[4][6] that.tableDatas[4][6]
); );
}else if(item.material_name == "湿电石渣进厂"){ that.tableDatas[5][4] = data2.elec_consume;
that.tableDatas[5][4] = (item.amount_consume).toFixed(2); that.tableDatas[5][7] = this.consume_precen(
that.tableDatas[5][7] = this.precen( (that.tableDatas[5][4] - that.tableDatas[5][6]),
that.tableDatas[5][4],
that.tableDatas[5][6] that.tableDatas[5][6]
); );
} }
});
}
}
}); });
}, },
get_month_year_goal(year, month){ get_month_year_goal(year, month){

View File

@ -2,7 +2,8 @@
<el-container> <el-container>
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-button type="primary" v-auth="'handover.create'" @click="table_add(20)">返工交接</el-button> <el-button type="primary" v-auth="'handover.create'">清除</el-button>
<el-button type="primary" v-auth="'handover.create'" @click="table_add(50)">改版</el-button>
<el-button type="primary" v-auth="'handover.create'" v-if="route_code=='scrap'" @click="table_bsofei(40,30)">合批报废</el-button> <el-button type="primary" v-auth="'handover.create'" v-if="route_code=='scrap'" @click="table_bsofei(40,30)">合批报废</el-button>
</div> </div>
<div class="right-panel"> <div class="right-panel">
@ -26,7 +27,9 @@
row-key="id" row-key="id"
:params="params" :params="params"
:query="query" :query="query"
@selection-change="selectionChange"
> >
<el-table-column type="selection" width="50" />
<el-table-column label="状态" prop="state" width="100" > <el-table-column label="状态" prop="state" width="100" >
<template #default="scope"> <template #default="scope">
<el-tag :type="wmState[scope.row.state]?.type"> <el-tag :type="wmState[scope.row.state]?.type">
@ -41,9 +44,7 @@
> >
<template #default="scope"> <template #default="scope">
{{ scope.row.material_name }} {{ scope.row.material_name }}
<span v-if="scope.row.material_origin != null" <span v-if="scope.row.material_origin != null">{{ scope.row.material_origin_name }}</span>
>{{ scope.row.material_origin_name }}</span
>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -91,6 +92,7 @@
:type="type" :type="type"
:mgroupName="mgroupName" :mgroupName="mgroupName"
:mgroupId="mgroupId" :mgroupId="mgroupId"
:isFeiPinku="isFeiPinku"
@success="handleSaveSuccess" @success="handleSaveSuccess"
@closed="dialog.save = false" @closed="dialog.save = false"
> >
@ -98,20 +100,27 @@
</el-container> </el-container>
</template> </template>
<script> <script>
import saveDialog from "../wpm_gx/handover_form.vue";
import saveDialog from "../wpm_bx/handover_form.vue";
import { wmState } from "@/utils/enum.js"; import { wmState } from "@/utils/enum.js";
export default { export default {
components: { components: {
saveDialog saveDialog
}, },
props: {
isFeiPinku: {
type: Boolean,
default: false,
},
},
name: "wmaterial", name: "wmaterial",
data() { data() {
return { return {
wmState, wmState,
apiObj: null, apiObj: null,
params: { params: {
state : 10, state_all: 1,
state_all: 1 mgroup:"",
}, },
dialog: { dialog: {
save: false, save: false,
@ -119,6 +128,7 @@ export default {
query:{ query:{
search:'' search:''
}, },
selectiones: [],
type:20, type:20,
mgroupName:'废品库', mgroupName:'废品库',
mgroupId:'', mgroupId:'',
@ -129,25 +139,25 @@ export default {
that.route_code = that.$route.path.split("/")[2]; that.route_code = that.$route.path.split("/")[2];
if(that.route_code=='scrap'){ if(that.route_code=='scrap'){
that.params.material__type = 30; that.params.material__type = 30;
}else{
that.params.state = 50;
} }
that.$API.mtm.mgroup.list.req({ page: 0,name:'废品库'}).then((res) => {
that.mgroupId = that.params.mgroup = res[0].id;
that.apiObj = that.$API.wpm.wmaterial.list; that.apiObj = that.$API.wpm.wmaterial.list;
that.$API.mtm.mgroup.list.req({ page: 0}).then((res) => {
that.mgroupOptions = res;
res.forEach(item=>{
if(item.name=="废品库"){
that.mgroupId = item.id;
}
})
}); });
}, },
methods: { methods: {
//
selectionChange(selection) {
this.selectiones = selection;
},
// //
table_add(type) { table_add(type) {
this.dialog.save = true; this.dialog.save = true;
this.type = type; this.type = type;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.saveDialog.open("add"); this.$refs.saveDialog.open("add",this.selectiones);
}); });
}, },
table_bsofei(type,mtype) { table_bsofei(type,mtype) {

View File

@ -14,7 +14,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="车辆" prop="vehiclereg"> <el-form-item label="车辆" prop="vehreg">
<el-select v-model="form.vehreg" placeholder="请选择车辆" @change="vehChange" style="width: 100%;" :readonly="localMode === 'show'"> <el-select v-model="form.vehreg" placeholder="请选择车辆" @change="vehChange" style="width: 100%;" :readonly="localMode === 'show'">
<el-option <el-option
v-for="item in vehRegList" v-for="item in vehRegList"
@ -135,7 +135,7 @@ export default {
ticket_:null, ticket_:null,
// //
rules: { rules: {
vehiclereg: [{ required: true, message: "请输入车辆名称", trigger: "blur" }], vehreg: [{ required: true, message: "请输入车辆名称", trigger: "blur" }],
vdate: [{ required: true, message: "请选择时间", trigger: "blur" }], vdate: [{ required: true, message: "请选择时间", trigger: "blur" }],
// title: [{ required: true, message: "", trigger: "blur" }], // title: [{ required: true, message: "", trigger: "blur" }],
}, },
@ -234,7 +234,7 @@ export default {
let that = this; let that = this;
let form = {}; let form = {};
form.page = 0; form.page = 0;
form.vehiclereg = that.form.vehiclereg; form.vehreg = that.form.vehreg;
form.vdate = that.form.vdate; form.vdate = that.form.vdate;
that.timesList.forEach(slot=>{ that.timesList.forEach(slot=>{
slot.sloted = false; slot.sloted = false;
@ -247,14 +247,14 @@ export default {
}, },
mdateChange(){ mdateChange(){
let that = this; let that = this;
if(that.form.vehiclereg!==''&&that.form.vehiclereg!==null){ if(that.form.vehreg!==''&&that.form.vehreg!==null){
that.getmRoomSlot(); that.getmRoomSlot();
} }
}, },
vehChange(){ vehChange(){
let that = this; let that = this;
that.vehRegList.forEach(item=>{ that.vehRegList.forEach(item=>{
if(item.id == that.form.vehiclereg){ if(item.id == that.form.vehreg){
that.mroomName = item.name; that.mroomName = item.name;
that.bookingTitle = item.name+"预定"; that.bookingTitle = item.name+"预定";
if(that.form.vdate!==''&&that.form.vdate!==null){ if(that.form.vdate!==''&&that.form.vdate!==null){
@ -285,7 +285,7 @@ export default {
}, },
handleEidt(id) { handleEidt(id) {
let that = this; let that = this;
that.$API.ofm.vehicleslot.list.req({booking:id,page:0}).then(res=>{ that.$API.ofm.vehicleslot.list.req({vehicle_use:id,page:0}).then(res=>{
res.forEach(item=>{ res.forEach(item=>{
that.timesList[item.slot].isSelect = true; that.timesList[item.slot].isSelect = true;
}) })

View File

@ -1,7 +1,7 @@
<template> <template>
<el-container> <el-container>
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel" v-if="!isFeiPinku">
<el-button <el-button
type="primary" type="primary"
icon="el-icon-plus" icon="el-icon-plus"
@ -22,6 +22,7 @@
v-auth="'handover.create'" v-auth="'handover.create'"
>改版</el-button> >改版</el-button>
</div> </div>
<div class="left-panel" v-else></div>
<div class="right-panel"> <div class="right-panel">
<el-select <el-select
v-model="searchType" v-model="searchType"
@ -250,6 +251,10 @@ export default {
type: String, type: String,
default: "", default: "",
}, },
isFeiPinku: {
type: Boolean,
default: false,
},
}, },
name: "handover", name: "handover",
components: { components: {

View File

@ -224,7 +224,7 @@
</el-col> </el-col>
<el-col :md="12" :sm="24" v-if="change_batch"> <el-col :md="12" :sm="24" v-if="change_batch">
<el-form-item label="新批次号" prop="new_batch"> <el-form-item label="新批次号" prop="new_batch">
<el-input v-model="form.new_batch" placeholder="新批次号" @change="new_batch(form.new_batch)" :disabled="type==50"></el-input> <el-input v-model="form.new_batch" placeholder="新批次号" @change="new_batch(form.new_batch)" :disabled="type==50&&isFeiPinku"></el-input>
<span style="color: red;">请手动录入新批次号不要用已有批次</span> <span style="color: red;">请手动录入新批次号不要用已有批次</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -253,6 +253,10 @@ export default {
type: String, type: String,
default: "", default: "",
}, },
isFeiPinku: {
type: Boolean,
default: false,
},
tag: { tag: {
type: String, type: String,
default: "done", default: "done",
@ -409,16 +413,14 @@ export default {
that.getUserList(); that.getUserList();
} }
// //
if(that.type==10||that.type==50){// if(that.type==10){//
that.getMaterial(); that.getMaterial();
}else if(that.type==20){// }else if(that.type==20){//
if(that.mgroupName=='废品库'){
that.getMaterialFP();
}else{
that.getMaterialOkFangong(); that.getMaterialOkFangong();
} }else if(that.type==40){//
}else if(that.type==40){//
that.getMaterialNotok(); that.getMaterialNotok();
}else if(that.type==50){//
that.getMaterialFP();
} }
that.getMgroupOptions(); that.getMgroupOptions();
}, },
@ -474,12 +476,10 @@ export default {
let that = this; let that = this;
var req = { var req = {
page: 0, page: 0,
state:10,
tag:that.tag, tag:that.tag,
mgroupx:that.mgroupId mgroupx:that.mgroupId
}; };
if(that.type!==50){
req.state = 10;
}
that.materialOptions = []; that.materialOptions = [];
this.$API.wpm.wmaterial.list.req(req).then((res) => { this.$API.wpm.wmaterial.list.req(req).then((res) => {
that.materialOptions = res.filter(item=>{ that.materialOptions = res.filter(item=>{
@ -507,9 +507,13 @@ export default {
that.materialOptions = []; that.materialOptions = [];
var obj = { var obj = {
page: 0, page: 0,
state : 50,
state_all: 1 state_all: 1
}; };
if(that.isFeiPinku){
obj.state = 50;
}else{
obj.mgroupx=that.mgroupId;
}
that.$API.wpm.wmaterial.list.req(obj).then((res) => { that.$API.wpm.wmaterial.list.req(obj).then((res) => {
that.materialOptions = res.filter(item=>{ that.materialOptions = res.filter(item=>{
return item.count_canhandover>0; return item.count_canhandover>0;
@ -616,9 +620,17 @@ export default {
if(data&&data!==''&&data.length>0){ if(data&&data!==''&&data.length>0){
that.totalCount = 0; that.totalCount = 0;
data.forEach((item,index)=>{ data.forEach((item,index)=>{
item.wm = item.id;
that.totalCount += Number(item.count); that.totalCount += Number(item.count);
that.getWprList(item.wm,index); that.getWprList(item.wm,index);
}) })
console.log('that.isFeiPinku',that.isFeiPinku);
if(that.isFeiPinku){
console.log('data[0].material',data[0].material);
that.form.new_batch = data[0].batch;
that.form.material_changed = data[0].material;
that.form.material_changed_fname = data[0].material_name;
}
} }
that.visible = true; that.visible = true;
return this; return this;
@ -636,9 +648,14 @@ export default {
data = that.materialOptions.filter((item) => { data = that.materialOptions.filter((item) => {
return that.selectItems.indexOf(item.id)>-1; return that.selectItems.indexOf(item.id)>-1;
}); });
if(that.type==50){ if(that.type==50&&!that.isFeiPinku){
that.form.new_batch = data[0].batch+'-G'; that.form.new_batch = data[0].batch+'-G';
} }
if(that.type==50&&that.isFeiPinku){
that.form.new_batch = data[0].batch;
that.form.material_changed = data[0].material;
that.form.material_changed_fname = data[0].material_name;
}
let materialId = data[0].material; let materialId = data[0].material;
if(that.type==50){}else{ if(that.type==50){}else{
let params = { let params = {

View File

@ -54,6 +54,7 @@
:mgroupName="mgroupName" :mgroupName="mgroupName"
:mgroupId="mgroupId" :mgroupId="mgroupId"
:deptId="mgroupDept" :deptId="mgroupDept"
:isFeiPinku="isFeiPinku"
:process = "mgroupProcess" :process = "mgroupProcess"
:processType = "mgroupProcessType" :processType = "mgroupProcessType"
:mgroup_code="mgroup_code" :mgroup_code="mgroup_code"
@ -65,6 +66,7 @@
:mgroupName="mgroupName" :mgroupName="mgroupName"
:mgroupId="mgroupId" :mgroupId="mgroupId"
:deptId="mgroupDept" :deptId="mgroupDept"
:isFeiPinku="isFeiPinku"
:process = "mgroupProcess" :process = "mgroupProcess"
:processType = "mgroupProcessType" :processType = "mgroupProcessType"
:mgroup_code="mgroup_code" :mgroup_code="mgroup_code"

View File

@ -57,12 +57,18 @@
<span v-if="!row.isEdit || !item.canEdit">{{ row[item.testitem_name] }}</span> <span v-if="!row.isEdit || !item.canEdit">{{ row[item.testitem_name] }}</span>
<input v-if="item.testitem_field_type == 'input-number' && row.isEdit && item.canEdit" <input v-if="item.testitem_field_type == 'input-number' && row.isEdit && item.canEdit"
type="number" v-model="row[item.testitem_name]" @change="defectCountSun(row)"> type="number" v-model="row[item.testitem_name]" @change="defectCountSun(row)">
<input v-if="item.testitem_field_type == 'input-int' && row.isEdit && item.canEdit"
type="number" v-model="row[item.testitem_name]" @change="defectCountSun(row)">
<input v-if="item.testitem_field_type == 'input-text' && row.isEdit && item.canEdit" <input v-if="item.testitem_field_type == 'input-text' && row.isEdit && item.canEdit"
type="text" v-model="row[item.testitem_name]" @change="defectCountSun(row)"> type="text" v-model="row[item.testitem_name]" @change="defectCountSun(row)">
<select v-if="item.testitem_field_type == 'select-text' && row.isEdit && item.canEdit" <select v-if="item.testitem_field_type == 'select-text' && row.isEdit && item.canEdit"
v-model="row[item.testitem_name]" @change="defectCountSun(row)"> v-model="row[item.testitem_name]" @change="defectCountSun(row)">
<option v-for="item0 in item.testitem_choices" :key="item0" :value="item0">{{ item0 }}</option> <option v-for="item0 in item.testitem_choices" :key="item0" :value="item0">{{ item0 }}</option>
</select> </select>
<select v-if="item.testitem_field_type == 'selects-text' && row.isEdit && item.canEdit"
v-model="row[item.testitem_name]" @change="defectCountSun(row)">
<option v-for="item0 in item.testitem_choices" :key="item0" :value="item0">{{ item0 }}</option>
</select>
</td> </td>
<td class="w_80 inlineBlock padding_4 defectBlock" v-for="item in qct_defects" :key="item.id"> <td class="w_80 inlineBlock padding_4 defectBlock" v-for="item in qct_defects" :key="item.id">
<input type="checkbox" :disabled="!row.isEdit || !item.canEdit" v-model="row[item.defect_name]" @change="switchChange(row, item,index)"> <input type="checkbox" :disabled="!row.isEdit || !item.canEdit" v-model="row[item.defect_name]" @change="switchChange(row, item,index)">