Merge branch 'develop' of https://e.coding.net/ctcdevteam/hberp/hberp into develop

This commit is contained in:
caoqianming 2022-02-25 16:36:31 +08:00
commit bd904eaa73
4 changed files with 681 additions and 638 deletions

View File

@ -143,7 +143,14 @@ export function deleteOperationwproduct(id) {
})
}
//半成品摆放位置
export function wproductPlace(id, data) {
return request({
url: `/wpm/operation_wproduct/${id}/`,
method: 'put',
data
})
}
//删除操作记录
export function deleteOperation(id) {
return request({

View File

@ -20,22 +20,22 @@
<el-table-column label="子计划编号" width="100px">
<template slot-scope="scope">{{scope.row.number}}</template>
</el-table-column>
<el-table-column label="产品名称" width="180px">
<template slot-scope="scope">{{ scope.row.product_.name }}</template>
<el-table-column label="产品名称" width="180px" >
<template slot-scope="scope" v-if="scope.row.product_">{{ scope.row.product_.name }}</template>
</el-table-column>
<el-table-column label="产品型号">
<template slot-scope="scope">{{ scope.row.product_.specification }}</template>
<el-table-column label="产品型号" >
<template slot-scope="scope" v-if="scope.row.product_">{{ scope.row.product_.specification }}</template>
</el-table-column>
<el-table-column label="名称" width="160px">
<template slot-scope="scope">{{ scope.row.subproduction_.name }}</template>
<template slot-scope="scope" v-if="scope.row.subproduction_">{{ scope.row.subproduction_.name }}</template>
</el-table-column>
<el-table-column label="工序名">
<template slot-scope="scope">{{ scope.row.process_.name }}</template>
<el-table-column label="工序名" >
<template slot-scope="scope" v-if="scope.row.process_" >{{ scope.row.process_.name }}</template>
</el-table-column>
<el-table-column label="工序编号">
<template slot-scope="scope">{{ scope.row.process_.number }}</template>
<template slot-scope="scope" v-if="scope.row.process_">{{ scope.row.process_.number }}</template>
</el-table-column>
<el-table-column label="子工序" width="200">
<template slot-scope="scope" v-if="scope.row.steps">
@ -48,7 +48,7 @@
</template>
</el-table-column>
<el-table-column label="生产车间" width="100px">
<template slot-scope="scope">{{ scope.row.workshop_.name }}</template>
<template slot-scope="scope" v-if="scope.row.workshop_">{{ scope.row.workshop_.name }}</template>
</el-table-column>
<el-table-column label="生产数量">
<template slot-scope="scope">{{ scope.row.count }}</template>

View File

@ -162,12 +162,13 @@
</el-select>
</el-form-item>
<el-form-item label="所属合同" prop="contract">
<el-select style="width: 100%" v-model="order.contract" placeholder="请选择">
<el-select style="width: 100%" v-model="order.contract" @change="selectcontract" placeholder="请选择">
<el-option
v-for="item in contractoptions"
:key="item.value"
:label="item.label"
:value="item.value">
:key="item.id"
:label="item.name+'____'+item.number"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
@ -184,7 +185,7 @@
</div>
</template>
<script>
import { getOrderList, createOrder,updateOrder,deleteOrder,getContractList,getCustomerList } from "@/api/sam";
import { getOrderList, createOrder,updateOrder,deleteOrder,getContractList,getCustomerList,getContract } from "@/api/sam";
import { getMaterialList } from "@/api/mtm";
import checkPermission from "@/utils/permission";
@ -193,6 +194,7 @@ import { genTree } from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
const defaulteorder = {
need_mtest:false,
customer:""
};
export default {
components: { Pagination },
@ -253,7 +255,7 @@ export default {
getContractList({pageoff:true}).then((response) => {
this.contractoptions = genTree(response.data);
this.contractoptions = response.data;
});
},
@ -265,7 +267,16 @@ export default {
});
},
selectcontract(selval)
{
getContract(selval).then((response) => {
if (response.data) {
console.log(response.data);
this.order.customer = response.data.customer_.name;
}
});
},
handleFilter() {
this.listQuery.page = 1;
this.getList();

View File

@ -4,9 +4,12 @@
<div slot="header" class="clearfix">
<span>基本信息</span>
<el-button style="float: right; padding: 3px 0" @click="getWordText()" type="text">查看作业指导书</el-button>
<el-button
style="float: right; padding: 3px 0"
@click="getWordText()"
type="text"
>查看作业指导书</el-button
>
</div>
<el-form
ref="form"
@ -33,12 +36,16 @@
disabled="disabled"
></el-input>
</el-form-item>
<el-form-item >
<el-button type="primary" style="float: right" @click="handlesubmit()" v-if="operationData.is_submited==false"
<el-form-item>
<el-button
type="primary"
style="float: right"
@click="handlesubmit()"
v-if="operationData.is_submited == false"
>提交本次操作</el-button
>
</el-form-item>
<!--
<!--
<el-form-item label="边角料">
<el-radio-group v-model="operationData.use_scrap">
<el-radio border
@ -62,8 +69,9 @@
title="作业指导书查看!"
:visible.sync="drawer"
direction="rtl"
size="70%">
<el-tabs @tab-click="handleClick" >
size="70%"
>
<el-tabs @tab-click="handleClick">
<el-tab-pane
:key="item.file_.id"
v-for="item in techdocList"
@ -72,9 +80,8 @@
:closable="item.close"
></el-tab-pane>
</el-tabs>
<div class="word-wrap" id = "file"> </div>
</el-drawer>
<div class="word-wrap" id="file"></div>
</el-drawer>
</el-card>
<el-row gutter="2">
<el-col span="8">
@ -93,7 +100,7 @@
height="230"
style="width: 100%"
>
<el-table-column type="index" width="50" />
<el-table-column
prop="subproduction_plan_.number"
label="子计划编号"
@ -103,9 +110,13 @@
</el-table-column>
<el-table-column prop="material_.name" label="玻璃状态">
</el-table-column>
<el-table-column prop="place" label="摆放位置">
</el-table-column>
<el-table-column align="center" label="操作" width="100px">
<template slot-scope="scope">
<el-link type="primary" @click="handleupdatewproduct(scope)"
>编辑</el-link
>
<el-link
v-if="checkPermission(['warehouse_update'])"
type="danger"
@ -115,6 +126,31 @@
</template>
</el-table-column>
</el-table>
<el-dialog
:visible.sync="dialogwproductplace"
:close-on-click-modal="false"
width="60%"
title="半成品摆放位置"
>
<el-form
ref="Form"
:model="wproductplace"
label-width="100px"
label-position="right"
>
<el-form-item label="位置" prop="place">
<el-input v-model="wproductplace.place" placeholder="位置" />
</el-form-item>
</el-form>
<div style="text-align: right">
<el-button type="danger" @click="dialogwproductplace = false"
>取消</el-button
>
<el-button type="primary" @click="submitwproductplace"
>确认</el-button
>
</div>
</el-dialog>
</template>
</el-card>
</el-col>
@ -139,22 +175,23 @@
</el-table-column>
<el-table-column label="设备状态">
<template slot-scope="scope">
<div v-if="scope.row.equip_.type===2">
<el-tag v-if="scope.row.equip_.state===40" type="danger">
<div v-if="scope.row.equip_.type === 2">
<el-tag v-if="scope.row.equip_.state === 40" type="danger">
禁用
</el-tag>
<el-tag v-else type="success">
合格
</el-tag>
<el-tag v-else type="success"> 合格 </el-tag>
</div>
<div v-else>
<el-tag v-if="scope.row.equip_.state===10" type="success">
<el-tag v-if="scope.row.equip_.state === 10" type="success">
{{ state_[scope.row.equip_.state] }}
</el-tag>
<el-tag v-else-if="scope.row.equip_.state===20">
<el-tag v-else-if="scope.row.equip_.state === 20">
{{ state_[scope.row.equip_.state] }}
</el-tag>
<el-tag v-else-if="scope.row.equip_.state===30" type="warning">
<el-tag
v-else-if="scope.row.equip_.state === 30"
type="warning"
>
{{ state_[scope.row.equip_.state] }}
</el-tag>
<el-tag v-else type="danger">
@ -205,7 +242,6 @@
<template slot-scope="scope">
<el-link
v-if="checkPermission(['warehouse_update'])"
type="primary"
@click="handlerecord(scope)"
>填写表单</el-link
@ -220,12 +256,15 @@
:title="fieldList.name"
>
<el-form label-width="80px" label-position="right">
<el-row v-for="(item, $index) in fieldList.record_data" :key="$index">
<el-row
v-for="(item, $index) in fieldList.record_data"
:key="$index"
>
<el-form-item
v-if="item.field_type === 'string'"
:label="item.field_name"
>
<el-input v-model="item.field_value" placeholder="请输入"/>
<el-input v-model="item.field_value" placeholder="请输入" />
</el-form-item>
<el-form-item
v-else-if="item.field_type === 'int'"
@ -352,14 +391,12 @@
label="子计划编号"
>
</el-table-column>
<el-table-column prop="batch" label="物料批次">
</el-table-column>
<el-table-column prop="batch" label="物料批次"> </el-table-column>
<el-table-column prop="material_.name" label="物料名称">
</el-table-column>
<el-table-column prop="material_.unit" label="物料单位">
</el-table-column>
<el-table-column prop="count" label="消耗数量">
</el-table-column>
<el-table-column prop="count" label="消耗数量"> </el-table-column>
<el-table-column align="center" label="操作" width="100px">
<template slot-scope="scope">
<el-link
@ -371,7 +408,11 @@
</template>
</el-table-column>
</el-table>
<el-dialog title="车间物料" :close-on-click-modal="false" :visible.sync="dialogTablepick">
<el-dialog
title="车间物料"
:close-on-click-modal="false"
:visible.sync="dialogTablepick"
>
<el-table
:data="wmaterialData"
border
@ -381,15 +422,9 @@
max-height="400"
ref="multipleTable"
>
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column type="selection" width="55"> </el-table-column>
<el-table-column type="index" width="50" />
<el-table-column
label="子计划编号"
>
<el-table-column label="子计划编号">
<template slot-scope="scope">{{
scope.row.subproduction_plan_.number
}}</template>
@ -405,14 +440,10 @@
}}</template>
</el-table-column>
<el-table-column label="物料批次">
<template slot-scope="scope">{{
scope.row.batch
}}</template>
<template slot-scope="scope">{{ scope.row.batch }}</template>
</el-table-column>
<el-table-column label="车间物料数量">
<template slot-scope="scope">{{
scope.row.count
}}</template>
<template slot-scope="scope">{{ scope.row.count }}</template>
</el-table-column>
<el-table-column label="实际使用数量" width="140px">
<template slot-scope="scope">
@ -439,10 +470,13 @@
</el-table-column>!-->
</el-table>
<div style="text-align: right">
<el-button type="danger" @click="dialogTablepick = false">取消</el-button>
<el-button type="primary" @click="handlepicks()">提交</el-button>
<el-button type="danger" @click="dialogTablepick = false"
>取消</el-button
>
<el-button type="primary" @click="handlepicks()"
>提交</el-button
>
</div>
</el-dialog>
</template>
</el-card>
@ -479,7 +513,11 @@
</el-table-column>
<el-table-column prop="count" label="产出数量"> </el-table-column>
</el-table>
<el-dialog title="产出物料" :close-on-click-modal="false" :visible.sync="dialogTableoutput">
<el-dialog
title="产出物料"
:close-on-click-modal="false"
:visible.sync="dialogTableoutput"
>
<el-table
:data="tprogressData"
border
@ -489,10 +527,7 @@
max-height="400"
ref="multipleTables"
>
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column type="selection" width="55"> </el-table-column>
<el-table-column type="index" width="50" />
<el-table-column label="子计划编号">
@ -511,7 +546,11 @@
}}</template>
</el-table-column>
<el-table-column label="计划/产出/合格">
<template slot-scope="scope">{{ scope.row.count }}/{{ scope.row.count_real }}/{{ scope.row.count_ok }}</template>
<template slot-scope="scope"
>{{ scope.row.count }}/{{ scope.row.count_real }}/{{
scope.row.count_ok
}}</template
>
</el-table-column>
<el-table-column label="本操作产出数量" width="140px">
@ -532,9 +571,7 @@
<template slot-scope="scope">
<el-form :model="scope.row" widht="100px">
<el-form-item size="mini">
<el-switch
v-model="scope.row.use_scrap"
></el-switch>
<el-switch v-model="scope.row.use_scrap"></el-switch>
</el-form-item>
</el-form>
</template>
@ -550,8 +587,12 @@
</el-table-column>!-->
</el-table>
<div style="text-align: right">
<el-button type="danger" @click="dialogTableoutput = false">取消</el-button>
<el-button type="primary" @click="handleoutputs()">提交</el-button>
<el-button type="danger" @click="dialogTableoutput = false"
>取消</el-button
>
<el-button type="primary" @click="handleoutputs()"
>提交</el-button
>
</div>
</el-dialog>
</el-card>
@ -571,31 +612,22 @@
height="230"
style="width: 100%"
>
<el-table-column prop="material_.name" label="物料名称">
</el-table-column>
<el-table-column prop="material_.unit" label="物料单位">
</el-table-column>
</el-table>
</el-card>
</el-col>
</el-row>
</div>
</template>
<style scoped>
.word-wrap {
.word-wrap {
padding: 25px;
};
}
.box-card {
height: 300px;
}
</style>
<script>
@ -619,10 +651,11 @@ import {
createInputs,
recordInit,
createOutputs,
deleteOperationeinput
deleteOperationeinput,
wproductPlace,
} from "@/api/wpm";
import mammoth from "mammoth";
import { getrffieldList,gettechdocList } from "@/api/mtm";
import { getrffieldList, gettechdocList } from "@/api/mtm";
import checkPermission from "@/utils/permission";
import { getprogressList } from "@/api/pm";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
@ -632,20 +665,20 @@ export default {
inject: ["reload"],
data() {
return {
techdocList:"",
techdocList: "",
operationList: {
count: 0,
},
drawer:false,
drawer: false,
listQuery: {
page: 1,
page_size: 20,
},
state_: {
10: '完好',
20: '限用',
30: '在修',
40: '禁用',
10: "完好",
20: "限用",
30: "在修",
40: "禁用",
},
scrap: [
{ lable: "使用", value: true },
@ -655,12 +688,14 @@ export default {
page: 1,
page_size: 20,
},
wproductplace: {},
operationData: "",
scrapData: {},
dialogVisibleForm: false,
tableForm: {
name: "",
},
dialogwproductplace: false,
listQueryrecordform: {
page: 1,
page_size: 20,
@ -670,7 +705,7 @@ export default {
},
fieldList: {
count: 0,
name:'',
name: "",
},
listQueryfield: {
page: 1,
@ -749,9 +784,9 @@ export default {
wmaterialData: [],
outputData: [],
tprogressData: [],
tool:"",
tool: "",
wordText: "",
pdf:"",
pdf: "",
};
},
computed: {},
@ -767,64 +802,59 @@ export default {
this.getoutputLists(); //产出物料
this.getwmaterialList();
this.getprogressList(); //产出物料调出
this.gettoolList();//工序工装
this.gettoolList(); //工序工装
},
methods: {
checkPermission,
//作业指导书
//选项卡切换
//选项卡切换
handleClick(tab) {
console.log(tab.name);
var str = tab.label.substr(tab.label.length-1,1);
if(str=='x')
{
var str = tab.label.substr(tab.label.length - 1, 1);
if (str == "x") {
const xhr = new XMLHttpRequest();
xhr.open("get",tab.name, true);
xhr.open("get", tab.name, true);
xhr.responseType = "arraybuffer";
xhr.onload = () => {
if (xhr.status == 200) {
mammoth.convertToHtml({ arrayBuffer: new Uint8Array(xhr.response) }).then((resultObject) => {
mammoth
.convertToHtml({ arrayBuffer: new Uint8Array(xhr.response) })
.then((resultObject) => {
this.$nextTick(() => {
this.wordText = resultObject.value;
});
});
}
};
xhr.send();
var filediv = document.getElementById('file');
filediv.innerHTML=' <div id="wordView" v-html='+this.wordText+' />';
}
else if (str=='f')
{
this.pdf=tab.name;
var filediv = document.getElementById('file');
filediv.innerHTML=' <iframe width=1000 height=900 frameborder=0 scrolling=auto src='+tab.name+'></iframe>';
var filediv = document.getElementById("file");
filediv.innerHTML =
' <div id="wordView" v-html=' + this.wordText + " />";
} else if (str == "f") {
this.pdf = tab.name;
var filediv = document.getElementById("file");
filediv.innerHTML =
" <iframe width=1000 height=900 frameborder=0 scrolling=auto src=" +
tab.name +
"></iframe>";
}
},
getWordText() {
this.drawer=true;
this.drawer = true;
},
readbook(){
gettechdocList({operation:this.id,page:0,enabled:true}).then((response) => {
readbook() {
gettechdocList({ operation: this.id, page: 0, enabled: true }).then(
(response) => {
if (response.data) {
this.techdocList= response.data;
console.log( this.techdocList);
this.techdocList = response.data;
console.log(this.techdocList);
}
});
}
);
},
//是否使用边角料
@ -856,6 +886,21 @@ filediv.innerHTML=' <iframe width=1000 height=900 frameborder=0 scrolling=auto s
}
);
},
//半成品摆放的位置
handleupdatewproduct(scope) {
this.dialogwproductplace = true;
this.wproductplaceID=scope.row.id;
},
submitwproductplace() {
wproductPlace(this.wproductplaceID, this.wproductplace).then((res) => {
if (res.code >= 200) {
this.getpwpList();
this.dialogwproductplace = false;
this.$message.success("成功");
}
});
},
//操作半成品删除
handleDeletewproduct(scope) {
this.$confirm("确认删除该半成品?", "警告", {
@ -900,17 +945,19 @@ filediv.innerHTML=' <iframe width=1000 height=900 frameborder=0 scrolling=auto s
},
//操作自定义表
getrecordLists() {
getrecordList({ operation: this.id, page: 0,enabled:true }).then((response) => {
getrecordList({ operation: this.id, page: 0, enabled: true }).then(
(response) => {
if (response.data) {
this.recordData = response.data;
}
});
}
);
},
//调出表单内容
handlerecord(scope) {
this.tableForm = Object.assign({}, scope.row); // copy obj
this.formID = scope.row.id;
recordInit( this.formID).then((response) => {
recordInit(this.formID).then((response) => {
if (response.data) {
debugger;
this.fieldList = response.data;
@ -922,13 +969,11 @@ filediv.innerHTML=' <iframe width=1000 height=900 frameborder=0 scrolling=auto s
//工序工装列表
gettoolList() {
gettoolList({ operation: this.id, page: 0 }).then(
(response) => {
gettoolList({ operation: this.id, page: 0 }).then((response) => {
if (response.data) {
this.tool = response.data;
}
}
);
});
},
//提交表单内容
@ -936,14 +981,14 @@ filediv.innerHTML=' <iframe width=1000 height=900 frameborder=0 scrolling=auto s
let _this = this;
_this.record_data = []; //检查项目
this.fieldList.record_data.forEach((item) => {
if(item.field_type==='int'){
item.field_value = parseInt(item.field_value)
}else if(item.field_type==='float'){
item.field_value = parseFloat(item.field_value)
if (item.field_type === "int") {
item.field_value = parseInt(item.field_value);
} else if (item.field_type === "float") {
item.field_value = parseFloat(item.field_value);
}
_this.record_data.push({
id: item.id,
field_value:item.field_value,
field_value: item.field_value,
});
});
this.record.record_data = _this.record_data;
@ -961,7 +1006,6 @@ filediv.innerHTML=' <iframe width=1000 height=900 frameborder=0 scrolling=auto s
getinputLists() {
getinputList({ operation: this.id, page: 0 }).then((response) => {
if (response.data) {
this.inputData = response.data;
}
});
@ -992,9 +1036,8 @@ filediv.innerHTML=' <iframe width=1000 height=900 frameborder=0 scrolling=auto s
}
});
},
//消耗物料删除
//消耗物料删除
handleDeleteinput(scope) {
this.$confirm("确认删除该消耗物料操作?", "警告", {
confirmButtonText: "确认",
cancelButtonText: "取消",
@ -1009,39 +1052,30 @@ filediv.innerHTML=' <iframe width=1000 height=900 frameborder=0 scrolling=auto s
console.error(err);
});
},
//车间领料批量提交
//车间领料批量提交
handlepicks() {
let _this = this;
this.pickDatas=[],
(this.pickDatas = []),
this.$refs.multipleTable.selection.forEach((item) => {
if(item.pick_count>0)
{
if (item.pick_count > 0) {
this.pickDatas.push({
"operation" :this.id,
"wmaterial":item.id,
"count": item.pick_count,
operation: this.id,
wmaterial: item.id,
count: item.pick_count,
});
}
});
createInputs(this.pickDatas).then((res) => {
if (res.code >= 200) {
this.dialogTablepick = false;
this.$message.success("提交成功!");
_this.getinputLists();
}
});
},
//操作产出物料列表
getoutputLists() {
getoutputList({ operation: this.id, page: 0 }).then((response) => {
@ -1065,7 +1099,7 @@ filediv.innerHTML=' <iframe width=1000 height=900 frameborder=0 scrolling=auto s
this.output.operation = this.id;
this.output.subproduction_progress = scope.row.id;
this.output.count = scope.row.output_count;
this.output.use_scrap=scope.row.use_scrap;
this.output.use_scrap = scope.row.use_scrap;
createOutput(this.output).then((res) => {
if (res.code >= 200) {
this.getoutputLists();
@ -1077,22 +1111,16 @@ filediv.innerHTML=' <iframe width=1000 height=900 frameborder=0 scrolling=auto s
},
//车间产出物料批量提交
handleoutputs() {
this.outputDatas=[],
(this.outputDatas = []),
this.$refs.multipleTables.selection.forEach((item) => {
if(item.output_count>0)
{
if (item.output_count > 0) {
this.outputDatas.push({
"operation" :this.id,
"subproduction_progress":item.id,
"count": item.output_count,
"use_scrap":item.use_scrap
operation: this.id,
subproduction_progress: item.id,
count: item.output_count,
use_scrap: item.use_scrap,
});
}
});
createOutputs(this.outputDatas).then((res) => {
@ -1101,18 +1129,15 @@ filediv.innerHTML=' <iframe width=1000 height=900 frameborder=0 scrolling=auto s
this.$message.success("提交成功!");
this.getoutputLists();
}
});
},
//提交本次操作
handlesubmit() {
submitOperation(this.id).then((res) => {
if (res.code >= 200) {
this.$router.push({name: "operation" })
this.$router.push({ name: "operation" });
this.$message.success("操作提交成功!");
}
});