Commit 6d235900 by xin.yang
parents 9f5b644a b96d84c0
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<div class="choose"> <div class="choose">
<p class="selectTitle"> <p class="selectTitle">
1.请选择生产线 1.请选择生产线
<span class="red">*</span> <!-- <span class="red">*</span> -->
</p> </p>
<div class="row"> <div class="row">
<p <p
...@@ -19,17 +19,14 @@ ...@@ -19,17 +19,14 @@
</p> </p>
</div> </div>
<div class="choose"> <div class="choose">
<p class="selectTitle"> <p class="selectTitle">2.上下料工位</p>
2.上下料工位
<span class="red">*</span>
</p>
<div class="row"> <div class="row">
<div <div
:key="index" :key="index"
class="options2" class="options2"
v-for="(item, index) in stationList" v-for="(item, index) in stationList"
@click="change(index)" @click="change2(index)"
:class="{ active: a == index }" :class="{ active: b == index }"
> >
<p>{{ item.title }}</p> <p>{{ item.title }}</p>
<p>{{ item.status == 1 ? "待上料" : "运行中" }}</p> <p>{{ item.status == 1 ? "待上料" : "运行中" }}</p>
...@@ -37,18 +34,19 @@ ...@@ -37,18 +34,19 @@
</div> </div>
</div> </div>
<div class="choose"> <div class="choose">
<p class="selectTitle"> <p class="selectTitle">3.操作</p>
3.操作
<span class="red">*</span>
</p>
<Tabs type="card"> <Tabs type="card">
<TabPane label="上料" :disabled="attr1"> <TabPane label="上料" :disabled="attr1">
<div class="filter"> <div class="filter">
<label style="font-size: 16px" <label style="font-size: 16px"
>上料信息:</label >上料信息:</label
> >
<Input type="text" class="searchInput" <Input
style="width: 300px"/> type="text"
class="searchInput"
style="width: 300px"
@keyup.enter="getWorkOrderInfo()"
/>
</div> </div>
<div class="row"> <div class="row">
<p class="flex"> <p class="flex">
...@@ -149,8 +147,16 @@ ...@@ -149,8 +147,16 @@
</p> </p>
</div> </div>
<div> <div>
<Button type="primary">准备上料</Button> <Button
<Button type="primary">安装完成</Button> type="primary"
@click="feedReady()"
>准备下料</Button
>
<Button
type="primary"
@click="installOver()"
>拆卸完成</Button
>
</div> </div>
</div> </div>
</div></TabPane </div></TabPane
...@@ -199,6 +205,7 @@ export default { ...@@ -199,6 +205,7 @@ export default {
productionLine: [], productionLine: [],
stationList: [], stationList: [],
a: -1, a: -1,
b: -1,
attr1: false, //上料、下料、上下料 attr1: false, //上料、下料、上下料
attr2: false, //上料、下料、上下料 attr2: false, //上料、下料、上下料
modal: false, modal: false,
...@@ -209,26 +216,26 @@ export default { ...@@ -209,26 +216,26 @@ export default {
render: (h, params) => { render: (h, params) => {
return h( return h(
"span", "span",
params.index + (this.page - 1) * this.pagesize + 1 params.index + 1
); );
}, },
width: 70, width: 70,
}, },
{ {
title: "仓库", title: "仓库",
key: "warehouse", key: "wavehouse",
}, },
{ {
title: "储位编号", title: "储位编号",
key: "storage_sn", key: "locationcode",
}, },
{ {
title: "工装编号", title: "工装编号",
key: "install_sn", key: "code",
}, },
{ {
title: "工件编号", title: "工件编号",
key: "workpiece_sn", key: "materialsn",
}, },
], ],
data1: [], data1: [],
...@@ -239,22 +246,22 @@ export default { ...@@ -239,22 +246,22 @@ export default {
render: (h, params) => { render: (h, params) => {
return h( return h(
"span", "span",
params.index + (this.page - 1) * this.pagesize + 1 params.index+ 1
); );
}, },
width: 70, width: 70,
}, },
{ {
title: "储位编号", title: "储位编号",
key: "storage_sn", key: "locationcode",
}, },
{ {
title: "工装编号", title: "工装编号",
key: "install_sn", key: "code",
}, },
{ {
title: "工件编号", title: "工件编号",
key: "workpiece_sn", key: "materialsn",
}, },
], ],
data2: [], data2: [],
...@@ -262,6 +269,7 @@ export default { ...@@ -262,6 +269,7 @@ export default {
}, },
created() { created() {
this.getProLine(); this.getProLine();
this.getStorages();
}, },
mounted() { mounted() {
// this.getStations() // this.getStations()
...@@ -303,11 +311,22 @@ export default { ...@@ -303,11 +311,22 @@ export default {
this.a = i; this.a = i;
this.getStations(this.productionLine[i].id); this.getStations(this.productionLine[i].id);
}, },
change2(index) {
this.b = index;
let status = this.stationList[index].status;
if (status == 1) {
this.attr2 = true;
}
},
//获取储位 //获取储位
getStorages() { getStorages() {
this.request("", "", "") this.request("/acc/AutomationLocation/GetLocationList", "", "get")
.then((res) => { .then((res) => {
console.log(res.data.data);
if (res.data.ret == 1) { if (res.data.ret == 1) {
this.data1 = res.data.data;
this.data2 = res.data.data;
} }
}) })
.catch((err) => { .catch((err) => {
...@@ -325,6 +344,33 @@ export default { ...@@ -325,6 +344,33 @@ export default {
console.log(err); console.log(err);
}); });
}, },
feedReady() {
// 准备上料
let data = {
section: 13,
code: "234324",
};
this.request("/acc/AutomationOperate/Loading", data, "post").thne((res) => {
if (res.data.ret == 1) {
}
});
},
installOver() {
// 安装完成
let data = {
section: 13
};
this.request("", data, "post").thne(
(res) => {
if (res.data.ret == 1) {
}
}
);
},
request(url, data, type) { request(url, data, type) {
if (type == "get") { if (type == "get") {
return this.axios return this.axios
......
...@@ -15,7 +15,17 @@ ...@@ -15,7 +15,17 @@
</Select> </Select>
</div> </div>
<div class="filter"> <div class="filter">
<label>夹具类型:</label> <label>工装编号:</label>
<Select
label-in-value
clearable
filterable
class="searchSelect"
>
</Select>
</div>
<div class="filter">
<label>状态:</label>
<Select <Select
label-in-value label-in-value
clearable clearable
...@@ -112,8 +122,9 @@ ...@@ -112,8 +122,9 @@
export default { export default {
data() { data() {
return { return {
columns1: [ columns1:[
{ {
type: "index2",
title: this.$t("1008"), title: this.$t("1008"),
key: "xuhao", key: "xuhao",
render: (h, params) => { render: (h, params) => {
...@@ -122,13 +133,90 @@ export default { ...@@ -122,13 +133,90 @@ export default {
params.index + (this.page - 1) * this.pagesize + 1 params.index + (this.page - 1) * this.pagesize + 1
); );
}, },
width: 70,
}, },
{ {
title: this.$t("100089"), title:'工装类型',
key: "productcode", key:'category'
minWidth: 150, },
{
title:'管理类型',
key:'managetype',
render:(h,params)=>{
let str = '';
if(params.row.managetype===1){
str = '单件';
}else if(params.row.managetype===2){
str = '批次';
}
return h('span',str);
}
},
{
title:'工装料号',
key:'partnumber'
},
{
title:'工装名称',
key:'name'
}, },
{
title:'工装编号',
key:'code'
},
{
title:'规格型号',
key:'specification'
},
{
title:'数量',
key:'number'
},
{
title:'状态',
key:'status',
render:(h,params)=>{
let str = '';
if(params.row.status===1){
str = '可用';
}else{
str = '停用';
}
return h('span',str);
}
},
{
title:'备注',
key:'remark'
},
{
title:'附件',
key:'filename',
render:(h,params)=>{
return h('span',{
style:{
color:'#2b85e4',
cursor:'pointer'
},
on:{
click:()=>{
let name = params.row.filename;
let url = params.row.fileurl;
if(url){
this.downFile(url,name);
}
}
}
},params.row.filename);
}
},
{
title:'维护人',
key:'updator'
},
{
title:'维护时间',
key:'updatetime'
}
], ],
data1: [], data1: [],
total: 0, total: 0,
......
...@@ -7,20 +7,31 @@ ...@@ -7,20 +7,31 @@
</div> </div>
<div class="filter"> <div class="filter">
<label>工装名称:</label> <label>工装名称:</label>
<Select v-model="frockid" label-in-value clearable filterable filter-by-label class="searchSelect">
<Input type="text" class="searchInput" v-model="frockname" /> <Option
v-for="(item,index) in frockList"
:value="item.id"
:key="index"
:label="item.name+'#'+item.code"
>{{ item.name+'#'+item.code }}</Option>
</Select>
</div> </div>
<div class="filter"> <div class="filter">
<label>状态:</label> <label>产品名称:</label>
<Select v-model="status" clearable class="searchSelect"> <Select v-model="productid" label-in-value clearable filterable filter-by-label class="searchSelect">
<Option :value="1">可用</Option> <Option
<Option :value="0">停用</Option> v-for="(item,index) in productList"
:value="item.id"
:key="index"
:label="item.name+'#'+item.code+'#'+item.drawingcode"
>{{ item.name+'#'+item.code+'#'+item.drawingcode }}</Option>
</Select> </Select>
</div> </div>
<div class="searchBtn"> <div class="searchBtn">
<Button type="primary" class="twoWord" icon="ios-search" @click="tosearch()">{{ $t(1001) }}</Button> <Button type="primary" class="twoWord" icon="ios-search" @click="tosearch()">{{ $t(1001) }}</Button>
<Button type="success" class="twoWord" icon="md-add-circle" @click="add()">{{$t('1002')}}</Button> <Button type="success" class="twoWord" icon="md-add-circle" @click="add()">{{$t('1002')}}</Button>
<Button type="warning" class="twoWord" icon="ios-create-outline" @click="edit()">{{$t('1003')}}</Button> <Button type="warning" class="twoWord" icon="ios-create-outline" @click="edit()">{{$t('1003')}}</Button>
<Button type="error" class="twoWord intervalRight" icon="md-close-circle" @click="dele()">{{ $t(1004) }}</Button>
<Button type="primary" class="fourWord" icon="md-download" @click="loadexcel()">{{$t('1005')}}</Button> <Button type="primary" class="fourWord" icon="md-download" @click="loadexcel()">{{$t('1005')}}</Button>
<Upload <Upload
style="display:inline-block" style="display:inline-block"
...@@ -32,7 +43,7 @@ ...@@ -32,7 +43,7 @@
:on-format-error="handleFormatError" :on-format-error="handleFormatError"
:on-success="handleSuccess" :on-success="handleSuccess"
:on-error="handleError" :on-error="handleError"
:format="['xlsx']" :format="['xlsx','xls']"
> >
<Button <Button
type="primary" type="primary"
...@@ -77,42 +88,30 @@ ...@@ -77,42 +88,30 @@
<div>正在上传...</div> <div>正在上传...</div>
</Spin> </Spin>
<div class="filter"> <div class="filter">
<label><i>*</i>工装类型:</label> <label>工装类型:</label>
<Cascader class="searchSelect" :data="frockTypeTree" v-model="parentType" change-on-select @on-change="changeFrockType1"></Cascader> <Cascader class="searchSelect" :data="frockTypeTree" v-model="parentType" change-on-select @on-change="changeFrockType1"></Cascader>
</div> </div>
<div class="filter"> <div class="filter">
<label><i>*</i>管理类型:</label>
<Select v-model="addmtype" class="searchSelect">
<Option :value="1">单件</Option>
<Option :value="2">批次</Option>
</Select>
</div>
<div class="filter">
<label><i>*</i>工装名称:</label> <label><i>*</i>工装名称:</label>
<Input type="text" class="searchInput" v-model="addfrockname" /> <Select v-model="addfrockid" label-in-value clearable filterable filter-by-label class="searchSelect">
</div> <Option
<div class="filter"> v-for="(item,index) in addfrockList"
<label><i>*</i>工装料号:</label> :value="item.id"
<Input type="text" class="searchInput" v-model="addfrockno" /> :key="index"
</div> :label="item.name+'#'+item.code"
<div class="filter"> >{{ item.name+'#'+item.code }}</Option>
<label><i>*</i>工装编号:</label> </Select>
<Input type="text" class="searchInput" v-model="addfrockcode" />
</div>
<div class="filter">
<label><i>*</i>规格型号:</label>
<Input type="text" class="searchInput" v-model="addfrockspec" />
</div>
<div class="filter">
<label><i>*</i>数量:</label>
<InputNumber type="text" class="searchInput" :min="1" :formatter="value => `${parseInt(value)}`" v-model="addnum" />
</div> </div>
<div class="filter"> <div class="filter">
<label><i>*</i>状态:</label> <label><i>*</i>产品名称:</label>
<RadioGroup v-model="addstatus"> <Select v-model="addproductid" label-in-value clearable filterable filter-by-label class="searchSelect">
<Radio label="1"><span>可用</span></Radio> <Option
<Radio label="0"><span>停用</span></Radio> v-for="(item,index) in productList"
</RadioGroup> :value="item.id"
:key="index"
:label="item.name+'#'+item.code+'#'+item.drawingcode"
>{{ item.name+'#'+item.code+'#'+item.drawingcode }}</Option>
</Select>
</div> </div>
<div class="filter"> <div class="filter">
<label>备注:</label> <label>备注:</label>
...@@ -124,9 +123,9 @@ ...@@ -124,9 +123,9 @@
<Upload <Upload
ref="upload" ref="upload"
:show-upload-list="false" :show-upload-list="false"
:on-success="handleSuccess" :on-success="handleSuccess1"
:before-upload="handleBeforeUpload" :before-upload="handleBeforeUpload"
:on-error="handleError" :on-error="handleError1"
type="drag" type="drag"
:headers="headers" :headers="headers"
:action="UploadAction"> :action="UploadAction">
...@@ -162,9 +161,10 @@ export default { ...@@ -162,9 +161,10 @@ export default {
frockTypeTree:[],//树形结构 frockTypeTree:[],//树形结构
frockType:[],//工装类型 frockType:[],//工装类型
frockTypeid:'', frockTypeid:'',
frockcode:'',//工装编号 frockList:[],//工装列表
frockname:'',//工装名称 frockid:'',//工装id
status:'',//状态 productList:[],//产品列表
productid:'',//产品id
//列表 //列表
total:0, total:0,
...@@ -185,20 +185,7 @@ export default { ...@@ -185,20 +185,7 @@ export default {
}, },
{ {
title:'工装类型', title:'工装类型',
key:'category' key:'categoryname'
},
{
title:'管理类型',
key:'managetype',
render:(h,params)=>{
let str = '';
if(params.row.managetype===1){
str = '单件';
}else if(params.row.managetype===2){
str = '批次';
}
return h('span',str);
}
}, },
{ {
title:'工装料号', title:'工装料号',
...@@ -206,32 +193,19 @@ export default { ...@@ -206,32 +193,19 @@ export default {
}, },
{ {
title:'工装名称', title:'工装名称',
key:'name' key:'fixturetool'
},
{
title:'工装编号',
key:'code'
}, },
{ {
title:'规格型号', title:'规格型号',
key:'specification' key:'specfication'
}, },
{ {
title:'数量', title:'产品编号',
key:'number' key:'productcode'
}, },
{ {
title:'状态', title:'产品名称',
key:'status', key:'productname'
render:(h,params)=>{
let str = '';
if(params.row.status===1){
str = '可用';
}else{
str = '停用';
}
return h('span',str);
}
}, },
{ {
title:'备注', title:'备注',
...@@ -272,16 +246,11 @@ export default { ...@@ -272,16 +246,11 @@ export default {
detailobj:{}, detailobj:{},
addmodal:false, addmodal:false,
type:0,//1添加 2编辑 type:0,//1添加 2编辑
parentType:[],//父级类型 parentType:[],//工装类型
parentTypeid:'', parentTypeid:'',
frockTypename:'',//工装类型名称 addfrockList:[],
addmtype:1,//管理类型 addfrockid:'',//工装id
addfrockname:'',//工装名称 addproductid:'',//产品
addfrockno:'',//工装料号
addfrockcode:'',//工装编号
addnum:0,
addstatus:'1',//状态 1可用 0停用
addfrockspec:'',//规格型号
addremark:'',//备注 addremark:'',//备注
filename: '',//文件名称 filename: '',//文件名称
fileurl:'',//文件路径 fileurl:'',//文件路径
...@@ -297,6 +266,8 @@ export default { ...@@ -297,6 +266,8 @@ export default {
}, },
created(){ created(){
this.initFrockType();//工装类型 this.initFrockType();//工装类型
this.getFrocks();//工装
this.iniproducts();//产品
this.tosearch(); this.tosearch();
this.tableColumns1 = this.$time.initTableTitle(this.tableColumns1); this.tableColumns1 = this.$time.initTableTitle(this.tableColumns1);
}, },
...@@ -333,6 +304,7 @@ export default { ...@@ -333,6 +304,7 @@ export default {
this.frockTypeid = ""; this.frockTypeid = "";
if(value!=undefined && value.length){ if(value!=undefined && value.length){
this.frockTypeid = value[value.length - 1]; this.frockTypeid = value[value.length - 1];
this.getFrocksChange(1);
} }
}, },
changeFrockType1(value){ changeFrockType1(value){
...@@ -341,21 +313,85 @@ export default { ...@@ -341,21 +313,85 @@ export default {
if(value!=undefined && value.length){ if(value!=undefined && value.length){
this.parentTypeid = value[value.length - 1]; this.parentTypeid = value[value.length - 1];
this.parentType = value; this.parentType = value;
this.getFrocksChange(2);
} }
}, },
//获取工装列表 //获取工装下拉框
getFrocks(){ getFrocks(){
// this.axios.request({ let params = {
// url: "/fms/accountInfo/frockList", category:'',//工装类型id
// method: "get", code:'',
// }) name:'',
// .then((res) => { state:1, //0停用 1可用
// this.frockList = []; page:1,
// let data = res.data.data; pagesize:1000000,
// if (res.data.ret == 1&&Array.isArray(data)&&data.length) { toexcel:0 //0查询 1导出
// this.frockList = data; }
// } this.axios.request({
// }); url: "/acc/FixtureTools/GetPageList",
params,
method: "get",
})
.then((res) => {
this.frockList = [];
this.addfrockList = [];
let data = res.data.data;
if (res.data.ret == 1 &&Array.isArray(data)&&data.length) {
this.frockList = res.data.data;
this.addfrockList = res.data.data;
}
});
},
getFrocksChange(num){
this.addfrockid = '';
let params = {
category:num==1?this.frockTypeid:this.parentTypeid,//工装类型id
code:'',
name:'',
state:1, //0停用 1可用
page:1,
pagesize:1000000,
toexcel:0 //0查询 1导出
}
this.axios.request({
url: "/acc/FixtureTools/GetPageList",
params,
method: "get",
})
.then((res) => {
if(num == 1){
this.frockList = [];
}else{
this.addfrockList = [];
}
let data = res.data.data;
if (res.data.ret == 1 &&Array.isArray(data)&&data.length) {
if(num == 1){
this.frockList = res.data.data;
}else{
this.addfrockList = res.data.data;
}
}
});
},
//查询产品
iniproducts() {
var params = {
name: '',
count: 1000000
}
this.axios.request({
url: '/config/ProjectProduct/GetProductsByCode',
params,
method: 'get'
})
.then(res => {
this.productList = [];
let data = res.data.data;
if(res.data.ret ===1 &&Array.isArray(data)&&data.length){
this.productList = res.data.data
}
})
}, },
tosearch(){ tosearch(){
this.page = 1; this.page = 1;
...@@ -364,17 +400,16 @@ export default { ...@@ -364,17 +400,16 @@ export default {
}, },
search(toexcel){ search(toexcel){
let params = { let params = {
category:this.frockType,//工装类型id category:this.frockTypeid,//工装类别ID
code:this.frockcode, tool:this.frockid,//工装信息ID
name:this.frockname, product:this.productid,//产品ID
state:this.status, //0停用 1可用
page:this.page, page:this.page,
pagesize:this.pagesize, pagesize:this.pagesize,
toexcel:toexcel //0查询 1导出 toexcel:toexcel //0查询 1导出
} }
this.detailobj = {}; this.detailobj = {};
this.axios.request({ this.axios.request({
url: "/acc/FixtureTools/GetPageList", url: "/acc/FixtureToolsProduct/GetPageList",
params, params,
method: "get", method: "get",
}) })
...@@ -382,7 +417,7 @@ export default { ...@@ -382,7 +417,7 @@ export default {
if(toexcel === 1){ if(toexcel === 1){
if (res.data.ret === 1) { if (res.data.ret === 1) {
window.location.href = window.location.href =
axios.publicPath + "" + res.data.data; this.axios.publicPath + "" + res.data.data;
} else { } else {
this.$Message.error(this.$t(res.data.msg)); this.$Message.error(this.$t(res.data.msg));
} }
...@@ -402,14 +437,8 @@ export default { ...@@ -402,14 +437,8 @@ export default {
this.type = 1; this.type = 1;
this.parentType = [];//工装类型 清空 this.parentType = [];//工装类型 清空
this.parentTypeid = ''; this.parentTypeid = '';
this.addfrockid = '';//工装id
this.addmtype = 1;//管理类型 this.addproductid = '';//产品
this.addfrockname = '';//工装名称
this.addfrockno = '';//工装料号
this.addfrockcode = '';//工装编号
this.addnum = 1;
this.addfrockspec = '';
this.addstatus = '1';//状态 1可用 0停用
this.addremark = '';//备注 this.addremark = '';//备注
this.filename = '';//文件名称 this.filename = '';//文件名称
this.fileurl = '';//文件路径 this.fileurl = '';//文件路径
...@@ -421,68 +450,41 @@ export default { ...@@ -421,68 +450,41 @@ export default {
return false; return false;
} }
this.type = 2; this.type = 2;
this.parentType = [];//工装类型 清空
this.parentTypeid = this.detailobj.categoryid; this.parentTypeid = this.detailobj.categoryid;
this.parentType = this.detailobj.categoryids; this.addfrockid = this.detailobj.fixturetoolid;//工装id
this.addmtype = this.detailobj.managetype;//管理类型 this.addproductid = this.detailobj.productid;//产品
this.addfrockname = this.detailobj.name;//工装名称
this.addfrockno = this.detailobj.partnumber;//工装料号
this.addfrockcode = this.detailobj.code;//工装编号
this.addnum = this.detailobj.number;
this.addfrockspec = this.detailobj.specification;
this.addstatus = this.detailobj.status+'';//状态 1可用 0停用
this.addremark = this.detailobj.remark;//备注 this.addremark = this.detailobj.remark;//备注
this.filename = this.detailobj.filename;//文件名称 this.filename = this.detailobj.filename;//文件名称
this.fileurl = this.detailobj.fileurl;//文件路径 this.fileurl = this.detailobj.fileurl;//文件路径
this.addmodal = true; this.addmodal = true;
}, },
addPost(){ addPost(){
if(!this.parentTypeid){ if(!this.addfrockid){
this.$Message.error("请选择工装类型");
return false;
}
if(!this.addfrockname){
this.$Message.error("请输入工装名称"); this.$Message.error("请输入工装名称");
return false; return false;
} }
if(!this.addfrockno){ if(!this.addproductid){
this.$Message.error("请输入工装料号"); this.$Message.error("请输入产品名称");
return false;
}
if(!this.addfrockcode){
this.$Message.error("请输入工装编号");
return false;
}
if(!this.addfrockspec){
this.$Message.error("请输入规格型号");
return false;
}
if(!this.addnum){
this.$Message.error("请输入工装数量");
return false; return false;
} }
let url = ''; let url = '';
let id = ''; let id = '';
if(this.type === 1){ if(this.type === 1){
url = '/acc/FixtureTools/Add'; url = '/acc/FixtureToolsProduct/Add';
id = 0; id = 0;
} }
else{ else{
url = '/acc/FixtureTools/Update'; url = '/acc/FixtureToolsProduct/Update';
id = this.detailobj.id; id = this.detailobj.id;
} }
let data = { let data = {
id:id, id:id,
categoryid:this.parentTypeid,//工装类型id fixturetoolid:this.addfrockid,//工装id
managetype:this.addmtype, productid:this.addproductid,
partnumber:this.addfrockno,//料号
code:this.addfrockcode,//编号
name:this.addfrockname,//名称
specifition:this.addfrockspec,//规格型号
number:this.addnum,//数量
remark:this.addremark,//备注 remark:this.addremark,//备注
status:this.addstatus,//附件
fileurl:this.fileurl, fileurl:this.fileurl,
filename:this.filename filename:this.filename
} }
...@@ -515,7 +517,7 @@ export default { ...@@ -515,7 +517,7 @@ export default {
return false; return false;
} }
}, },
handleSuccess (res,file) { handleSuccess1 (res,file) {
this.spinShow = false; this.spinShow = false;
if (res.ret == 1) { if (res.ret == 1) {
this.$Message.success(this.$t("100378")); this.$Message.success(this.$t("100378"));
...@@ -525,7 +527,8 @@ export default { ...@@ -525,7 +527,8 @@ export default {
this.$Message.error(this.$t(res.msg+'')); this.$Message.error(this.$t(res.msg+''));
} }
}, },
handleError(){ handleError1(){
this.spinShow = false;
this.$Message.error(this.$t("600512") + "!"); this.$Message.error(this.$t("600512") + "!");
}, },
delfile(){ delfile(){
...@@ -536,44 +539,65 @@ export default { ...@@ -536,44 +539,65 @@ export default {
//下载文件 //下载文件
downFile(url,fileName){ downFile(url,fileName){
let params = { let params = {
file_url: url, url: url,
name:fileName
}; };
this.axios.request({ this.axios.request({
url: "/config/Download/DownloadFile", url: "/config/Download/DownloadFileByUrl",
params, params,
method: "get", method: "get",
responseType: "blob" responseType: "blob"
}) })
.then((res) => { .then((res) => {
if (res.status == 200) {
let url;
let link = document.createElement("a");
url = window.URL.createObjectURL(res.data);
link.style.display = "none";
link.href = url;
link.setAttribute("download", fileName);
document.body.appendChild(link);
link.click();
}
}).catch(error=>{
this.$Message.error('请求错误')
});
},
//删除
dele(){
if (
this.detailobj.id === undefined ||
this.detailobj.id === null
) {
this.$Message.error(this.$t("1017"));
return false;
} else {
var params = {
id: this.detailobj.id,
};
this.$Modal.confirm({
title: this.$t("1018"),
content: "",
width: "290px",
closable: true,
okText: this.$t("1004"),
onOk: () => {
this.axios.request({
url: "/acc/FixtureToolsProduct/Delete",
params,
method: "get",
})
.then((res) => {
if (res.data.ret === 1) { if (res.data.ret === 1) {
var info = res.data.data; this.$Message.success(this.$t("1058"));
var content = info.content; this.search(0);
// 创建隐藏的可下载链接
var eleLink = document.createElement("a");
eleLink.download = fileName;
eleLink.style.display = "none";
// 字符内容转变成blob地址
var blob = new Blob([content]);
eleLink.href = URL.createObjectURL(blob);
// 触发点击
document.body.appendChild(eleLink);
eleLink.click();
// 然后移除
document.body.removeChild(eleLink);
} else { } else {
this.$Message.error(this.$t(res.data.msg)); this.$Message.error(this.$t(res.data.msg));
} }
}) });
// console.log(fileName) },
// console.log(data) });
// let url = window.URL.createObjectURL(new Blob([data])); }
// let link = document.createElement("a");
// link.style.display = "none";
// link.href = url;
// link.setAttribute("download", fileName);
// document.body.appendChild(link);
// link.click();
}, },
//导出模板 //导出模板
loadexcel() { loadexcel() {
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
:on-format-error="handleFormatError" :on-format-error="handleFormatError"
:on-success="handleSuccess" :on-success="handleSuccess"
:on-error="handleError" :on-error="handleError"
:format="['xlsx']" :format="['xlsx','xls']"
> >
<Button <Button
type="primary" type="primary"
...@@ -275,7 +275,7 @@ export default { ...@@ -275,7 +275,7 @@ export default {
detailobj:{}, detailobj:{},
addmodal:false, addmodal:false,
type:0,//1添加 2编辑 type:0,//1添加 2编辑
parentType:[],//父级类型 parentType:[],//工装类型
parentTypeid:'', parentTypeid:'',
frockTypename:'',//工装类型名称 frockTypename:'',//工装类型名称
addmtype:1,//管理类型 addmtype:1,//管理类型
...@@ -346,20 +346,6 @@ export default { ...@@ -346,20 +346,6 @@ export default {
this.parentType = value; this.parentType = value;
} }
}, },
//获取工装列表
getFrocks(){
// this.axios.request({
// url: "/fms/accountInfo/frockList",
// method: "get",
// })
// .then((res) => {
// this.frockList = [];
// let data = res.data.data;
// if (res.data.ret == 1&&Array.isArray(data)&&data.length) {
// this.frockList = data;
// }
// });
},
tosearch(){ tosearch(){
this.page = 1; this.page = 1;
this.pagesize = 10; this.pagesize = 10;
...@@ -367,7 +353,7 @@ export default { ...@@ -367,7 +353,7 @@ export default {
}, },
search(toexcel){ search(toexcel){
let params = { let params = {
category:this.frockType,//工装类型id category:this.frockTypeid,//工装类型id
code:this.frockcode, code:this.frockcode,
name:this.frockname, name:this.frockname,
state:this.status, //0停用 1可用 state:this.status, //0停用 1可用
...@@ -385,7 +371,7 @@ export default { ...@@ -385,7 +371,7 @@ export default {
if(toexcel === 1){ if(toexcel === 1){
if (res.data.ret === 1) { if (res.data.ret === 1) {
window.location.href = window.location.href =
axios.publicPath + "" + res.data.data; this.axios.publicPath + "" + res.data.data;
} else { } else {
this.$Message.error(this.$t(res.data.msg)); this.$Message.error(this.$t(res.data.msg));
} }
...@@ -518,7 +504,7 @@ export default { ...@@ -518,7 +504,7 @@ export default {
return false; return false;
} }
}, },
handleSuccess (res,file) { handleSuccess1 (res,file) {
this.spinShow = false; this.spinShow = false;
if (res.ret == 1) { if (res.ret == 1) {
this.$Message.success(this.$t("100378")); this.$Message.success(this.$t("100378"));
...@@ -528,7 +514,8 @@ export default { ...@@ -528,7 +514,8 @@ export default {
this.$Message.error(this.$t(res.msg+'')); this.$Message.error(this.$t(res.msg+''));
} }
}, },
handleError(){ handleError1(){
this.spinShow = false;
this.$Message.error(this.$t("600512") + "!"); this.$Message.error(this.$t("600512") + "!");
}, },
delfile(){ delfile(){
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
:on-format-error="handleFormatError" :on-format-error="handleFormatError"
:on-success="handleSuccess" :on-success="handleSuccess"
:on-error="handleError" :on-error="handleError"
:format="['xlsx']" :format="['xlsx','xls']"
> >
<Button <Button
type="primary" type="primary"
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
</div> </div>
<div class="entryItem"> <div class="entryItem">
<div class="choose"> <div class="choose">
<p class="selectTitle">1.{{ $t("90000016") }}</p> <p class="selectTitle">1.{{ $t("800082") }}</p>
<div class="row"> <div class="row">
<p <p
class="options" class="options"
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
@click="linechange(index)" @click="linechange(index)"
:class="{ active: a == index }" :class="{ active: a == index }"
> >
{{ item.name }} {{ item.title }}
</p> </p>
</div> </div>
</div> </div>
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
@click="stationchange(index)" @click="stationchange(index)"
:class="{ active: b == index }" :class="{ active: b == index }"
> >
{{ item.name }} {{ item.title }}
</p> </p>
</div> </div>
</div> </div>
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
</div> </div>
</div> </div>
<div class="choose"> <div class="choose">
<p class="selectTitle">4.{{ $t("1950603") }}</p> <p class="selectTitle">4.{{ $t("8063") }}</p>
<div class="row"> <div class="row">
<p <p
class="options" class="options"
...@@ -61,7 +61,20 @@ ...@@ -61,7 +61,20 @@
</div> </div>
<div class="entryItem"> <div class="entryItem">
<div class="choose"> <div class="choose">
<p class="selectTitle">5.{{ $t("90000017") }}</p> <p class="selectTitle">5.工件编号</p>
<div class="row">
<input
class="erweima"
type="text"
v-model="qrcode"
@keyup.enter="savedata"
/>
</div>
</div>
</div>
<div class="entryItem">
<div class="choose">
<p class="selectTitle">6.{{ $t("90000017") }}</p>
<div class="row"> <div class="row">
<p <p
class="options" class="options"
...@@ -82,10 +95,15 @@ ...@@ -82,10 +95,15 @@
</div> </div>
<div class="entryItem"> <div class="entryItem">
<div class="choose"> <div class="choose">
<p class="selectTitle">6.{{ $t("90000020") }}</p> <p class="selectTitle">7.{{ $t("90000020") }}</p>
<div <div
:class="table_scrollx ? 'collection_table' : ''" :class="table_scrollx ? 'collection_table' : ''"
style="width: 100%; float: left; height: 100%; padding-left: 5px" style="
width: 100%;
float: left;
height: 100%;
padding-left: 5px;
"
> >
<template style="overflow-x: scroll; overflow-y: hidden"> <template style="overflow-x: scroll; overflow-y: hidden">
<Table <Table
...@@ -102,13 +120,22 @@ ...@@ -102,13 +120,22 @@
<template slot-scope="{ row, index }" slot="item"> <template slot-scope="{ row, index }" slot="item">
<span>{{ row.item }}</span> <span>{{ row.item }}</span>
</template> </template>
<template slot-scope="{ row, index }" slot="standard"> <template
slot-scope="{ row, index }"
slot="standard"
>
<span>{{ row.standard }}</span> <span>{{ row.standard }}</span>
</template> </template>
<template slot-scope="{ row, index }" slot="min_value"> <template
slot-scope="{ row, index }"
slot="min_value"
>
<span>{{ row.min_value }}</span> <span>{{ row.min_value }}</span>
</template> </template>
<template slot-scope="{ row, index }" slot="max_value"> <template
slot-scope="{ row, index }"
slot="max_value"
>
<span>{{ row.max_value }}</span> <span>{{ row.max_value }}</span>
</template> </template>
<template slot-scope="{ row, index }" slot="range"> <template slot-scope="{ row, index }" slot="range">
...@@ -129,17 +156,27 @@ ...@@ -129,17 +156,27 @@
<inputNumber <inputNumber
class="publicinput" class="publicinput"
:class="{ :class="{
active_class: tableData[index]['min_value' + (i + 1)] active_class: tableData[index][
? tableData[index]['min_value' + (i + 1)] < 'min_value' + (i + 1)
row.min_value || ]
tableData[index]['min_value' + (i + 1)] > ? tableData[index][
row.max_value 'min_value' + (i + 1)
] < row.min_value ||
tableData[index][
'min_value' + (i + 1)
] > row.max_value
: false, : false,
}" }"
type="text" type="text"
v-model="tableData[index]['min_value' + (i + 1)]" v-model="
tableData[index][
'min_value' + (i + 1)
]
"
style="width: 100px" style="width: 100px"
@blur.native.capture="getrange(index, i + 1)" @blur.native.capture="
getrange(index, i + 1)
"
/> />
</span> </span>
</template> </template>
...@@ -157,17 +194,27 @@ ...@@ -157,17 +194,27 @@
<inputNumber <inputNumber
class="publicinput" class="publicinput"
type="text" type="text"
v-model="tableData[index]['max_value' + (i + 1)]" v-model="
tableData[index][
'max_value' + (i + 1)
]
"
:class="{ :class="{
active_class: tableData[index]['max_value' + (i + 1)] active_class: tableData[index][
? tableData[index]['max_value' + (i + 1)] < 'max_value' + (i + 1)
row.min_value || ]
tableData[index]['max_value' + (i + 1)] > ? tableData[index][
row.max_value 'max_value' + (i + 1)
] < row.min_value ||
tableData[index][
'max_value' + (i + 1)
] > row.max_value
: false, : false,
}" }"
style="width: 100px" style="width: 100px"
@blur.native.capture="getrange(index, i + 1)" @blur.native.capture="
getrange(index, i + 1)
"
/> />
</span> </span>
</template> </template>
...@@ -177,34 +224,56 @@ ...@@ -177,34 +224,56 @@
:slot="'value' + (i + 1)" :slot="'value' + (i + 1)"
> >
<span v-if="tableData[index].checktype === 1"> <span v-if="tableData[index].checktype === 1">
<RadioGroup v-model="tableData[index]['value' + (i + 1)]"> <RadioGroup
<Radio label="OK" style="width: 30px">OK</Radio> v-model="
<Radio label="NG" style="width: 30px">NG</Radio> tableData[index]['value' + (i + 1)]
"
>
<Radio label="OK" style="width: 30px"
>OK</Radio
>
<Radio label="NG" style="width: 30px"
>NG</Radio
>
</RadioGroup> </RadioGroup>
</span> </span>
<span v-else-if="tableData[index].checktype === 2"> <span
v-else-if="tableData[index].checktype === 2"
>
<inputNumber <inputNumber
:disabled=" :disabled="
tableData[index].checktype === 2 && tableData[index].checktype === 2 &&
tableData[index].valuecategory === 2 tableData[index].valuecategory === 2
" "
:class="{ :class="{
active_class: tableData[index]['value' + (i + 1)] active_class: tableData[index][
? tableData[index]['value' + (i + 1)] < row.min_value || 'value' + (i + 1)
tableData[index]['value' + (i + 1)] > row.max_value ]
? tableData[index][
'value' + (i + 1)
] < row.min_value ||
tableData[index][
'value' + (i + 1)
] > row.max_value
: false, : false,
}" }"
class="publicinput" class="publicinput"
type="text" type="text"
v-model="tableData[index]['value' + (i + 1)]" v-model="
tableData[index]['value' + (i + 1)]
"
style="width: 100px" style="width: 100px"
/> />
</span> </span>
<span v-else-if="tableData[index].checktype === 0"> <span
v-else-if="tableData[index].checktype === 0"
>
<input <input
class="publicinput" class="publicinput"
type="text" type="text"
v-model="tableData[index]['value' + (i + 1)]" v-model="
tableData[index]['value' + (i + 1)]
"
style="width: 100px" style="width: 100px"
/> />
</span> </span>
...@@ -224,11 +293,16 @@ ...@@ -224,11 +293,16 @@
:disabled="true" :disabled="true"
class="publicinput" class="publicinput"
type="text" type="text"
v-model="tableData[index]['range' + (i + 1)]" v-model="
tableData[index]['range' + (i + 1)]
"
:class="{ :class="{
active_class: tableData[index]['range' + (i + 1)] active_class: tableData[index][
? tableData[index]['range' + (i + 1)] > 'range' + (i + 1)
tableData[index]['range'] ]
? tableData[index][
'range' + (i + 1)
] > tableData[index]['range']
: false, : false,
}" }"
style="width: 100px; font-color: black" style="width: 100px; font-color: black"
...@@ -240,23 +314,16 @@ ...@@ -240,23 +314,16 @@
</div> </div>
</div> </div>
</div> </div>
<div class="entryItem">
<div class="choose">
<p class="selectTitle">7.{{ $t("90000021") }}</p>
<div class="row">
<input
class="erweima"
type="text"
v-model="qrcode"
@keyup.enter="savedata"
/>
</div>
</div>
</div>
<div class="entryItem pr"> <div class="entryItem pr">
<span class="tip" v-text="message"></span> <span class="tip" v-text="message"></span>
<!--<button class="save" @click="savedata">保存</button>--> <!--<button class="save" @click="savedata">保存</button>-->
<Button type="primary" :loading="loading" @click="savedata" class="save"> <Button
type="primary"
:loading="loading"
@click="savedata"
class="save"
>
<span v-if="!loading">{{ $t("900306") }}</span> <span v-if="!loading">{{ $t("900306") }}</span>
<span v-else></span> <span v-else></span>
</Button> </Button>
...@@ -292,7 +359,10 @@ ...@@ -292,7 +359,10 @@
overflow-y: scroll; overflow-y: scroll;
" "
> >
<Table :columns="ngcolumns" :data="ngtableData"></Table> <Table
:columns="ngcolumns"
:data="ngtableData"
></Table>
</div> </div>
</div> </div>
</div> </div>
...@@ -300,7 +370,9 @@ ...@@ -300,7 +370,9 @@
<template> <template>
<Poptip placement="left" width="300px"> <Poptip placement="left" width="300px">
<Button type="primary" :loading="loading2"> <Button type="primary" :loading="loading2">
<span v-if="!loading2">{{ $t("1950549") }}</span> <span v-if="!loading2">{{
$t("1950549")
}}</span>
<span v-else>{{ $t("1950549") }}</span> <span v-else>{{ $t("1950549") }}</span>
</Button> </Button>
<div class="api" slot="content"> <div class="api" slot="content">
...@@ -322,14 +394,24 @@ ...@@ -322,14 +394,24 @@
style="width: 100px" style="width: 100px"
/> />
</div> </div>
<Button type="primary" :loading="loading2" @click="saveresult1"> <Button
<span v-if="!loading2">{{ $t("900306") }}</span> type="primary"
:loading="loading2"
@click="saveresult1"
>
<span v-if="!loading2">{{
$t("900306")
}}</span>
<span v-else>{{ $t("900306") }}</span> <span v-else>{{ $t("900306") }}</span>
</Button> </Button>
</div> </div>
</Poptip> </Poptip>
</template> </template>
<Button type="primary" :loading="loading3" @click="saveresult2"> <Button
type="primary"
:loading="loading3"
@click="saveresult2"
>
<span v-if="!loading3">{{ "NG" }}</span> <span v-if="!loading3">{{ "NG" }}</span>
<span v-else>{{ "NG" }}</span> <span v-else>{{ "NG" }}</span>
</Button> </Button>
...@@ -391,7 +473,7 @@ export default { ...@@ -391,7 +473,7 @@ export default {
align: "center", align: "center",
}, },
{ {
title: this.$t("950245"), title: '量具信息',
slot: "standard", slot: "standard",
align: "center", align: "center",
}, },
...@@ -406,7 +488,12 @@ export default { ...@@ -406,7 +488,12 @@ export default {
align: "center", align: "center",
}, },
{ {
title: this.$t("920168"), title: '极差',
slot: "max_value",
align: "center",
},
{
title: this.$t("950408"),
slot: "result_value", slot: "result_value",
align: "center", align: "center",
}, },
...@@ -557,14 +644,17 @@ export default { ...@@ -557,14 +644,17 @@ export default {
axios axios
.request({ .request({
url: url:
"/qms/InspectStandard/GetItemLevelSection?reverselevel=2&parentid=0", "/qms/RepairPostionSetting/GetChanel",
method: "get", method: "get",
}) })
.then((res) => { .then((res) => {
if (res.data.ret == 1) {
this.lineList = res.data.data; this.lineList = res.data.data;
}
}); });
}, },
linechange(i) { linechange(i) {
console.log(1111111111);
this.a = i; this.a = i;
this.line = this.lineList[i]; this.line = this.lineList[i];
this.initstations(this.line.id); this.initstations(this.line.id);
...@@ -575,11 +665,16 @@ export default { ...@@ -575,11 +665,16 @@ export default {
this.station = {}; this.station = {};
this.b = 0; this.b = 0;
if (lineid > 0) { if (lineid > 0) {
let params = {
line: lineid,
type: 1,
};
axios axios
.request({ .request({
url: url:
"/qms/InspectStandard/GetItemLevelSection?reverselevel=1&parentid=" + "/acc/AutomationOperate/GetloadStation"
lineid, ,
params,
method: "get", method: "get",
}) })
.then((res) => { .then((res) => {
...@@ -660,24 +755,37 @@ export default { ...@@ -660,24 +755,37 @@ export default {
} }
}, },
initchecktype() { initchecktype() {
axios.request({ axios
url: '/qms/TypeCount/GetTypeCounts?page=1&pagesize=10000', .request({
method: 'get' url: "/qms/TypeCount/GetTypeCounts?page=1&pagesize=10000",
}).then(res => { method: "get",
})
.then((res) => {
let data = res.data.data; let data = res.data.data;
if(res.data.ret ===1 && Array.isArray(data)&&data.length){ if (
res.data.data.forEach(ele => { res.data.ret === 1 &&
this.checktypeList.push({id:ele.type_code, name:ele.type_name}); Array.isArray(data) &&
data.length
) {
res.data.data.forEach((ele) => {
this.checktypeList.push({
id: ele.type_code,
name: ele.type_name,
});
}); });
this.checktype = this.checktypeList[0]; this.checktype = this.checktypeList[0];
this.e = 0; this.e = 0;
} }
}) });
}, },
checktypechange(i) { checktypechange(i) {
this.checktype = this.checktypeList[i]; this.checktype = this.checktypeList[i];
this.e = i; this.e = i;
if (this.product.id > 0 && this.station.id > 0 && this.checktype.id > 0) { if (
this.product.id > 0 &&
this.station.id > 0 &&
this.checktype.id > 0
) {
this.inititems(); this.inititems();
} }
}, },
...@@ -729,7 +837,11 @@ export default { ...@@ -729,7 +837,11 @@ export default {
sectionid: this.station.id, sectionid: this.station.id,
checktype: this.checktype.id, checktype: this.checktype.id,
}; };
if (data.productid > 0 && data.sectionid > 0 && data.checktype > 0) { if (
data.productid > 0 &&
data.sectionid > 0 &&
data.checktype > 0
) {
axios axios
.request({ .request({
url: url:
...@@ -746,7 +858,10 @@ export default { ...@@ -746,7 +858,10 @@ export default {
var isMaxMin = false; var isMaxMin = false;
tablelist.forEach((element) => { tablelist.forEach((element) => {
if (element.checktype === 2 && element.valuecategory === 2) { if (
element.checktype === 2 &&
element.valuecategory === 2
) {
isMaxMin = true; isMaxMin = true;
} }
}); });
...@@ -824,7 +939,8 @@ export default { ...@@ -824,7 +939,8 @@ export default {
value: item.value, value: item.value,
valuecategory: item.valuecategory, valuecategory: item.valuecategory,
range: range:
item.checktype === 2 && item.valuecategory === 2 item.checktype === 2 &&
item.valuecategory === 2
? item.range ? item.range
: "", : "",
}; };
...@@ -899,8 +1015,10 @@ export default { ...@@ -899,8 +1015,10 @@ export default {
spcCheck = true; spcCheck = true;
} }
if ( if (
(detail.value > ele.max_value && ele.max_value !== "") || (detail.value > ele.max_value &&
(detail.value < ele.min_value && ele.min_value !== "") ele.max_value !== "") ||
(detail.value < ele.min_value &&
ele.min_value !== "")
) { ) {
if ( if (
detail.value !== null && detail.value !== null &&
...@@ -942,11 +1060,14 @@ export default { ...@@ -942,11 +1060,14 @@ export default {
if ( if (
(detail.upperlimit > ele.max_value || (detail.upperlimit > ele.max_value ||
detail.lowerlimit < ele.min_value || detail.lowerlimit < ele.min_value ||
detail.upperlimit - detail.lowerlimit > ele.range || detail.upperlimit - detail.lowerlimit >
ele.range ||
detail.upperlimit < ele.min_value || detail.upperlimit < ele.min_value ||
detail.lowerlimit > ele.max_value || detail.lowerlimit > ele.max_value ||
(detail.value > ele.max_value && ele.max_value !== "") || (detail.value > ele.max_value &&
(detail.value < ele.min_value && ele.min_value !== "")) && ele.max_value !== "") ||
(detail.value < ele.min_value &&
ele.min_value !== "")) &&
detail.upperlimit !== null && detail.upperlimit !== null &&
detail.upperlimit !== undefined && detail.upperlimit !== undefined &&
detail.upperlimit !== "" && detail.upperlimit !== "" &&
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
:on-format-error="handleFormatError" :on-format-error="handleFormatError"
:on-success="handleSuccess" :on-success="handleSuccess"
:on-error="handleError" :on-error="handleError"
:format="['xlsx']" :format="['xlsx','xls']"
> >
<Button <Button
type="primary" type="primary"
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
:on-format-error="handleFormatError" :on-format-error="handleFormatError"
:on-success="handleSuccess" :on-success="handleSuccess"
:on-error="handleError" :on-error="handleError"
:format="['xlsx']" :format="['xlsx','xls']"
> >
<Button <Button
type="primary" type="primary"
......
...@@ -28,8 +28,11 @@ namespace Siger.ApiACC.Controllers ...@@ -28,8 +28,11 @@ namespace Siger.ApiACC.Controllers
private readonly IAutomationMachineStatus _automationMachineStatus; private readonly IAutomationMachineStatus _automationMachineStatus;
private readonly ISigerProjectMachineAttributionRepository _sigerProjectMachineAttribution; private readonly ISigerProjectMachineAttributionRepository _sigerProjectMachineAttribution;
private readonly IAutomationTaskListRepository _automationTaskList; private readonly IAutomationTaskListRepository _automationTaskList;
private readonly IProductPlanDetails _planDetails;
private readonly IProductPlanRepository _productPlan;
public AutomationOperateController(IUnitOfWork unitOfWork,ISigerProjectLevelSectionRepository sigerProjectLevelSection , ISigerDict sigerDict,IAutomationMachineStatus automationMachineStatus,ISigerProjectMachineAttributionRepository sigerProjectMachineAttribution,IAutomationTaskListRepository automationTaskList) public AutomationOperateController(IUnitOfWork unitOfWork,ISigerProjectLevelSectionRepository sigerProjectLevelSection , ISigerDict sigerDict,IAutomationMachineStatus automationMachineStatus,ISigerProjectMachineAttributionRepository sigerProjectMachineAttribution,IAutomationTaskListRepository automationTaskList,
IProductPlanDetails planDetails,IProductPlanRepository productPlan)
{ {
_unitOfWork = unitOfWork; _unitOfWork = unitOfWork;
_sigerProjectLevelSection = sigerProjectLevelSection; _sigerProjectLevelSection = sigerProjectLevelSection;
...@@ -37,6 +40,8 @@ namespace Siger.ApiACC.Controllers ...@@ -37,6 +40,8 @@ namespace Siger.ApiACC.Controllers
_automationMachineStatus = automationMachineStatus; _automationMachineStatus = automationMachineStatus;
_sigerProjectMachineAttribution = sigerProjectMachineAttribution; _sigerProjectMachineAttribution = sigerProjectMachineAttribution;
_automationTaskList = automationTaskList; _automationTaskList = automationTaskList;
_planDetails = planDetails;
_productPlan = productPlan;
} }
/// <summary> /// <summary>
...@@ -163,7 +168,20 @@ namespace Siger.ApiACC.Controllers ...@@ -163,7 +168,20 @@ namespace Siger.ApiACC.Controllers
{ {
throw new BadRequestException(AccEnum.TaskProcessing); throw new BadRequestException(AccEnum.TaskProcessing);
} }
var plandts = _planDetails.Get(f => f.projectId == ProjectId && f.OrderNumber == loading.code);
if (plandts==null)
{
throw new BadRequestException(CncEnum.PlanHasExist);
}
var plan = _productPlan.Get(f => f.id == plandts.PlanId);
if (plan == null)
{
throw new BadRequestException(CncEnum.PlanHasExist);
}
var taskNo = _automationTaskList.CrateTaskNumber(Automation.TaskTrigerType.Manual); var taskNo = _automationTaskList.CrateTaskNumber(Automation.TaskTrigerType.Manual);
var sn = _automationTaskList.CreateRandonSn(plan.product_code);
_automationTaskList.Insert(new siger_automation_task_list _automationTaskList.Insert(new siger_automation_task_list
{ {
...@@ -180,6 +198,9 @@ namespace Siger.ApiACC.Controllers ...@@ -180,6 +198,9 @@ namespace Siger.ApiACC.Controllers
completetime=DateTime.MinValue, completetime=DateTime.MinValue,
trigger= Automation.TaskTrigerType.Manual, trigger= Automation.TaskTrigerType.Manual,
projectId=ProjectId, projectId=ProjectId,
productid=plan.product_id,
sn=sn,
ordercode=plandts.OrderNumber,
remark="手动任务", remark="手动任务",
}); });
......
...@@ -15,6 +15,7 @@ namespace Siger.Middlelayer.Common.Helpers ...@@ -15,6 +15,7 @@ namespace Siger.Middlelayer.Common.Helpers
public const string DateTimeFormatYmd = "yyyyMMdd"; public const string DateTimeFormatYmd = "yyyyMMdd";
public const string TimeFormat = "HH:mm:ss"; public const string TimeFormat = "HH:mm:ss";
public const string DateTimeFormatYYmmdd = "yyMMdd";
/// <summary> /// <summary>
/// unix time to date-->yyyyMMdd /// unix time to date-->yyyyMMdd
......
...@@ -165,5 +165,7 @@ namespace Siger.Middlelayer.AccRepository ...@@ -165,5 +165,7 @@ namespace Siger.Middlelayer.AccRepository
public DbSet<siger_automation_machine_status> siger_automation_machine_status { get; set; } public DbSet<siger_automation_machine_status> siger_automation_machine_status { get; set; }
public DbSet<siger_automation_produce_history> siger_automation_produce_history { get; set; } public DbSet<siger_automation_produce_history> siger_automation_produce_history { get; set; }
public DbSet<siger_automation_fixture_tools_monitor> siger_automation_fixture_tools_moniter { get; set; }
} }
} }
using System;
using System.Collections.Generic;
using System.Text;
namespace Siger.Middlelayer.AccRepository.Entities
{
public class siger_automation_fixture_tools_monitor:AccEntityBase
{
/// <summary>
/// 工装ID
/// </summary>
public int fixtureId { get; set; }
/// <summary>
/// 当前工站ID
/// </summary>
public int section { get; set; }
/// <summary>
/// 当前Sn
/// </summary>
public string sn { get; set; }
/// <summary>
/// 工序ID
/// </summary>
public int route { get; set; }
/// <summary>
/// 工序描述
/// </summary>
public string routedesc { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime createtime { get; set; }
/// <summary>
/// 更新时间
/// </summary>
public DateTime updatetime { get; set; }
}
}
...@@ -26,7 +26,7 @@ namespace Siger.Middlelayer.AccRepository.Entities ...@@ -26,7 +26,7 @@ namespace Siger.Middlelayer.AccRepository.Entities
/// <summary> /// <summary>
/// 工件ID /// 工件ID
/// </summary> /// </summary>
public int materialid { get; set; } public string sn { get; set; }
/// <summary> /// <summary>
/// 工单号 /// 工单号
/// </summary> /// </summary>
......
using Siger.Middlelayer.AccRepository.Entities;
using Siger.Middlelayer.AccRepository.Repositories.Interface;
using System;
using System.Collections.Generic;
using System.Text;
namespace Siger.Middlelayer.AccRepository.Repositories
{
internal class AutomationFixtureMonitor : AccRepositoryBase<siger_automation_fixture_tools_monitor>, IAutomationFixtureMonitor
{
public AutomationFixtureMonitor(ApiAccDbContext context) : base(context)
{
}
}
}
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
using System.Linq; using System.Linq;
using System.Linq.Expressions; using System.Linq.Expressions;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime;
using Siger.Middlelayer.AccRepository.Entities; using Siger.Middlelayer.AccRepository.Entities;
using Siger.Middlelayer.AccRepository.Repositories.Interface; using Siger.Middlelayer.AccRepository.Repositories.Interface;
using Siger.Middlelayer.Common.Helpers; using Siger.Middlelayer.Common.Helpers;
...@@ -45,5 +46,14 @@ namespace Siger.Middlelayer.AccRepository.Repositories ...@@ -45,5 +46,14 @@ namespace Siger.Middlelayer.AccRepository.Repositories
return $"M{radon}T{lable}"; return $"M{radon}T{lable}";
} }
} }
public string CreateRandonSn(string productCode)
{
var date = DateTime.Now;
var serinum = date.DayOfYear+date.Hour + date.Minute + date.Second + date.Millisecond;
var randon = new Random().Next(1000, 9999);
return $"{productCode}{date.ToString(UnixTimeHelper.DateTimeFormatYmd)}{serinum}{randon}";
}
} }
} }
using Siger.Middlelayer.AccRepository.Entities;
using System;
using System.Collections.Generic;
using System.Text;
namespace Siger.Middlelayer.AccRepository.Repositories.Interface
{
public interface IAutomationFixtureMonitor : IAccRepositoryBase<siger_automation_fixture_tools_monitor>
{
}
}
...@@ -16,5 +16,11 @@ namespace Siger.Middlelayer.AccRepository.Repositories.Interface ...@@ -16,5 +16,11 @@ namespace Siger.Middlelayer.AccRepository.Repositories.Interface
/// <param name="section"></param> /// <param name="section"></param>
/// <returns></returns> /// <returns></returns>
bool CanTask(int projectId,int section); bool CanTask(int projectId,int section);
/// <summary>
/// 创建随机工件号码 SN
/// </summary>
/// <returns></returns>
string CreateRandonSn(string productCode);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment