This commit is contained in:
caoqianming 2023-11-14 10:28:17 +08:00
commit 6eee28c91d
16 changed files with 442 additions and 283 deletions

BIN
public/glb/photon3.glb Normal file

Binary file not shown.

View File

@ -167,7 +167,7 @@ export default {
this.initChart(); this.initChart();
this.initDomStyle(); this.initDomStyle();
this.initFactory(); this.initFactory();
}) })
}, },
methods: { methods: {
initDomStyle() { initDomStyle() {
@ -194,7 +194,6 @@ export default {
}, },
initFactory() { initFactory() {
var that = this; var that = this;
const canvas = document.getElementById("renderCanvas"); // Get the canvas element const canvas = document.getElementById("renderCanvas"); // Get the canvas element
const engine = new BABYLON.Engine(canvas, true); // Generate the BABYLON 3D engine const engine = new BABYLON.Engine(canvas, true); // Generate the BABYLON 3D engine
BABYLON.DefaultLoadingScreen.prototype.displayLoadingUI = function () { BABYLON.DefaultLoadingScreen.prototype.displayLoadingUI = function () {
@ -202,7 +201,6 @@ export default {
BABYLON.DefaultLoadingScreen.prototype.hideLoadingUI = function () { BABYLON.DefaultLoadingScreen.prototype.hideLoadingUI = function () {
document.getElementById("loadingScreen").style.display = "none"; document.getElementById("loadingScreen").style.display = "none";
} }
engine.displayLoadingUI(); engine.displayLoadingUI();
const createScene = function () { const createScene = function () {
const scene = new BABYLON.Scene(engine); const scene = new BABYLON.Scene(engine);
@ -265,7 +263,6 @@ export default {
BABYLON.Animation.CreateAndStartAnimation('at61', camera, 'target', 45, 200, camera.target, that.initialTarget, 0, ease); BABYLON.Animation.CreateAndStartAnimation('at61', camera, 'target', 45, 200, camera.target, that.initialTarget, 0, ease);
} }
}) })
// mesh // mesh
const mesh_rect = new BABYLON_GUI.Rectangle('mesh_rect'); const mesh_rect = new BABYLON_GUI.Rectangle('mesh_rect');
mesh_rect.width = "200px"; mesh_rect.width = "200px";
@ -274,7 +271,6 @@ export default {
mesh_rect.alpha = 0.6; mesh_rect.alpha = 0.6;
mesh_rect.isVisible = false; mesh_rect.isVisible = false;
advancedTexture.addControl(mesh_rect); advancedTexture.addControl(mesh_rect);
var mesh_name = new BABYLON_GUI.TextBlock('mesh_name'); var mesh_name = new BABYLON_GUI.TextBlock('mesh_name');
mesh_name.text = ""; mesh_name.text = "";
mesh_name.color = 'white'; mesh_name.color = 'white';
@ -284,7 +280,6 @@ export default {
BABYLON.SceneLoader.Append('glb/', "photon3.glb", scene, function (scene) { BABYLON.SceneLoader.Append('glb/', "photon3.glb", scene, function (scene) {
// //
// scene.lights[1].setEnabled(false); // scene.lights[1].setEnabled(false);
// setEnable
engine.hideLoadingUI() engine.hideLoadingUI()
// for (let key in that.nodesLists) { // for (let key in that.nodesLists) {
// // const value = that.nodesLists[key]; // // const value = that.nodesLists[key];
@ -322,18 +317,17 @@ export default {
// } // }
// } // }
}, },
// //
function (evt) { function (evt) {
var loadedPercent = 0; var loadedPercent = 0;
if (evt.lengthComputable) { if (evt.lengthComputable) {
loadedPercent = parseInt(evt.loaded * 100 / evt.total); loadedPercent = parseInt(evt.loaded * 100 / evt.total);
} else { } else {
var dlCount = evt.loaded / (1024 * 1024); var dlCount = evt.loaded / (1024 * 1024);
loadedPercent = Math.floor(dlCount * 100.0) / 100.0; loadedPercent = Math.floor(dlCount * 100.0) / 100.0;
} }
that.loadedPercent = loadedPercent; that.loadedPercent = loadedPercent;
}) })
// checkbox // checkbox
var checkbox = new BABYLON_GUI.Checkbox(); var checkbox = new BABYLON_GUI.Checkbox();
checkbox.width = "20px"; checkbox.width = "20px";
@ -400,14 +394,13 @@ export default {
if (mesh.name == '单身宿舍.005_primitive3') { if (mesh.name == '单身宿舍.005_primitive3') {
//宿.003_primitive3 //宿.003_primitive3
// mesh // mesh
highlightLayer.addMesh(mesh, new BABYLON.Color3(1, 1, 0.5)); highlightLayer.addMesh(mesh, new BABYLON.Color3(0.1, 0.9, 0.9));
that.currentLightMesh = mesh; that.currentLightMesh = mesh;
mesh_rect.linkWithMesh(mesh); mesh_rect.linkWithMesh(mesh);
let name = mesh.name.split('_')[0]; let name = mesh.name.split('_')[0];
mesh_name.text = name; mesh_name.text = name;
// mesh_rect.isVisible = true; // mesh_rect.isVisible = true;
that.infoVisibel = true; that.infoVisibel = true;
hl1.addMesh(mesh, new BABYLON.Color3(12 / 255, 250 / 255, 252 / 255), true); hl1.addMesh(mesh, new BABYLON.Color3(12 / 255, 250 / 255, 252 / 255), true);
hl1.blurVerticalSize = 5; hl1.blurVerticalSize = 5;
hl1.blurHorizontalSize = 5; hl1.blurHorizontalSize = 5;
@ -427,7 +420,6 @@ export default {
} }
}); });
canvas.addEventListener('mousedown', (event) => { canvas.addEventListener('mousedown', (event) => {
debugger;
// 使 scene.pick // 使 scene.pick
const pickResult = scene.pick(scene.pointerX, scene.pointerY); const pickResult = scene.pick(scene.pointerX, scene.pointerY);
if (pickResult.hit) { if (pickResult.hit) {
@ -453,7 +445,6 @@ export default {
} }
} }
}); });
// checkbox.isChecked = true; // // checkbox.isChecked = true; //
// scene.onPointerObservable.add((pointerInfo) => { // scene.onPointerObservable.add((pointerInfo) => {
// switch (pointerInfo.type) { // switch (pointerInfo.type) {
@ -486,14 +477,14 @@ export default {
// }) // })
return scene; return scene;
}; };
const scene = createScene(); //Call the createScene function const scene = createScene(); //Call the createScene function
// scene.debugLayer.show() scene.debugLayer.show()
engine.runRenderLoop(function () { engine.runRenderLoop(function () {
scene.render(); scene.render();
}); });
this.engine = engine; this.engine = engine;
this.scene = scene; this.scene = scene;
console.log('scene:',scene)
window.addEventListener("resize", function () { window.addEventListener("resize", function () {
engine.resize(); engine.resize();
}); });

View File

@ -9,10 +9,10 @@
<el-descriptions-item label="部门/车间">{{ mioObj.belong_dept_name }}</el-descriptions-item> <el-descriptions-item label="部门/车间">{{ mioObj.belong_dept_name }}</el-descriptions-item>
<el-descriptions-item label="执行人">{{ mioObj.do_user_name }}</el-descriptions-item> <el-descriptions-item label="执行人">{{ mioObj.do_user_name }}</el-descriptions-item>
<el-descriptions-item label="创建时间">{{ mioObj.create_time }}</el-descriptions-item> <el-descriptions-item label="创建时间">{{ mioObj.create_time }}</el-descriptions-item>
<el-descriptions-item label="采购订单">{{ mioObj.order_number }}</el-descriptions-item> <el-descriptions-item label="采购订单" v-if="mioObj.type=='pur_in'">{{ mioObj.order_number }}</el-descriptions-item>
<el-descriptions-item label="销售订单">{{ mioObj.pu_order_number }}</el-descriptions-item> <el-descriptions-item label="供应商" v-if="mioObj.type=='pur_in'">{{ mioObj.supplier_name }}</el-descriptions-item>
<el-descriptions-item label="供应商/客户">{{ mioObj.supplier_name }}{{ <el-descriptions-item label="销售订单" v-if="mioObj.type=='sale_out'">{{ mioObj.pu_order_number }}</el-descriptions-item>
mioObj.customer_name }}</el-descriptions-item> <el-descriptions-item label="客户" v-if="mioObj.type=='sale_out'">{{mioObj.customer_name }}</el-descriptions-item>
</el-descriptions> </el-descriptions>
<el-button type="primary" @click="mioSubmit" v-auth="'mio.submit'" v-if="mioObj.state == 10"> <el-button type="primary" @click="mioSubmit" v-auth="'mio.submit'" v-if="mioObj.state == 10">
提交 提交
@ -57,7 +57,7 @@
</el-card> </el-card>
</div> </div>
</div> </div>
<save-dialog v-if="dialog.save" ref="saveDialog" :mioId="mioId" :belongDeptId="belongDeptId" :mioObj="mioObj" <save-dialog v-if="dialog.save" ref="saveDialog" :mioId="mioId" :belongDeptId="belongDeptId" :belongDeptName="mioObj.belong_dept_name" :mioObj="mioObj"
@success="handleSaveSuccess" @closed="dialog.save = false"> @success="handleSaveSuccess" @closed="dialog.save = false">
</save-dialog> </save-dialog>

View File

@ -6,30 +6,34 @@
@change="selectMaterialChange"> @change="selectMaterialChange">
<el-option v-for="item in materialOptions" :key="item.id" :label="item.number" :value="item"> <el-option v-for="item in materialOptions" :key="item.id" :label="item.number" :value="item">
<span style="float: left">{{ item.number }}</span> <span style="float: left">{{ item.number }}</span>
<span style=" <span style=" float: right; color: var(--el-text-color-secondary);font-size: 13px;">{{ item.name }}</span>
float: right;
color: var(--el-text-color-secondary);
font-size: 13px;
">{{ item.name }}</span>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="仓库批次号"> <el-form-item label="批次号">
<!-- <el-input v-model="form.batch" placeholder="手动输入批次号" :disabled="inputBatchDisable" /> -->
<el-select v-model="form.batch" value-key="id" filterable allow-create clearable style="width: 100%;" :disabled="inputBatchDisable">
<el-option
v-for="item in wbatchOptions"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="仓库已有批次">
<el-select v-model="selectBatch" value-key="id" clearable style="width: 100%;" @change="selectBatchChange" <el-select v-model="selectBatch" value-key="id" clearable style="width: 100%;" @change="selectBatchChange"
@clear="selectBatchClear" :disabled="selectBatchDisable"> @clear="selectBatchClear" :disabled="selectBatchDisable">
<el-option v-for="item in batchOptions" :key="item.id" :label="item.batch" :value="item"> <el-option v-for="item in batchOptions" :key="item.id" :label="item.batch" :value="item">
<span style="float: left">{{ item.batch }}</span> <span style="float: left">{{ item.batch }}</span>
<span style=" <span style="
float: right; float: right;
color: var(--el-text-color-secondary); color: var(--el-text-color-secondary);
font-size: 13px; font-size: 13px;
">{{ item.count }} -- {{ item.warehouse_name }}</span> ">{{ item.count }} -- {{ item.warehouse_name }}</span>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="新批次号">
<el-input v-model="form.batch" placeholder="手动输入新批次" :disabled="inputBatchDisable" />
</el-form-item>
<el-form-item label="仓库"> <el-form-item label="仓库">
<el-select v-model="form.warehouse" clearable style="width: 100%;" :disabled="warehouseDisable"> <el-select v-model="form.warehouse" clearable style="width: 100%;" :disabled="warehouseDisable">
<el-option v-for="item in warehouseOptions" :key="item.id" :label="item.name" <el-option v-for="item in warehouseOptions" :key="item.id" :label="item.name"
@ -77,6 +81,7 @@ export default {
emits: ["success", "closed"], emits: ["success", "closed"],
props: { props: {
mioId: { type: String, default: '' }, mioId: { type: String, default: '' },
belongDeptName:{type: String, default: ''},
belongDeptId: { type: String, default: null }, belongDeptId: { type: String, default: null },
mioObj: { type: Object } mioObj: { type: Object }
}, },
@ -109,9 +114,11 @@ export default {
selectMaterial: null, selectMaterial: null,
selectBatch: null, selectBatch: null,
components: [], components: [],
wbatchOptions:[],
}; };
}, },
mounted() { mounted() {
this.getBatchs();
}, },
methods: { methods: {
init() { init() {
@ -123,6 +130,13 @@ export default {
this.warehouseOptions = res this.warehouseOptions = res
}) })
}, },
//
getBatchs(){
let that = this;
this.$API.wpm.wmaterial.batchs.req({belong_dept_name:this.belongDeptName}).then(res=>{
that.wbatchOptions = res;
});
},
getMaterialOptions() { getMaterialOptions() {
var type = this.form.type var type = this.form.type
var query var query

View File

@ -14,6 +14,11 @@
<el-input v-model="form.name" placeholder="物料名称" /> <el-input v-model="form.name" placeholder="物料名称" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24" prop="cate">
<el-form-item label="物料cate">
<el-input v-model="form.cate" placeholder="物料名称" />
</el-form-item>
</el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="规格型号"> <el-form-item label="规格型号">
<el-input v-model="form.specification" placeholder="规格型号" /> <el-input v-model="form.specification" placeholder="规格型号" />

View File

@ -3,11 +3,11 @@
<el-main id="topContainer" class="nopadding" style="position: relative;margin-bottom: 10px;"> <el-main id="topContainer" class="nopadding" style="position: relative;margin-bottom: 10px;">
<div class="right-panel btnsContainer"> <div class="right-panel btnsContainer">
<el-button type="primary" icon="el-icon-plus" @click="add">新增任务</el-button> <el-button type="primary" icon="el-icon-plus" @click="add">新增任务</el-button>
<el-button type="primary" @click="utaskDepuse" v-loading="isloading">任务分解</el-button> <!-- <el-button type="primary" @click="utaskDepuse" v-loading="isloading">任务分解</el-button> -->
<el-button type="primary" @click="utaskAssgin" v-loading="isloading">任务下达</el-button> <el-button type="primary" @click="utaskDepuse" v-loading="isloading">任务下达</el-button>
</div> </div>
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick"> <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
<el-tab-pane label="混料工序" name="8车间"> <!-- <el-tab-pane label="混料工序" name="8车间">
<scTable <scTable
ref="table8" ref="table8"
:apiObj="apiUtask" :apiObj="apiUtask"
@ -69,7 +69,7 @@
</template> </template>
</el-table-column> </el-table-column>
</scTable> </scTable>
</el-tab-pane> </el-tab-pane> -->
<el-tab-pane label="成型7车间" name="7车间"> <el-tab-pane label="成型7车间" name="7车间">
<scTable <scTable
ref="table7" ref="table7"
@ -123,8 +123,6 @@
<el-link type="primary" @click="table_edit(scope.row)" v-if="scope.row.state==10"> <el-link type="primary" @click="table_edit(scope.row)" v-if="scope.row.state==10">
编辑 编辑
</el-link> </el-link>
<el-divider direction="vertical" v-if="scope.row.state==30"></el-divider>
<el-link type="primary" @click="table_end(scope.row)" v-if="scope.row.state==30">终止</el-link>
<el-divider direction="vertical" v-if="scope.row.state==10||scope.row.state==14"></el-divider> <el-divider direction="vertical" v-if="scope.row.state==10||scope.row.state==14"></el-divider>
<el-link type="danger" @click="table_del(scope.row)" v-if="scope.row.state==10||scope.row.state==14"> <el-link type="danger" @click="table_del(scope.row)" v-if="scope.row.state==10||scope.row.state==14">
删除 删除
@ -186,8 +184,8 @@
<el-link type="primary" @click="table_edit(scope.row)" v-if="scope.row.state==10"> <el-link type="primary" @click="table_edit(scope.row)" v-if="scope.row.state==10">
编辑 编辑
</el-link> </el-link>
<el-divider direction="vertical" v-if="scope.row.state==30"></el-divider> <el-divider direction="vertical" v-if="scope.row.state==30||scope.row.state==20"></el-divider>
<el-link type="primary" @click="table_end(scope.row)" v-if="scope.row.state==30">终止</el-link> <el-link type="danger" @click="table_end(scope.row)" v-if="scope.row.state==30||scope.row.state==20">终止</el-link>
<el-divider direction="vertical" v-if="scope.row.state==10||scope.row.state==14"></el-divider> <el-divider direction="vertical" v-if="scope.row.state==10||scope.row.state==14"></el-divider>
<el-link type="danger" @click="table_del(scope.row)" v-if="scope.row.state==10||scope.row.state==14"> <el-link type="danger" @click="table_del(scope.row)" v-if="scope.row.state==10||scope.row.state==14">
删除 删除
@ -199,7 +197,10 @@
</el-tabs> </el-tabs>
</el-main> </el-main>
<el-main class="nopadding" style="position: relative;"> <el-main class="nopadding" style="position: relative;">
<el-header style="justify-content: flex-end;"> <el-header style="justify-content: space-between;">
<div class="left-panel">
<span style="font-size:14px ;">生产进度</span>
</div>
<div class="right-panel"> <div class="right-panel">
<el-date-picker <el-date-picker
v-model="query.date" v-model="query.date"
@ -290,7 +291,7 @@
<el-table-column type="index" width="50"/> <el-table-column type="index" width="50"/>
<el-table-column label="工段" prop="mgroup_name" show-overflow-tooltip> <el-table-column label="工段" prop="mgroup_name" show-overflow-tooltip>
</el-table-column> </el-table-column>
<el-table-column label="物料编号" prop="number"> <el-table-column label="任务编号" prop="number">
</el-table-column> </el-table-column>
<el-table-column label="数量" prop="count"> <el-table-column label="数量" prop="count">
</el-table-column> </el-table-column>
@ -339,12 +340,13 @@ export default {
visibleRecord:false, visibleRecord:false,
tableHeight:null, tableHeight:null,
hideDo:true, hideDo:true,
activeName:'8车间', activeName:'7车间',
dataList:[ dataList:[
{number:'rwbh2023',name:'玻璃棒',xh:'',count:100,count1:100,start_date:'2023-10-15',end_date:'2023-10-15', count01:100, count02:200, count03:300 }, // {number:'rwbh2023',name:'',xh:'',count:100,count1:100,start_date:'2023-10-15',end_date:'2023-10-15', count01:100, count02:200, count03:300 },
{number:'rwbh2023',name:'玻璃棒',xh:'',count:100,count1:100,start_date:'2023-10-15',end_date:'2023-10-15', count01:100, count02:250, count03:300 }, // {number:'rwbh2023',name:'',xh:'',count:100,count1:100,start_date:'2023-10-15',end_date:'2023-10-15', count01:100, count02:250, count03:300 },
], ],
columList:['10.15','10.16','10.17'], // columList:['10.15','10.16','10.17'],
columList:[],
selection: [], selection: [],
selectedIds:[], selectedIds:[],
state_: { state_: {
@ -426,13 +428,13 @@ export default {
this.$confirm(`确定终止该任务吗?`, "提示", { this.$confirm(`确定终止该任务吗?`, "提示", {
type: "warning", type: "warning",
}).then(() => { }).then(() => {
// this.$API.pm.utask.delete.req(row.id).then((res) => { this.$API.pm.utask.stop.req(row.id).then((res) => {
// this.$message.success(""); this.$message.success("操作成功");
// this.$refs.table7.refresh(); this.$refs.table10.refresh();
// return res; return res;
// }).catch((err) => { }).catch((err) => {
// return err; return err;
// }); });
}).catch(() => {}); }).catch(() => {});
}, },
// //
@ -477,13 +479,19 @@ export default {
utaskDepuse(){ utaskDepuse(){
let that = this; let that = this;
if(that.selectedIds.length>0){ if(that.selectedIds.length>0){
let ids =that.selectedIds;
that.isloading = true; that.isloading = true;
that.$API.pm.utask.scheduemtasks.req({ids:that.selectedIds}).then(res=>{ that.$API.pm.utask.scheduemtasks.req({ids:ids}).then(res=>{
that.$message.success('任务分解成功'); that.$API.pm.utask.assgin.req({ids:ids}).then(res=>{
that.isloading = false; that.$message.success('下达任务成功');
that.$refs.table7.refresh(); that.isloading = false;
that.$refs.table8.refresh(); that.$refs.table7.refresh();
that.$refs.table10.refresh(); that.$refs.table8.refresh();
that.$refs.table10.refresh();
}).catch(()=>{
that.isloading = false;
})
}).catch(()=>{ }).catch(()=>{
that.isloading = false; that.isloading = false;
}) })

View File

@ -69,33 +69,6 @@
<!-- <el-button type="primary" @click="startPlan">排产</el-button> --> <!-- <el-button type="primary" @click="startPlan">排产</el-button> -->
</div> </div>
<el-tabs v-model="activeNameSub" class="demo-tabs" @tab-click="handleClick"> <el-tabs v-model="activeNameSub" class="demo-tabs" @tab-click="handleClick">
<!-- <el-tab-pane label="订单排产" name="order">
<scTable ref="table2" :apiObj="apiOrderItem" row-key="id" stripe :height="tableHeight" :params="paramsOrderItem" @selection-change="selectionOrderItemChange" hidePagination>
<el-table-column type="selection" width="55" />
<el-table-column label="订单编号" prop="number">
<template #default="scope">
<span v-if="scope.row.order">{{ scope.row.order_.number }}</span>
</template>
</el-table-column>
<el-table-column label="产品名称" prop="number">
<template #default="scope">
<span v-if="scope.row.material">{{ scope.row.material_.name }}</span>
</template>
</el-table-column>
<el-table-column label="型号/规格" prop="count">
<template #default="scope">
<span v-if="scope.row.material">{{ scope.row.material_.specification }}</span>
</template>
</el-table-column>
<el-table-column label="需求量" prop="count">
</el-table-column>
<el-table-column label="交货时间" prop="delivery_date">
<template #default="scope">
<span v-if="scope.row.order">{{ scope.row.order_.delivery_date }}</span>
</template>
</el-table-column>
</scTable>
</el-tab-pane> -->
<el-tab-pane label="生产进度" name="rate"> <el-tab-pane label="生产进度" name="rate">
<GanttComponent class="left-container" :tasks="tasks"></GanttComponent> <GanttComponent class="left-container" :tasks="tasks"></GanttComponent>
</el-tab-pane> </el-tab-pane>
@ -353,13 +326,33 @@ export default {
// mtask // mtask
let that = this; let that = this;
that.tasks.data = []; that.tasks.data = [];
let objItem = {};
objItem.id=row.id;
objItem.type='utask';
objItem.number=row.number;
objItem.count=row.count;
objItem.text =row.number,
objItem.cate='',
objItem.duration = 10;
objItem.progress = 1;
objItem.count_ok=row.count_ok;
objItem.count_real=row.count_real;
objItem.count_notok=row.count_notok;
objItem.state =row.state;
objItem.start_date =row.start_date;
objItem.mgroup_name = '';
objItem.material_name = '';
objItem.specification = '';
that.tasks.data.push(objItem)
this.$API.pm.mtask.list.req({utask:row.id}).then(res=>{ this.$API.pm.mtask.list.req({utask:row.id}).then(res=>{
// console.log(res.results)// // console.log(res.results)//
let data = res.results; let data = res.results;
let arr = [];
data.forEach(item=>{ data.forEach(item=>{
let obj = {}; let obj = {};
obj.id=item.id; obj.id=item.id;
obj.type='mtask';
obj.parent=row.id;
obj.number=item.number; obj.number=item.number;
obj.count=item.count; obj.count=item.count;
obj.text = "一天任务", obj.text = "一天任务",
@ -379,25 +372,6 @@ export default {
that.tasks.data.push(obj) that.tasks.data.push(obj)
}) })
console.log(that.tasks.data) console.log(that.tasks.data)
// data.forEach(item=>{
// let obj = {};
// let progress = 0;
// progress = item.count_ok/item.count;
// obj.text = "",
// obj.count_ok=item.count_ok;
// obj.count_real=item.count_real;
// obj.count_notok=item.count_notok;
// obj.start_date=item.start_date;
// obj.end_date=item.end_date;
// obj.state = item.state;
// obj.utask = item.utask;
// obj.mgroup_name = item.mgroup_name;
// obj.material_name = item.material_out_.name;
// obj.specification = item.material_out_.specification;
// arr.push(obj)
// })
// console.log(arr)
// that.tasks.data = res.results;
console.log('tasks:',that.tasks) console.log('tasks:',that.tasks)
// :gantt // :gantt
gantt.parse(that.tasks); gantt.parse(that.tasks);

View File

@ -79,15 +79,13 @@ export default {
loading: false, loading: false,
mode: "add", mode: "add",
titleMap: { titleMap: {
add: "新增仓库", add: "新增采购订单",
edit: "编辑仓库", edit: "编辑采购订单",
show: "查看仓库", show: "查看采购订单",
}, },
form: {}, form: {},
rules: { rules: {
name: [{required: true, message: "请输入仓库名称", trigger: "blur"}], number: [{required: true, message: "请输入采购订单编号", trigger: "blur"}]
number: [{required: true, message: "请输入仓库编号", trigger: "blur"}],
place: [{required: true, message: "请输入仓库地点", trigger: "blur"}]
}, },
visible: false, visible: false,
isSaveing: false, isSaveing: false,

View File

@ -1,5 +1,5 @@
<template> <template>
<el-dialog title="计划明细变更采购订单明细" v-model="visible" :size="1000" destroy-on-close @closed="$emit('closed')"> <el-dialog title="计划明细变更采购订单明细" v-model="visible" width="80%" destroy-on-close @closed="$emit('closed')">
<el-container> <el-container>
<el-aside width="45%"> <el-aside width="45%">
<el-container> <el-container>

View File

@ -55,13 +55,13 @@
loading: false, loading: false,
mode: "add", mode: "add",
titleMap: { titleMap: {
add: "新增仓库", add: "新增采购计划",
edit: "编辑仓库", edit: "编辑采购计划",
show: "查看仓库", show: "查看采购计划",
}, },
form: {}, form: {},
rules: { rules: {
number: [{required: true, message: "请输入编号", trigger: "blur"}], number: [{required: true, message: "请输入采购计划编号", trigger: "blur"}],
}, },
visible: false, visible: false,
isSaveing: false, isSaveing: false,

View File

@ -15,7 +15,7 @@
<div> <div>
<el-button type="primary" icon="el-icon-plus" v-auth="'pu_planitem.create'" @click="add"></el-button> <el-button type="primary" icon="el-icon-plus" v-auth="'pu_planitem.create'" @click="add"></el-button>
</div> </div>
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="query" hidePagination> <scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="query" hidePagination>
<el-table-column type="index" width="50" /> <el-table-column type="index" width="50" />
<el-table-column label="所属物料" prop="material" show-overflow-tooltip> <el-table-column label="所属物料" prop="material" show-overflow-tooltip>
<template #default="scope"> <template #default="scope">
@ -66,7 +66,7 @@ export default {
}, },
puPlan: '', puPlan: '',
orderObj: {}, orderObj: {},
apiObj: this.$API.pum.planitem.list, apiObj: null,
query: { query: {
page: 1, page: 1,
page_size: 20 page_size: 20
@ -75,6 +75,9 @@ export default {
}, },
mounted() { mounted() {
this.puPlan = this.$route.query.pu_plan; this.puPlan = this.$route.query.pu_plan;
this.query.pu_plan = this.$route.query.pu_plan;
this.apiObj= this.$API.pum.planitem.list;
this.$refs.table.refresh();
this.getOrder(); this.getOrder();
}, },
methods: { methods: {

View File

@ -2,7 +2,6 @@
<el-container> <el-container>
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="add"></el-button>
</div> </div>
<div class="right-panel"> <div class="right-panel">
<el-date-picker <el-date-picker

View File

@ -2,7 +2,6 @@
<el-container> <el-container>
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="add"></el-button>
</div> </div>
<div class="right-panel"> <div class="right-panel">
<el-date-picker <el-date-picker

View File

@ -84,9 +84,9 @@ export default {
loading: false, loading: false,
mode: "add", mode: "add",
titleMap: { titleMap: {
add: "新增仓库", add: "新增订单",
edit: "编辑仓库", edit: "编辑订单",
show: "查看仓库", show: "查看订单",
}, },
form: {}, form: {},
rules: { rules: {

View File

@ -3,8 +3,20 @@
<el-main id="topContainer" class="nopadding" style="position: relative;height: 50%;margin-bottom: 10px;"> <el-main id="topContainer" class="nopadding" style="position: relative;height: 50%;margin-bottom: 10px;">
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="activeSpan" style="border-right: 1px solid #eeeeee;position: relative;"> <el-col :span="activeSpan" style="border-right: 1px solid #eeeeee;position: relative;">
<div class="right-panel btnWrap" v-if="activeName == '8车间' || activeName == '退火'"> <div class="right-panel btnWrap">
<el-button type="primary" icon="el-icon-plus" @click="add">新增</el-button> <el-button v-if="activeName == '8车间' || activeName == '退火'" type="primary" icon="el-icon-plus" @click="add">新增</el-button>
<el-button v-if="activeName == '退火'" type="primary" @click="submittuihuo">提交</el-button>
<el-date-picker v-if="activeName == '7车间' || activeName == '10车间'"
v-model="paramsDate"
type="date"
value-format="YYYY-MM-DD"
/>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuerys"
v-if="activeName == '7车间' || activeName == '10车间'"
>查询</el-button>
</div> </div>
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick"> <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
<el-tab-pane label="混料工序" name="8车间"> <el-tab-pane label="混料工序" name="8车间">
@ -85,22 +97,19 @@
<scTable ref="table8" :apiObj="apiObjMlog" row-key="id" stripe :height="tableHeightHalf" :params="paramsth" <scTable ref="table8" :apiObj="apiObjMlog" row-key="id" stripe :height="tableHeightHalf" :params="paramsth"
hidePagination hideDo> hidePagination hideDo>
<el-table-column type="index" width="50" /> <el-table-column type="index" width="50" />
<el-table-column label="配料日期" prop="handle_date"> <el-table-column label="合格数" prop="equipment_name">
</el-table-column> </el-table-column>
<el-table-column label="产物" prop="material" show-overflow-tooltip> <el-table-column label="不合格数" prop="batch">
<template #default="scope"><span v-if="scope.row.material_out_">{{ scope.row.material_out_.name
}}</span>
</template>
</el-table-column> </el-table-column>
<el-table-column label="设备" prop="equipment_name"> <el-table-column label="不合格原因" prop="handle_date">
</el-table-column> </el-table-column>
<el-table-column label="批次" prop="batch"> <el-table-column label="检测数" prop="count_real">
</el-table-column> </el-table-column>
<el-table-column label="数量/桶数" prop="count_real"> <el-table-column label="检测合格数" prop="count_real_eweight">
</el-table-column> </el-table-column>
<el-table-column label="每桶重量/kg" prop="count_real_eweight"> <el-table-column label="检测不合格数" prop="handle_user_name">
</el-table-column> </el-table-column>
<el-table-column label="配料人" prop="handle_user_name"> <el-table-column label="检测不合格原因" prop="handle_user_name">
</el-table-column> </el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="180"> <el-table-column label="操作" fixed="right" align="center" width="180">
<template #default="scope"> <template #default="scope">
@ -108,6 +117,10 @@
编辑 编辑
</el-link> </el-link>
<el-divider direction="vertical"></el-divider> <el-divider direction="vertical"></el-divider>
<el-link type="success" @click="table_tuihuo_submit(scope.row)" v-auth="'equipment'">
提交
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link type="danger" @click="table_del(scope.row, '8车间')" v-auth="'equipment'"> <el-link type="danger" @click="table_del(scope.row, '8车间')" v-auth="'equipment'">
删除 删除
</el-link> </el-link>
@ -155,7 +168,7 @@
<el-button type="primary" @click="getMaterial">领料</el-button> <el-button type="primary" @click="getMaterial">领料</el-button>
</div> </div>
</div> </div>
<scTable ref="table8" :apiObj="apiObjMetarial" row-key="id" stripe :height="tableHeightHalf" <scTable ref="table8wM" :apiObj="apiObjMetarial" row-key="id" stripe :height="tableHeightHalf"
:params="paramsMaterial" hidePagination hideDo @selection-change="handleSelectionChange"> :params="paramsMaterial" hidePagination hideDo @selection-change="handleSelectionChange">
<el-table-column type="index" width="50" /> <el-table-column type="index" width="50" />
<el-table-column type="selection" width="40" /> <el-table-column type="selection" width="40" />
@ -203,7 +216,7 @@
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="7车间" name="7车间"> <el-tab-pane label="7车间" name="7车间">
<scTable ref="table7" :apiObj="apiObjMtask" row-key="id" stripe :height="tableHeight" :params="params7" <scTable ref="table7" :apiObj="apiObjMtask" row-key="id" stripe :height="tableHeight" :params="params7"
hidePagination hideDo @row-click="rowClick"> hideDo @row-click="rowClick">
<el-table-column type="index" width="50" /> <el-table-column type="index" width="50" />
<el-table-column label="产品名称" prop="material" show-overflow-tooltip> <el-table-column label="产品名称" prop="material" show-overflow-tooltip>
<template #default="scope"> <template #default="scope">
@ -248,7 +261,7 @@
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="10车间" name="10车间"> <el-tab-pane label="10车间" name="10车间">
<scTable ref="table10" :apiObj="apiObjMtask" row-key="id" stripe :height="tableHeight" :params="params10" <scTable ref="table10" :apiObj="apiObjMtask" row-key="id" stripe :height="tableHeight" :params="params10"
hidePagination hideDo @row-click="rowClick"> hideDo @row-click="rowClick">
<el-table-column type="index" width="50" /> <el-table-column type="index" width="50" />
<el-table-column label="产品名称" prop="material" show-overflow-tooltip> <el-table-column label="产品名称" prop="material" show-overflow-tooltip>
<template #default="scope"> <template #default="scope">
@ -290,40 +303,41 @@
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</el-col> </el-col>
<el-col :span="12" v-if="activeName !== '8车间' && activeName !== '退火'"> <el-col :span="12" v-if="activeName=='7车间'||activeName == '10车间'">
<div v-if="activeName == '退火'" style="font-size:16px;padding:10px 0;border-bottom:1px solid #eeeeee">退火日志</div> <el-card>
<el-form v-else label-width="100px" style="border-bottom: 1px solid #eeeeee;padding: 4px 0;"> <el-form label-width="100px">
<el-row> <el-row>
<el-col :md="8" :sm="12" :xs="24"> <el-col :md="8" :sm="12" :xs="24">
<el-form-item class="infoForm" label="产品名称:"> <el-form-item class="infoForm" label="产品名称:">
<span v-if="choseData && choseData.material_out_">{{ choseData.material_out_.name }}</span> <span v-if="choseData && choseData.material_out_">{{ choseData.material_out_.name }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="8" :sm="12" :xs="24"> <el-col :md="8" :sm="12" :xs="24">
<el-form-item class="infoForm" label="产品型号:"> <el-form-item class="infoForm" label="产品型号:">
<span v-if="choseData && choseData.material_out_">{{ choseData.material_out_.number }}</span> <span v-if="choseData && choseData.material_out_">{{ choseData.material_out_.number }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="8" :sm="12" :xs="24"> <el-col :md="8" :sm="12" :xs="24">
<el-form-item class="infoForm" label="配粉料数:"> <el-form-item class="infoForm" label="配粉料数:">
<span>{{ peifen_kg }}</span> <span>{{ peifen_kg }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col :md="8" :sm="12" :xs="24"> <!-- <el-col :md="8" :sm="12" :xs="24">
<el-form-item label="配粉料数:"> <el-form-item label="配粉料数:">
<el-input-number <el-input-number
v-model="materialCount" v-model="materialCount"
controls-position="right" controls-position="right"
:min="0" step="1" :min="0" step="1"
:step-strictly="true" :step-strictly="true"
style="width:100%" style="width:100%"
placeholder="配粉料数" placeholder="配粉料数"
> >
</el-input-number> </el-input-number>
</el-form-item> </el-form-item>
</el-col> --> </el-col> -->
</el-row> </el-row>
</el-form> </el-form>
</el-card>
<div style="margin-top: 10px;"> <div style="margin-top: 10px;">
<el-button type="primary" icon="el-icon-plus" @click="add" <el-button type="primary" icon="el-icon-plus" @click="add"
:disabled="choseData && choseData.state == 40">新增</el-button> :disabled="choseData && choseData.state == 40">新增</el-button>
@ -442,6 +456,36 @@
</template> </template>
</el-table-column> </el-table-column>
</scTable> </scTable>
<div class="tableTitle">
车间物料
<div class="right-panel btnWrap">
<el-button type="primary" @click="getMaterial">领料</el-button>
</div>
</div>
<scTable ref="table8wM" :apiObj="apiObjMetarial" row-key="id" stripe :height="300"
:params="paramsMaterial" hidePagination hideDo>
<el-table-column type="index" width="50" />
<el-table-column type="selection" width="40" />
<el-table-column label="送料日期" prop="send_date">
</el-table-column>
<el-table-column label="产物" prop="material" show-overflow-tooltip>
<template #default="scope">
<span v-if="scope.row.material_out_">{{ scope.row.material_out_.name}}</span>
</template>
</el-table-column>
<el-table-column label="设备" prop="equipment_name">
</el-table-column>
<el-table-column label="批次" prop="batch">
</el-table-column>
<el-table-column label="数量/桶数" prop="count_real">
</el-table-column>
<el-table-column label="每桶重量/kg" prop="count_real_eweight">
</el-table-column>
<el-table-column label="交送人" prop="send_user_name">
</el-table-column>
<el-table-column label="接收人" prop="send_user_name">
</el-table-column>
</scTable>
</el-col> </el-col>
</el-row> </el-row>
</el-main> </el-main>
@ -525,14 +569,13 @@ export default {
handover: false handover: false
}, },
handoverVisible: false, handoverVisible: false,
paramsDate:'',
// apiObj: this.$API.pm.mtask.list, // apiObj: this.$API.pm.mtask.list,
params7: { params7: {
belong_dept_name: '7车间', mgroup__belong_dept__name: '7车间'
date: '2023-10-24'
}, },
params10: { params10: {
belong_dept_name: '10车间', mgroup__belong_dept__name: '10车间'
date: '2023-10-20'
}, },
params8: { params8: {
mgroup__belong_dept__name: '8车间', mgroup__belong_dept__name: '8车间',
@ -546,7 +589,7 @@ export default {
apiObjMlog: null, apiObjMlog: null,
apiObjHandover: null, apiObjHandover: null,
apiObjWMaterial: this.$API.wpm.wmaterial.list, apiObjWMaterial: this.$API.wpm.wmaterial.list,
apiObjMtask: null, apiObjMtask: this.$API.pm.mtask.list,
apiObj: null, apiObj: null,
apiObjMetarial: this.$API.wpm.wmaterial.list, apiObjMetarial: this.$API.wpm.wmaterial.list,
@ -605,10 +648,9 @@ export default {
let rightHeight = heights - 100; let rightHeight = heights - 100;
this.rightHeight = rightHeight / 2 + 'px'; this.rightHeight = rightHeight / 2 + 'px';
let NowDate = new Date(); let NowDate = new Date();
let month = NowDate.getMonth() > 8 ? NowDate.getMonth() + 1 : '0' + (NowDate.getMonth() + 1) let paramsDate = NowDate.getFullYear() + '-' + (NowDate.getMonth() + 1) + '-' + NowDate.getDate();
this.params7.date = NowDate.getFullYear() + '-' + (NowDate.getMonth() + 1) + '-' + NowDate.getDate(); // NowDate.getMonth() > 8 ? NowDate.getMonth() + 1 : '0' + (NowDate.getMonth() + 1)
this.params10.date = NowDate.getFullYear() + '-' + (NowDate.getMonth() + 1) + '-' + NowDate.getDate(); this.apiObjMtask = this.$API.pm.mtask.list;
this.apiObjMtask = this.$API.pm.mtask.daylist;
this.apiObjMlog = this.$API.wpm.mlog.list; this.apiObjMlog = this.$API.wpm.mlog.list;
this.apiObjHandover = this.$API.wpm.handover.list; this.apiObjHandover = this.$API.wpm.handover.list;
this.getGroup(); this.getGroup();
@ -635,14 +677,39 @@ export default {
}, },
handleClick(val) { handleClick(val) {
console.log(val.index); console.log(val.index);
if (val.index == 0 || val.index == 1) { if (val.index == 0) {
this.activeSpan = 24 this.activeSpan = 24
} else { }else if(val.index == 1) {
this.activeSpan = 12 this.activeSpan = 24;
this.paramsMaterial.belong_dept__name = '8车间';
this.$refs.table8wM.refresh();
}else if(val.index == 2){
this.activeSpan = 12;
this.paramsMaterial.belong_dept__name = '7车间';
this.$refs.table8wM.refresh();
} }
else if(val.index == 3){
this.activeSpan = 12;
this.paramsMaterial.belong_dept__name = '10车间';
this.$refs.table8wM.refresh();
}
this.choseData = null; this.choseData = null;
this.flogs = []; this.flogs = [];
}, },
handleQuerys(){
if(this.activeName=='7车间'){
this.params7.start_date = this.paramsDate;
this.params7.end_date = this.paramsDate;
console.log('paramsDate',this.paramsDate)
console.log('7车间',this.params7)
this.$refs.table7.queryData(this.params7);
}else{
this.params10.start_date = this.paramsDate;
this.params10.end_date = this.paramsDate;
this.$refs.table10.queryData(this.params10);
}
},
table_submit(row) { table_submit(row) {
let obj = {}; let obj = {};
obj.ids = []; obj.ids = [];
@ -651,6 +718,12 @@ export default {
debugger; debugger;
}) })
}, },
//退
table_tuihuo_submit(row){
this.$API.wpm.mlog.submit.req(row.id,row).then(res => {
console.log(res)
})
},
// //
addTask(taskId) { addTask(taskId) {
var $this = this; var $this = this;
@ -680,6 +753,9 @@ export default {
} }
} }
}, },
//退
submittuihuo(){},
// //
table_edit(row) { table_edit(row) {
this.dialog.save = true; this.dialog.save = true;
@ -728,11 +804,11 @@ export default {
handleSuccess() { handleSuccess() {
}, },
handleQuery() { // handleQuery() {
// this.$refs.table.queryData(this.query) // // this.$refs.table.queryData(this.query)
debugger; // debugger;
generateExcel(this.columns, this.flogsData, '测试') // generateExcel(this.columns, this.flogsData, '')
}, // },
resetQuery() { resetQuery() {
this.query = {}; this.query = {};
}, },

View File

@ -111,110 +111,185 @@
</el-row> </el-row>
</el-form> </el-form>
<!-- 退火 --> <!-- 退火 -->
<el-form v-if="activeType=='退火'" ref="dialogForm" :model="form" :rules="rules" label-width="80px"> <el-form v-if="activeType=='退火'" ref="dialogForm" :model="form" :rules="rules" label-width="120px">
<el-row> <el-row>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="工段" prop="material"> <el-form-item label="合格数">
<el-select <el-input-number
v-model="form.mgroup" v-model="form.count_ok"
placeholder="工段" controls-position="right"
clearable :min="0" step="1"
style="width:100%" :step-strictly="true"
> style="width:100%"
<el-option placeholder="请输入合格数">
v-for="item in mgroupOptions" </el-input-number>
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="消耗物" prop="material_in"> <el-form-item label="不合格数">
<el-input-number
v-model="form.count_notok"
controls-position="right"
style="width:100%"
placeholder="不合格数"
disabled
>
</el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="物料批次" prop="material_in">
<el-select <el-select
v-model="form.material_in" v-model="form.catch"
placeholder="消耗物" placeholder="料批次"
clearable clearable
style="width:100%" style="width:100%"
@change="wmaterialInChange" @change="wmaterialInChange"
> >
<el-option <el-option
v-for="item in wMaterialOptions" v-for="item in wMaterialOptions"
:key="item.id" :key="item.batch"
:label="item.name" :label="item.batch"
:value="item.id" :value="item.batch"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row>
<div class="formTitle">不合格原因及数量:</div>
<el-row>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="产物" prop="material_out"> <el-form-item label="椭圆/弯曲">
<el-select <el-input-number
v-model="form.material_out" v-model="form.count_n_wq"
placeholder="产物" controls-position="right"
clearable :min="0" step="1"
style="width:100%" :step-strictly="true"
style="width:100%"
placeholder="椭圆/弯曲"
@change="countNotOkSun"
> >
<el-option </el-input-number>
v-for="item in materialOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="设备" prop="material"> <el-form-item label="条纹">
<el-select <el-input-number
v-model="form.equipment" v-model="form.count_n_tw"
placeholder="设备" controls-position="right"
clearable :min="0" step="1"
style="width:100%" :step-strictly="true"
style="width:100%"
placeholder="条纹"
@change="countNotOkSun"
> >
<el-option </el-input-number>
v-for="item in equipmentOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-col> -->
<el-col :md="12" :sm="24">
<el-form-item label="批次" width="100">
<el-input v-model="form.batch" disabled tyle="width:100%" placeholder="请输入批次"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="数量" width="100"> <el-form-item label="断裂">
<el-input-number
v-model="form.count_n_dl"
controls-position="right"
:min="0" step="1"
:step-strictly="true"
style="width:100%"
placeholder="断裂"
@change="countNotOkSun"
>
</el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="偏壁">
<el-input-number
v-model="form.count_n_pb"
controls-position="right"
:min="0" step="1"
:step-strictly="true"
style="width:100%"
placeholder="偏壁"
@change="countNotOkSun"
>
</el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="大小头">
<el-input-number
v-model="form.count_n_dxt"
controls-position="right"
:min="0" step="1"
:step-strictly="true"
style="width:100%"
placeholder="大小头"
@change="countNotOkSun"
>
</el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="结石气绒">
<el-input-number
v-model="form.count_n_jsqx"
controls-position="right"
:min="0" step="1"
:step-strictly="true"
style="width:100%"
placeholder="结石气绒"
@change="countNotOkSun"
>
</el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="箱中破">
<el-input-number
v-model="form.count_break"
controls-position="right"
style="width:100%"
placeholder="箱中破"
@change="countNotOkSun"
>
</el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :md="12" :sm="24">
<el-form-item label="检测数">
<el-input-number <el-input-number
v-model="form.count" v-model="form.count"
controls-position="right" controls-position="right"
:min="0" step="1" :min="0" step="1"
:step-strictly="true" :step-strictly="true"
style="width:100%" style="width:100%"
placeholder="请输入数量"> placeholder="请输入检测数">
</el-input-number> </el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="操作人" prop="material"> <el-form-item label="检测合格数">
<el-select <el-input-number
v-model="form.handle_users" v-model="form.count"
placeholder="操作人" controls-position="right"
clearable :min="0" step="1"
multiple :step-strictly="true"
style="width:100%" style="width:100%"
> placeholder="请输入检测合格数">
<el-option </el-input-number>
v-for="item in userList" </el-form-item>
:key="item.id" </el-col>
:label="item.name" <el-col :md="12" :sm="24">
:value="item.id" <el-form-item label="检测不合格数">
/> <el-input-number
</el-select> v-model="form.count"
controls-position="right"
:min="0" step="1"
:step-strictly="true"
style="width:100%"
placeholder="请输入检测不合格数">
</el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
@ -621,7 +696,7 @@
</el-col> </el-col>
</el-row> </el-row>
<div class="formTitle">关联产品计数:</div> <div class="formTitle">关联产品计数:</div>
<el-row v-for="item in form.mlogb" :key="item"> <el-row v-for="item in mlogb" :key="item">
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="产品名称" prop="material"> <el-form-item label="产品名称" prop="material">
<el-select <el-select
@ -798,6 +873,7 @@
count_n_qt:0, count_n_qt:0,
mlogb:[] mlogb:[]
}, },
mlogb:[],
userList:[], userList:[],
cateOptions:[], cateOptions:[],
mgroupOptions:[], mgroupOptions:[],
@ -835,10 +911,10 @@
this.brothersList.forEach(item=>{ this.brothersList.forEach(item=>{
let obj = {}; let obj = {};
obj.material_out = item; obj.material_out = item;
obj.count_ok = 0; obj.count_ok = null;
mlogb.push(obj) mlogb.push(obj)
}) })
this.form.mlogb = mlogb; this.mlogb = mlogb;
} }
} }
this.getWorkShopMaterial(); this.getWorkShopMaterial();
@ -910,11 +986,13 @@
this.form.count_notok = this.form.count_n_zw+this.form.count_n_tw+this.form.count_n_qp+this.form.count_n_wq+this.form.count_n_qt; this.form.count_notok = this.form.count_n_zw+this.form.count_n_tw+this.form.count_n_qp+this.form.count_n_wq+this.form.count_n_qt;
}else if(this.activeType=='10车间'){ }else if(this.activeType=='10车间'){
this.form.count_notok = this.form.count_n_wq+this.form.count_n_tw+this.form.count_n_dl+this.form.count_n_pb+this.form.count_n_dxt+this.form.count_n_jsqx; this.form.count_notok = this.form.count_n_wq+this.form.count_n_tw+this.form.count_n_dl+this.form.count_n_pb+this.form.count_n_dxt+this.form.count_n_jsqx;
} }else if(this.activeType=='退火'){
this.form.count_notok = this.form.count_n_wq+this.form.count_n_tw+this.form.count_n_dl+this.form.count_n_pb+this.form.count_n_dxt+this.form.count_n_jsqx+this.form.count_break;
}
}, },
countOkSun(){ countOkSun(){
let ok_number = 0; let ok_number = 0;
this.form.mlogb.forEach(item=>{ this.mlogb.forEach(item=>{
ok_number+=item.count_ok; ok_number+=item.count_ok;
}) })
this.form.count_ok = ok_number; this.form.count_ok = ok_number;
@ -934,14 +1012,32 @@
this.form.mtask = this.mtask; this.form.mtask = this.mtask;
this.form.count_notok = this.form.count_n_wq+this.form.count_n_tw+this.form.count_n_dl+this.form.count_n_pb+this.form.count_n_dxt+this.form.count_n_jsqx; this.form.count_notok = this.form.count_n_wq+this.form.count_n_tw+this.form.count_n_dl+this.form.count_n_pb+this.form.count_n_dxt+this.form.count_n_jsqx;
let ok_number = 0; let ok_number = 0;
this.form.mlogb.forEach(item=>{ this.mlogb.forEach(item=>{
ok_number+=item.count_ok; ok_number+=item.count_ok;
}) })
this.form.count_ok = ok_number; this.form.count_ok = ok_number;
}else if(this.activeType=='退火'){
this.form.mgroup = '3428194648706011136';
this.form.count_notok = this.form.count_n_wq+this.form.count_n_tw+this.form.count_n_dl+this.form.count_n_pb+this.form.count_n_dxt+this.form.count_n_jsqx+this.form.count_break;
} }
let sun = this.form.count_ok+this.form.count_notok; if(this.activeType=='10车间'){
if(sun==this.form.count_real){ let mlogb = this.mlogb;
if (this.mode == "add") { let newArr = [];
mlogb.forEach(item=>{
if(item.count_ok!==null&&item.count_ok!==''){
newArr.push(item)
}
})
this.form.mlogb = newArr;
}
// let sun = this.form.count_ok+this.form.count_notok;
// if(sun==this.form.count_real){
// }else{
// this.isSaveing = false;
// this.$message.error("");
// }
if (this.mode == "add") {
this.$API.wpm.mlog.create.req(this.form).then(res=>{ this.$API.wpm.mlog.create.req(this.form).then(res=>{
this.isSaveing = false; this.isSaveing = false;
this.$emit("success", this.form, this.mode); this.$emit("success", this.form, this.mode);
@ -964,10 +1060,6 @@
return err; return err;
}) })
} }
}else{
this.isSaveing = false;
this.$message.error("合格总数与不合格总数与出管总数不对等");
}
} }
}); });
}, },