Commit d4f8c6cb by yiyu.li

标准节拍-工序修改

parent 5ce97470
<template> <template>
<div class="testdiv"> <div class="testdiv">
<div class="divborder newSearchDiv" style="margin:0px;"> <div class="divborder newSearchDiv" style="margin: 0px">
<div class="filter">
<label>{{$t('1132')}}</label>
<Cascader
:data="datalevel"
:value="leveldata"
trigger="click"
change-on-select
class="searchSelect"
@on-change="getlevel"
style="width:220px"
></Cascader>
</div>
<div class="filter">
<label>{{$t('100088')}}</label>
<Input class="searchSelect" type="text" v-model="productname" />
</div>
<div class="filter">
<label>{{$t('100090')}}</label>
<Input class="searchSelect" type="text" v-model="drawcode" />
</div>
<div class="searchBtn">
<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="warning" class="twoWord" icon="ios-build" @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>
<Upload
style="display:inline-block"
ref="upload"
:action="action"
name="excel-file"
:headers="headers"
:show-upload-list="false"
:on-format-error="handleFormatError"
:on-success="handleSuccess"
:on-error="handleError"
:format="['xlsx']"
>
<Button type="primary" class="fourWord" icon="md-cloud-upload">{{$t('1006')}}</Button>
</Upload>
</div>
</div>
<div class="divborder newTableDiv">
<Table
class="tableClass"
@on-current-change="handleRowChange"
highlight-row
:data="tableData1"
@on-selection-change="handleSelectRow"
:columns="tableColumns1"
></Table>
<div class="pageDiv">
<div class="pageDirection">
<Page
:total="total"
:current="page"
@on-change="changePage"
show-elevator
show-sizer
show-total
@on-page-size-change="handlePageSize"
:page-size-opts="[10,20,30,40,100]"
></Page>
</div>
</div>
<Modal class="newModalClass" :title="$t('1002')" v-model="addmodal" :styles="{width:'700px'}">
<div class="modal_body" style="height:430px!important;">
<div style="width:280px;float:left;height:400px;overflow-y:scroll">
<template>
<Tree :data="treeContents" ref="tree" @on-select-change="getList()"></Tree>
</template>
</div>
<div style="width:360px;float:left;height:400px;padding-left:5px;">
<div class="filter">
<label>
<i>*</i>
{{this.$t('500107')}}:
</label>
<Input class="searchInput" type="text" v-model="addobj.program_number" />
</div>
<div class="filter">
<label>
<i>*</i>
{{this.$t('100088')}}:
</label>
<Select
v-model="addobj.product"
label-in-value
clearable
filterable
class="searchSelect"
>
<Option v-for="item in products" :value="item.id" :key="item.id">{{ item.name }}</Option>
</Select>
</div>
<div class="filter">
<label>
<i>*</i>
{{this.$t('900880')}}:
</label>
<Input class="searchInput" type="text" v-model="addobj.route_number" />
</div>
<div class="filter">
<label>
<i>*</i>
{{this.$t('900967')}}:
</label>
<Input class="searchInput" type="text" v-model="addobj.route_name" />
</div>
<div class="filter">
<label>
<i>*</i>
{{this.$t('500098')}}:
</label>
<InputNumber
:min="0"
class="searchInput"
type="number"
v-model="addobj.standard_besat"
onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))"
/>
<span>{{this.$t('1104')}}</span>
</div>
<div class="filter">
<label>
<i>*</i>
{{this.$t('500221')}}:
</label>
<InputNumber
:min="0"
class="searchInput"
type="number"
v-model="addobj.updown_besat"
onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))"
/>
<span>{{this.$t('1104')}}</span>
</div>
<div class="filter"> <div class="filter">
<label> <label>{{ $t("1132") }}</label>
<i>*</i> <Cascader
{{this.$t('800281')}}: :data="datalevel"
</label> :value="leveldata"
<InputNumber trigger="click"
:min="0" change-on-select
class="searchInput" class="searchSelect"
type="number" @on-change="getlevel"
v-model="addobj.daily_standard_output" style="width: 220px"
onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))" ></Cascader>
/>
<span>{{this.$t('901087')}}</span>
</div> </div>
<div class="filter"> <div class="filter">
<label>{{this.$t('810000')}}:</label> <label>{{ $t("100088") }}</label>
<InputNumber <Input class="searchSelect" type="text" v-model="productname" />
:min="0"
class="searchInput"
type="number"
v-model="addobj.time_num"
onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))"
/>
<span>{{this.$t('1104')}}</span>
</div> </div>
<div class="filter"> <div class="filter">
<label> <label>{{ $t("100090") }}</label>
<i>*</i> <Input class="searchSelect" type="text" v-model="drawcode" />
{{this.$t('950009')}}:
</label>
<InputNumber
:min="1"
class="searchInput"
type="number"
v-model="addobj.yieldrate"
value="1"
onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))"
/>
</div> </div>
<div class="filter"> <div class="searchBtn">
<label> <Button
<!-- <i>*</i> --> type="primary"
{{this.$t('1049')}}: class="twoWord"
</label> icon="ios-search"
<DatePicker type="date" v-model="addobj.start_time" class="searchInput"></DatePicker> @click="tosearch()"
</div> >{{ $t("1001") }}</Button
<div class="filter"> >
<label> <Button
<!-- <i>*</i> --> type="success"
{{this.$t('1050')}}: class="twoWord"
</label> icon="md-add-circle"
<DatePicker type="date" v-model="addobj.end_time" class="searchInput"></DatePicker> @click="add()"
>{{ $t("1002") }}</Button
>
<Button
type="warning"
class="twoWord"
icon="ios-build"
@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
>
<Upload
style="display: inline-block"
ref="upload"
:action="action"
name="excel-file"
:headers="headers"
:show-upload-list="false"
:on-format-error="handleFormatError"
:on-success="handleSuccess"
:on-error="handleError"
:format="['xlsx']"
>
<Button
type="primary"
class="fourWord"
icon="md-cloud-upload"
>{{ $t("1006") }}</Button
>
</Upload>
</div> </div>
</div>
</div> </div>
<div slot="footer"> <div class="divborder newTableDiv">
<Button type="text" size="large" @click="closeadd()">{{$t('1033')}}</Button> <Table
<Button type="primary" size="large" @click="adddata()">{{$t('1011')}}</Button> class="tableClass"
</div> @on-current-change="handleRowChange"
</Modal> highlight-row
<Modal :data="tableData1"
class="newModalClass" @on-selection-change="handleSelectRow"
:title="$t('1003')" :columns="tableColumns1"
v-model="editmodal" ></Table>
:styles="{width:'500px'}" <div class="pageDiv">
> <div class="pageDirection">
<div class="modal_body" style="height:400px!important;"> <Page
<div class="filter"> :total="total"
<label>{{this.$t('200003')}}:</label> :current="page"
<label class="labelInfo">{{sectionname}}</label> @on-change="changePage"
</div> show-elevator
<div class="filter"> show-sizer
<label>{{this.$t('500107')}}:</label> show-total
<label class="labelInfo">{{editobj.process_number}}</label> @on-page-size-change="handlePageSize"
</div> :page-size-opts="[10, 20, 30, 40, 100]"
<div class="filter"> ></Page>
<label>{{this.$t('100088')}}:</label> </div>
<label class="labelInfo">{{editobj.product_name_text}}</label> </div>
</div> <Modal
<div class="filter"> class="newModalClass"
<label>{{this.$t('900967')}}:</label> :title="$t('1002')"
<label class="labelInfo">{{editobj.route_name}}</label> v-model="addmodal"
</div> :styles="{ width: '700px' }"
<div class="filter"> >
<label>{{this.$t('900880')}}:</label> <div class="modal_body" style="height: 430px !important">
<label class="labelInfo">{{editobj.route_number}}</label> <div
</div> style="
<div class="filter"> width: 280px;
<label> float: left;
<i>*</i> height: 400px;
{{this.$t('500098')}}: overflow-y: scroll;
</label> "
<InputNumber >
:min="0" <template>
class="searchInput" <Tree
type="text" :data="treeContents"
v-model="editobj.standard_besat" ref="tree"
onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))" @on-select-change="getList()"
/> ></Tree>
<span>{{this.$t('1104')}}</span> </template>
</div> </div>
<div class="filter"> <div
<label> style="
<i>*</i> width: 360px;
{{this.$t('500221')}}: float: left;
</label> height: 400px;
<InputNumber padding-left: 5px;
:min="0" "
class="searchInput" >
type="text" <div class="filter">
v-model="editobj.updown_besat" <label>
onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))" <i>*</i>
/> {{ this.$t("500107") }}:
<span>{{this.$t('1104')}}</span> </label>
</div> <Input
<div class="filter"> class="searchInput"
<label> type="text"
<i>*</i> v-model="addobj.program_number"
{{this.$t('800281')}}: />
</label> </div>
<InputNumber <div class="filter">
:min="0" <label>
class="searchInput" <i>*</i>
type="text" {{ this.$t("100088") }}:
v-model="editobj.daily_standard_output" </label>
onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))" <Select
/> v-model="addobj.product"
<span>{{this.$t('901087')}}</span> label-in-value
</div> clearable
<div class="filter"> filterable
<label>{{this.$t('810000')}}:</label> class="searchSelect"
<InputNumber @on-change="getRoutesByProduct"
:min="0" >
class="searchInput" <Option
type="text" v-for="item in products"
v-model="editobj.time_num" :value="item.id"
onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))" :key="item.id"
/> >{{ item.name }}</Option
<span>{{this.$t('1104')}}</span> >
</div> </Select>
<div class="filter"> </div>
<label> <!-- <div class="filter">
<i>*</i> <label>
{{this.$t('950009')}}: <i>*</i>
</label> {{ this.$t("900880") }}:
<InputNumber </label>
:min="1" <Input
class="searchInput" class="searchInput"
type="text" type="text"
v-model="editobj.yieldrate" v-model="addobj.route_number"
value="1" />
onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))" </div> -->
/> <div class="filter">
</div> <label>
<div class="filter"> <i>*</i>
<label> {{ this.$t("900967") }}:
<!-- <i>*</i> --> </label>
{{this.$t('1049')}}: <!-- <Input
</label> class="searchInput"
<DatePicker type="date" v-model="editobj.start_time" class="searchInput"></DatePicker> type="text"
</div> v-model="addobj.route_name"
<div class="filter"> /> -->
<label> <Select
<!-- <i>*</i> --> v-model="addobj.route_id"
{{this.$t('1050')}}: label-in-value
</label> clearable
<DatePicker type="date" v-model="editobj.end_time" class="searchInput"></DatePicker> filterable
</div> class="searchSelect"
</div> >
<div slot="footer"> <Option
<Button type="text" size="large" @click="closeedit()">{{$t('1033')}}</Button> v-for="item in routeList"
<Button type="primary" size="large" @click="editdata()">{{$t('1011')}}</Button> :value="item.id"
:key="item.id"
>{{ item.serialnumber+'-'+item.name }}</Option
>
</Select>
</div>
<div class="filter">
<label>
<i>*</i>
{{ this.$t("500098") }}:
</label>
<InputNumber
:min="0"
class="searchInput"
type="number"
v-model="addobj.standard_besat"
onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))"
/>
<span>{{ this.$t("1104") }}</span>
</div>
<div class="filter">
<label>
<i>*</i>
{{ this.$t("500221") }}:
</label>
<InputNumber
:min="0"
class="searchInput"
type="number"
v-model="addobj.updown_besat"
onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))"
/>
<span>{{ this.$t("1104") }}</span>
</div>
<div class="filter">
<label>
<i>*</i>
{{ this.$t("800281") }}:
</label>
<InputNumber
:min="0"
class="searchInput"
type="number"
v-model="addobj.daily_standard_output"
onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))"
/>
<span>{{ this.$t("901087") }}</span>
</div>
<div class="filter">
<label>{{ this.$t("810000") }}:</label>
<InputNumber
:min="0"
class="searchInput"
type="number"
v-model="addobj.time_num"
onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))"
/>
<span>{{ this.$t("1104") }}</span>
</div>
<div class="filter">
<label>
<i>*</i>
{{ this.$t("950009") }}:
</label>
<InputNumber
:min="1"
class="searchInput"
type="number"
v-model="addobj.yieldrate"
value="1"
onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))"
/>
</div>
<div class="filter">
<label>
<!-- <i>*</i> -->
{{ this.$t("1049") }}:
</label>
<DatePicker
type="date"
v-model="addobj.start_time"
class="searchInput"
></DatePicker>
</div>
<div class="filter">
<label>
<!-- <i>*</i> -->
{{ this.$t("1050") }}:
</label>
<DatePicker
type="date"
v-model="addobj.end_time"
class="searchInput"
></DatePicker>
</div>
</div>
</div>
<div slot="footer">
<Button type="text" size="large" @click="closeadd()">{{
$t("1033")
}}</Button>
<Button type="primary" size="large" @click="adddata()">{{
$t("1011")
}}</Button>
</div>
</Modal>
<Modal
class="newModalClass"
:title="$t('1003')"
v-model="editmodal"
:styles="{ width: '500px' }"
>
<div class="modal_body" style="height: 400px !important">
<div class="filter">
<label>{{ this.$t("200003") }}:</label>
<label class="labelInfo">{{ sectionname }}</label>
</div>
<div class="filter">
<label>{{ this.$t("500107") }}:</label>
<label class="labelInfo">{{
editobj.process_number
}}</label>
</div>
<div class="filter">
<label>{{ this.$t("100088") }}:</label>
<label class="labelInfo">{{
editobj.product_name_text
}}</label>
</div>
<div class="filter">
<label>{{ this.$t("900967") }}:</label>
<label class="labelInfo">{{
editobj.route_name
}}</label>
</div>
<div class="filter">
<label>{{ this.$t("900880") }}:</label>
<label class="labelInfo">{{
editobj.route_number
}}</label>
</div>
<div class="filter">
<label>
<i>*</i>
{{ this.$t("500098") }}:
</label>
<InputNumber
:min="0"
class="searchInput"
type="text"
v-model="editobj.standard_besat"
onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))"
/>
<span>{{ this.$t("1104") }}</span>
</div>
<div class="filter">
<label>
<i>*</i>
{{ this.$t("500221") }}:
</label>
<InputNumber
:min="0"
class="searchInput"
type="text"
v-model="editobj.updown_besat"
onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))"
/>
<span>{{ this.$t("1104") }}</span>
</div>
<div class="filter">
<label>
<i>*</i>
{{ this.$t("800281") }}:
</label>
<InputNumber
:min="0"
class="searchInput"
type="text"
v-model="editobj.daily_standard_output"
onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))"
/>
<span>{{ this.$t("901087") }}</span>
</div>
<div class="filter">
<label>{{ this.$t("810000") }}:</label>
<InputNumber
:min="0"
class="searchInput"
type="text"
v-model="editobj.time_num"
onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))"
/>
<span>{{ this.$t("1104") }}</span>
</div>
<div class="filter">
<label>
<i>*</i>
{{ this.$t("950009") }}:
</label>
<InputNumber
:min="1"
class="searchInput"
type="text"
v-model="editobj.yieldrate"
value="1"
onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))"
/>
</div>
<div class="filter">
<label>
<!-- <i>*</i> -->
{{ this.$t("1049") }}:
</label>
<DatePicker
type="date"
v-model="editobj.start_time"
class="searchInput"
></DatePicker>
</div>
<div class="filter">
<label>
<!-- <i>*</i> -->
{{ this.$t("1050") }}:
</label>
<DatePicker
type="date"
v-model="editobj.end_time"
class="searchInput"
></DatePicker>
</div>
</div>
<div slot="footer">
<Button type="text" size="large" @click="closeedit()">{{
$t("1033")
}}</Button>
<Button type="primary" size="large" @click="editdata()">{{
$t("1011")
}}</Button>
</div>
</Modal>
</div> </div>
</Modal>
</div> </div>
</div>
</template> </template>
<script> <script>
import axios from "@/libs/api.request"; import axios from "@/libs/api.request";
export default { export default {
name: "producetime", // 组件不刷新 name: "producetime", // 组件不刷新
data() { data() {
return { return {
action: action:
axios.publicPath + "cnc/upload/submit?templateName=BeatAllocation", axios.publicPath +
headers: { "cnc/upload/submit?templateName=BeatAllocation",
token: localStorage.getItem("token"), headers: {
timestamp: localStorage.getItem("timestamp"), token: localStorage.getItem("token"),
nonce: localStorage.getItem("nonce"), timestamp: localStorage.getItem("timestamp"),
sign: localStorage.getItem("sign"), nonce: localStorage.getItem("nonce"),
}, sign: localStorage.getItem("sign"),
leveldata: [], // 产线层级集合 },
levelid: 0, // 产线层级id leveldata: [], // 产线层级集合
datalevel: [], levelid: 0, // 产线层级id
tableData1: [], datalevel: [],
total: 0, tableData1: [],
page: 1, total: 0,
pagesize: 10, page: 1,
addmodal: false, pagesize: 10,
detailobj: {}, addmodal: false,
editmodal: false, detailobj: {},
addobj: {}, editmodal: false,
editobj: {}, addobj: {},
selectids: "", editobj: {},
treeContents: [], selectids: "",
timetype: "time", treeContents: [],
sectionId: "", timetype: "time",
sectionname: "", sectionId: "",
productname: "", sectionname: "",
drawcode: "", productname: "",
products: [], drawcode: "",
machineId: 0, products: [],
map: { routeList:[], //工序列表
value: "value", machineId: 0,
label: "label", map: {
children: "children", value: "value",
expand: true, label: "label",
selected: false, children: "children",
}, expand: true,
tableColumns1: [ selected: false,
{ },
type: "selection", tableColumns1: [
width: 50, {
align: "center", type: "selection",
}, width: 50,
{ align: "center",
type: "index2", },
title: this.$t("1008"), {
key: "xuhao", type: "index2",
render: (h, params) => { title: this.$t("1008"),
return h( key: "xuhao",
"span", render: (h, params) => {
params.index + (this.page - 1) * this.pagesize + 1 return h(
"span",
params.index + (this.page - 1) * this.pagesize + 1
);
},
width: "60px",
},
{
title: this.$t("900868"),
key: "stationName",
width: "120px",
},
{
title: this.$t("800278"),
key: "sectionName",
width: "120px",
},
{
title: this.$t("800279"),
key: "process_number",
width: "100px",
},
{
title: this.$t("100088"),
key: "product_name_text",
},
{
title: this.$t("600567"),
key: "drawing_number",
},
{
title: this.$t("900967"),
key: "routeName",
},
{
title: this.$t("500135"),
key: "standard_besat",
width: 150,
},
{
title: this.$t("500223"),
key: "updown_besat",
width: 150,
},
{
title: this.$t("900869"),
key: "daily_standard_output",
width: 150,
},
{
title: this.$t("900870"),
key: "time_num",
width: 150,
},
{
title: this.$t("950009"),
key: "yieldrate",
},
],
};
},
created() {
this.initlevel();
// this.tosearch();
// 格式化表格样式
this.tableColumns1 = this.$time.initTableTitle(this.tableColumns1);
},
methods: {
handleFormatError(file) {
this.$Message.error(
this.$t("950396") + file.name + this.$t("950397")
); );
},
width: "60px",
}, },
{ handleSuccess(res, file) {
title: this.$t("900868"), if (res.ret == 1) {
key: "stationName", this.$Message.success(this.$t("950398"));
width: "120px", this.search(this.page, this.pagesize);
} else {
if ((res.msg + "").indexOf(",") != -1) {
this.page = 1;
this.search(this.page, this.pagesize);
inittip(res.msg);
} else {
this.$Message.error(this.$t(res.msg));
}
}
}, },
{ handleError() {
title: this.$t("800278"), this.$Message.error(this.$t("2010006") + "!");
key: "sectionName",
width: "120px",
}, },
{ // 产线层级
title: this.$t("800279"), initlevel() {
key: "process_number", axios
width: "100px", .request({
url: "config/ProjectLevelSection/GetSectionTree",
method: "get",
})
.then((res) => {
const arr = [];
this.datalevel = res.data.data;
let sdata = res.data.data;
if (
sdata != null &&
sdata != undefined &&
sdata &&
sdata.length > 0
) {
arr.push(res.data.data[0].value);
this.levelid = res.data.data[0].value;
}
this.leveldata = arr;
this.tosearch();
});
}, },
{ getproduct() {
title: this.$t("100088"), axios
key: "product_name_text", .request({
url:
"/config/ProjectProduct/GetProductsByCode?code=&name=&count=99",
method: "get",
})
.then((res) => {
this.products = res.data.data;
});
}, },
{ getRoutesByProduct(val) {
title: this.$t("600567"), // 选择产品查询工艺路径
key: "drawing_number", let id = 0;
id = val.value?val.value:0;
var params = {
productId: id,
page: 1,
pagesize: 100,
};
axios
.request({
url: "/config/ProductRoute/GetPagedRoutes",
params,
method: "get",
})
.then((res) => {
if (res.data.ret == 1) {
this.routeList = res.data.data;
}
});
}, },
{ // 产线层级选择
title: this.$t("900967"), getlevel: function (data) {
key: "routeName", this.levelid = data[data.length - 1];
}, },
{ tosearch() {
title: this.$t("500135"), this.page = 1;
key: "standard_besat", this.pageszie = 10;
width: 150, this.search();
}, },
{ search() {
title: this.$t("500223"), var params = {
key: "updown_besat", sectionID: this.levelid,
width: 150, product_name_text: this.productname,
drawing_number: this.drawcode,
page: this.page,
pagesize: this.pagesize,
};
this.detailobj = {};
this.selectids = [];
axios
.request({
url: "/cnc/BeatAllocation/ShowBeatAllocation",
params,
method: "get",
})
.then((res) => {
this.total = res.data.total;
this.mockTableData1(res.data.data);
});
}, },
{ mockTableData1(tablelist) {
title: this.$t("900869"), let data = [];
key: "daily_standard_output", tablelist.forEach((item) => {
width: 150, if (item) {
data.push({
stationName: item.stationName,
sectionName: item.sectionName,
process_number: item.process_number,
product_name_text: item.product_name_text,
drawing_number: item.drawing_number,
routeName: item.routeName,
route_number: item.route_number,
standard_besat: item.standard_besat,
updown_besat: item.updown_besat,
daily_standard_output: item.daily_standard_output,
time_num: item.time_num,
yieldrate: item.yieldrate,
machineID: item.machineID,
start_time: item.start_time,
end_time: item.end_time,
id: item.id,
});
}
});
this.tableData1 = data;
}, },
{ handleSelectRow: function (data) {
title: this.$t("900870"), var ids = [];
key: "time_num", for (var i in data) {
width: 150, ids.push(data[i].id);
}
this.selectids = ids;
}, },
{ handleRowChange(currentRow, oldCurrentRow) {
title: this.$t("950009"), this.detailobj = currentRow;
key: "yieldrate",
}, },
], handlePageSize(value) {
}; this.pagesize = value;
}, this.search();
created() { },
this.initlevel(); changePage(value) {
// this.tosearch(); this.page = value;
// 格式化表格样式 this.search();
this.tableColumns1 = this.$time.initTableTitle(this.tableColumns1); },
}, add() {
methods: { this.addmodal = true;
handleFormatError(file) { this.addobj = {
this.$Message.error(this.$t("950396") + file.name + this.$t("950397")); program_number: "",
}, product: "",
handleSuccess(res, file) { route_number: "",
if (res.ret == 1) { route_name: "",
this.$Message.success(this.$t("950398")); standard_besat: 0,
this.search(this.page, this.pagesize); updown_besat: 0,
} else { daily_standard_output: 0,
if ((res.msg + "").indexOf(",") != -1) { time_num: 0,
this.page = 1; yieldrate: 1,
this.search(this.page, this.pagesize); start_time: "",
inittip(res.msg); end_time: "",
} else { };
this.$Message.error(this.$t(res.msg)); this.sectionId = "";
} this.machineId = 0;
} this.inittree();
}, this.getproduct();
handleError() { },
this.$Message.error(this.$t("2010006") + "!"); inittree() {
},
// 产线层级
initlevel() {
axios
.request({
url: "config/ProjectLevelSection/GetSectionTree",
method: "get",
})
.then((res) => {
const arr = [];
this.datalevel = res.data.data;
let sdata = res.data.data
if(sdata!=null&&sdata!=undefined&&sdata&&sdata.length >0){
arr.push(res.data.data[0].value)
this.levelid = res.data.data[0].value;
}
this.leveldata = arr;
this.tosearch();
});
},
getproduct() {
axios
.request({
url: "/config/ProjectProduct/GetProductsByCode?code=&name=&count=99",
method: "get",
})
.then((res) => {
this.products = res.data.data;
});
},
// 产线层级选择
getlevel: function (data) {
this.levelid = data[data.length - 1];
},
tosearch() {
this.page = 1;
this.pageszie = 10;
this.search();
},
search() {
var params = {
sectionID: this.levelid,
product_name_text: this.productname,
drawing_number: this.drawcode,
page: this.page,
pagesize: this.pagesize,
};
this.detailobj = {};
this.selectids = [];
axios
.request({
url: "/cnc/BeatAllocation/ShowBeatAllocation",
params,
method: "get",
})
.then((res) => {
this.total = res.data.total;
this.mockTableData1(res.data.data);
});
},
mockTableData1(tablelist) {
let data = [];
tablelist.forEach((item) => {
if (item) {
data.push({
stationName: item.stationName,
sectionName: item.sectionName,
process_number: item.process_number,
product_name_text: item.product_name_text,
drawing_number: item.drawing_number,
routeName: item.routeName,
route_number: item.route_number,
standard_besat: item.standard_besat,
updown_besat: item.updown_besat,
daily_standard_output: item.daily_standard_output,
time_num: item.time_num,
yieldrate: item.yieldrate,
machineID: item.machineID,
start_time: item.start_time,
end_time: item.end_time,
id: item.id,
});
}
});
this.tableData1 = data;
},
handleSelectRow: function (data) {
var ids = [];
for (var i in data) {
ids.push(data[i].id);
}
this.selectids = ids;
},
handleRowChange(currentRow, oldCurrentRow) {
this.detailobj = currentRow;
},
handlePageSize(value) {
this.pagesize = value;
this.search();
},
changePage(value) {
this.page = value;
this.search();
},
add() {
this.addmodal = true;
this.addobj = {
program_number: "",
product: "",
route_number: "",
route_name: "",
standard_besat: 0,
updown_besat: 0,
daily_standard_output: 0,
time_num: 0,
yieldrate: 1,
start_time: "",
end_time: "",
};
this.sectionId = "";
this.machineId = 0;
this.inittree();
this.getproduct();
},
inittree() {
axios
.request({
url: "/config/ProjectLevelSection/GetSectionTree",
method: "get",
})
.then((res) => {
if (res.data.ret == 1) {
this.treeContents = res.data.data;
this.contentTree(this.treeContents);
} else {
this.$Message.error(this.$t(res.data.msg));
}
});
},
// 树形数据转换
contentTree(arr) {
arr.forEach((ele) => {
ele.title = ele.label;
ele.expand = true;
if (
ele.children.length != 0 &&
ele.children != undefined &&
ele.children != null
) {
this.contentTree(ele.children);
}
});
},
// 获取树id
getList() {
let node = this.$refs.tree.getSelectedNodes();
if (node.length > 0) {
if (node[0].children && node[0].children.length > 0) {
this.$Message.error("请选择具体工位");
} else {
// this.machine = node[0].title;
this.sectionId = node[0].value;
this.getmachine();
}
}
},
getmachine() {
axios
.request({
url: "/config/Machine/GetmachineidBySection?id=" + this.sectionId,
method: "get",
})
.then((res) => {
if (res.data.ret === 1) {
this.machineId = res.data.data.machine_id;
}
});
},
closeadd() {
this.addmodal = false;
},
adddata() {
if (this.sectionId === "" || this.sectionId === undefined) {
this.$Message.error(this.$t(1052));
return false;
}
if (this.machineId === 0) {
this.$Message.error(this.$t(100177));
return false;
}
// 验证非空
if (
this.addobj.program_number === "" ||
this.addobj.program_number === undefined
) {
this.$Message.error(this.$t(800291));
return false;
}
if (this.addobj.product === "" || this.addobj.product === undefined) {
this.$Message.error(this.$t("100064"));
return false;
}
if (
this.addobj.route_number == "" ||
this.addobj.route_number == undefined
) {
this.$Message.error(this.$t(666620));
return false;
}
if (
this.addobj.route_name === "" ||
this.addobj.route_name === undefined
) {
this.$Message.error(this.$t("901088"));
return false;
}
if (
this.addobj.standard_besat === "" ||
this.addobj.standard_besat === undefined ||
this.addobj.standard_besat === 0
) {
this.$Message.error(this.$t("800294"));
return false;
}
if (
this.addobj.updown_besat === "" ||
this.addobj.updown_besat === undefined ||
this.addobj.updown_besat === 0
) {
this.$Message.error(this.$t("500222"));
return false;
}
if (
this.addobj.daily_standard_output === "" ||
this.addobj.daily_standard_output === undefined ||
this.addobj.daily_standard_output === 0
) {
this.$Message.error(this.$t("800295"));
return false;
}
if (
this.addobj.yieldrate === "" ||
this.addobj.yieldrate === undefined ||
this.addobj.yieldrate === 0
) {
this.$Message.error(this.$t("950156"));
return false;
}
// if (
// this.addobj.start_time === "" ||
// this.addobj.start_time === undefined
// ) {
// this.$Message.error(this.$t("9000127"));
// return false;
// }
// if (this.addobj.end_time === "" || this.addobj.end_time === undefined) {
// this.$Message.error(this.$t("9000128"));
// return false;
// }
if (this.addobj.start_time && this.addobj.end_time && this.addobj.start_time > this.addobj.end_time) {
this.$Message.error(this.$t("100218"));
return false;
}
let data = {
sectionid: this.sectionId,
machineid: this.machineId,
program_number: this.addobj.program_number,
product_name_text: "",
product_name: this.addobj.product,
drawing_number: "",
standard_besat: this.addobj.standard_besat,
daily_standard_output: this.addobj.daily_standard_output,
time_num: this.addobj.time_num,
route_name: this.addobj.route_name,
route_number: this.addobj.route_number,
updown_besat: this.addobj.updown_besat, // 上下料节拍
yieldratio: this.addobj.yieldrate, // 产量系数
start_time: this.addobj.start_time,
end_time: this.addobj.end_time,
};
axios
.request({
url: "/cnc/BeatAllocation/AddBeatAllocation",
data,
method: "post",
})
.then((res) => {
if (res.data.ret === 1) {
this.$Message.success(this.$t("1055"));
this.addmodal = false;
this.tosearch();
} else {
this.$Message.error(this.$t(res.data.msg));
}
});
},
dele() {
if (
this.selectids === undefined ||
this.selectids === "" ||
this.selectids === []
) {
this.$Message.error(this.$t("1017"));
return false;
} else {
let data = {
ids: this.selectids,
};
this.$Modal.confirm({
title: this.$t("1018"),
content: "",
width: "290px",
closable: true,
okText: this.$t("1004"),
onOk: () => {
axios axios
.request({ .request({
url: "/cnc/BeatAllocation/DeleteMultipleBeats", url: "/config/ProjectLevelSection/GetSectionTree",
data, method: "get",
method: "post", })
}) .then((res) => {
.then((res) => { if (res.data.ret == 1) {
if (res.data.ret === 1) { this.treeContents = res.data.data;
this.$Message.success(this.$t("1058")); this.contentTree(this.treeContents);
this.tosearch(); } else {
this.detailobj = {}; this.$Message.error(this.$t(res.data.msg));
}
});
},
// 树形数据转换
contentTree(arr) {
arr.forEach((ele) => {
ele.title = ele.label;
ele.expand = true;
if (
ele.children.length != 0 &&
ele.children != undefined &&
ele.children != null
) {
this.contentTree(ele.children);
}
});
},
// 获取树id
getList() {
let node = this.$refs.tree.getSelectedNodes();
if (node.length > 0) {
if (node[0].children && node[0].children.length > 0) {
this.$Message.error("请选择具体工位");
} else { } else {
this.$Message.error(this.$t(res.data.msg)); // this.machine = node[0].title;
this.sectionId = node[0].value;
this.getmachine();
} }
}); }
}, },
}); getmachine() {
} axios
}, .request({
edit() { url:
if (this.detailobj === undefined || this.detailobj.id === undefined) { "/config/Machine/GetmachineidBySection?id=" +
this.$Message.error(this.$t("1017")); this.sectionId,
return false; method: "get",
} })
this.sectionname = this.detailobj.stationName; .then((res) => {
this.sectionId = this.detailobj.section_id; if (res.data.ret === 1) {
this.machineId = this.detailobj.machineID; this.machineId = res.data.data.machine_id;
this.editobj.route_number = this.detailobj.route_number; }
this.editobj.process_number = this.detailobj.process_number; });
this.editobj.product_name_text = this.detailobj.product_name_text; },
this.editobj.standard_besat = this.detailobj.standard_besat; closeadd() {
this.editobj.daily_standard_output = this.detailobj.daily_standard_output; this.addmodal = false;
this.editobj.time_num = this.detailobj.time_num; },
this.editobj.route_name = this.detailobj.routeName; adddata() {
this.editobj.updown_besat = this.detailobj.updown_besat; if (this.sectionId === "" || this.sectionId === undefined) {
this.editobj.yieldrate = this.detailobj.yieldrate; this.$Message.error(this.$t(1052));
this.editobj.start_time = this.detailobj.start_time; return false;
this.editobj.end_time = this.detailobj.end_time; }
this.editmodal = true; if (this.machineId === 0) {
}, this.$Message.error(this.$t(100177));
editdata() { return false;
// 验证非空 }
if ( // 验证非空
this.editobj.standard_besat === "" || if (
this.editobj.standard_besat === undefined || this.addobj.program_number === "" ||
this.editobj.standard_besat === 0 this.addobj.program_number === undefined
) { ) {
this.$Message.error(this.$t("800294")); this.$Message.error(this.$t(800291));
return false; return false;
} }
if ( if (
this.editobj.updown_besat === "" || this.addobj.product === "" ||
this.editobj.updown_besat === undefined this.addobj.product === undefined
) { ) {
this.$Message.error(this.$t("500222")); this.$Message.error(this.$t("100064"));
return false; return false;
} }
if ( // if (
this.editobj.daily_standard_output === "" || // this.addobj.route_number == "" ||
this.editobj.daily_standard_output === undefined || // this.addobj.route_number == undefined
this.editobj.daily_standard_output === 0 // ) {
) { // this.$Message.error(this.$t(666620));
this.$Message.error(this.$t("800295")); // return false;
return false; // }
} if (
if ( this.addobj.route_id === "" ||
this.editobj.yieldrate === "" || this.addobj.route_id === undefined || this.addobj.route_id === 0
this.editobj.yieldrate === undefined || ) {
this.editobj.yieldrate === 0 this.$Message.error(this.$t("901088"));
) { return false;
this.$Message.error(this.$t("950156")); }
return false; if (
} this.addobj.standard_besat === "" ||
// if ( this.addobj.standard_besat === undefined ||
// this.editobj.start_time === "" || this.addobj.standard_besat === 0
// this.editobj.start_time === undefined ) {
// ) { this.$Message.error(this.$t("800294"));
// this.$Message.error(this.$t("9000127")); return false;
// return false; }
// }
// if (this.editobj.end_time === "" || this.editobj.end_time === undefined) { if (
// this.$Message.error(this.$t("9000128")); this.addobj.updown_besat === "" ||
// return false; this.addobj.updown_besat === undefined ||
// } this.addobj.updown_besat === 0
if (this.editobj.start_time && this.editobj.end_time && this.editobj.start_time > this.editobj.end_time) { ) {
this.$Message.error(this.$t("100218")); this.$Message.error(this.$t("500222"));
return false; return false;
} }
let data = { if (
sectionid: this.sectionId, this.addobj.daily_standard_output === "" ||
machineid: this.machineId, this.addobj.daily_standard_output === undefined ||
standard_besat: this.editobj.standard_besat, this.addobj.daily_standard_output === 0
daily_standard_output: this.editobj.daily_standard_output, ) {
time_num: this.editobj.time_num, this.$Message.error(this.$t("800295"));
updown_besat: this.editobj.updown_besat, // 上下料节拍 return false;
yieldratio: this.editobj.yieldrate, // 产量系数 }
start_time: this.editobj.start_time, if (
end_time: this.editobj.end_time, this.addobj.yieldrate === "" ||
id: this.detailobj.id, this.addobj.yieldrate === undefined ||
}; this.addobj.yieldrate === 0
axios ) {
.request({ this.$Message.error(this.$t("950156"));
url: "/cnc/BeatAllocation/EditBeatAllocation", return false;
data, }
method: "post", // if (
}) // this.addobj.start_time === "" ||
.then((res) => { // this.addobj.start_time === undefined
if (res.data.ret === 1) { // ) {
this.$Message.success(this.$t("1060")); // this.$Message.error(this.$t("9000127"));
// return false;
// }
// if (this.addobj.end_time === "" || this.addobj.end_time === undefined) {
// this.$Message.error(this.$t("9000128"));
// return false;
// }
if (
this.addobj.start_time &&
this.addobj.end_time &&
this.addobj.start_time > this.addobj.end_time
) {
this.$Message.error(this.$t("100218"));
return false;
}
let data = {
sectionid: this.sectionId,
machineid: this.machineId,
program_number: this.addobj.program_number,
product_name_text: "",
product_name: this.addobj.product,
drawing_number: "",
standard_besat: this.addobj.standard_besat,
daily_standard_output: this.addobj.daily_standard_output,
time_num: this.addobj.time_num,
route_id:this.addobj.route_id,
route_name: this.addobj.route_name,
route_number: this.addobj.route_number,
updown_besat: this.addobj.updown_besat, // 上下料节拍
yieldratio: this.addobj.yieldrate, // 产量系数
start_time: this.addobj.start_time,
end_time: this.addobj.end_time,
};
axios
.request({
url: "/cnc/BeatAllocation/AddBeatAllocation",
data,
method: "post",
})
.then((res) => {
if (res.data.ret === 1) {
this.$Message.success(this.$t("1055"));
this.addmodal = false;
this.tosearch();
} else {
this.$Message.error(this.$t(res.data.msg));
}
});
},
dele() {
if (
this.selectids === undefined ||
this.selectids === "" ||
this.selectids === []
) {
this.$Message.error(this.$t("1017"));
return false;
} else {
let data = {
ids: this.selectids,
};
this.$Modal.confirm({
title: this.$t("1018"),
content: "",
width: "290px",
closable: true,
okText: this.$t("1004"),
onOk: () => {
axios
.request({
url: "/cnc/BeatAllocation/DeleteMultipleBeats",
data,
method: "post",
})
.then((res) => {
if (res.data.ret === 1) {
this.$Message.success(this.$t("1058"));
this.tosearch();
this.detailobj = {};
} else {
this.$Message.error(this.$t(res.data.msg));
}
});
},
});
}
},
edit() {
if (
this.detailobj === undefined ||
this.detailobj.id === undefined
) {
this.$Message.error(this.$t("1017"));
return false;
}
this.sectionname = this.detailobj.stationName;
this.sectionId = this.detailobj.section_id;
this.machineId = this.detailobj.machineID;
this.editobj.route_number = this.detailobj.route_number;
this.editobj.process_number = this.detailobj.process_number;
this.editobj.product_name_text = this.detailobj.product_name_text;
this.editobj.standard_besat = this.detailobj.standard_besat;
this.editobj.daily_standard_output = this.detailobj.daily_standard_output;
this.editobj.time_num = this.detailobj.time_num;
this.editobj.route_name = this.detailobj.routeName;
this.editobj.updown_besat = this.detailobj.updown_besat;
this.editobj.yieldrate = this.detailobj.yieldrate;
this.editobj.start_time = this.detailobj.start_time;
this.editobj.end_time = this.detailobj.end_time;
this.editmodal = true;
},
editdata() {
// 验证非空
if (
this.editobj.standard_besat === "" ||
this.editobj.standard_besat === undefined ||
this.editobj.standard_besat === 0
) {
this.$Message.error(this.$t("800294"));
return false;
}
if (
this.editobj.updown_besat === "" ||
this.editobj.updown_besat === undefined
) {
this.$Message.error(this.$t("500222"));
return false;
}
if (
this.editobj.daily_standard_output === "" ||
this.editobj.daily_standard_output === undefined ||
this.editobj.daily_standard_output === 0
) {
this.$Message.error(this.$t("800295"));
return false;
}
if (
this.editobj.yieldrate === "" ||
this.editobj.yieldrate === undefined ||
this.editobj.yieldrate === 0
) {
this.$Message.error(this.$t("950156"));
return false;
}
// if (
// this.editobj.start_time === "" ||
// this.editobj.start_time === undefined
// ) {
// this.$Message.error(this.$t("9000127"));
// return false;
// }
// if (this.editobj.end_time === "" || this.editobj.end_time === undefined) {
// this.$Message.error(this.$t("9000128"));
// return false;
// }
if (
this.editobj.start_time &&
this.editobj.end_time &&
this.editobj.start_time > this.editobj.end_time
) {
this.$Message.error(this.$t("100218"));
return false;
}
let data = {
sectionid: this.sectionId,
machineid: this.machineId,
standard_besat: this.editobj.standard_besat,
daily_standard_output: this.editobj.daily_standard_output,
time_num: this.editobj.time_num,
updown_besat: this.editobj.updown_besat, // 上下料节拍
yieldratio: this.editobj.yieldrate, // 产量系数
start_time: this.editobj.start_time,
end_time: this.editobj.end_time,
id: this.detailobj.id,
};
axios
.request({
url: "/cnc/BeatAllocation/EditBeatAllocation",
data,
method: "post",
})
.then((res) => {
if (res.data.ret === 1) {
this.$Message.success(this.$t("1060"));
this.editmodal = false;
this.search();
} else {
this.$Message.error(this.$t(res.data.msg));
}
});
},
closeedit() {
this.editmodal = false; this.editmodal = false;
this.search(); },
} else { loadexcel() {
this.$Message.error(this.$t(res.data.msg)); let params = {};
} axios
}); .request({
}, url: "/config/BeatSetDownLoad/GetTemplate",
closeedit() { params,
this.editmodal = false; method: "get",
}, })
loadexcel() { .then((res) => {
let params = {}; if (res.data.ret === 1) {
axios window.location.href =
.request({ axios.publicPath + "" + res.data.data;
url: "/config/BeatSetDownLoad/GetTemplate", } else {
params, this.error(res.data.msg);
method: "get", }
}) });
.then((res) => { },
if (res.data.ret === 1) { Export() {
window.location.href = axios.publicPath + "" + res.data.data; axios
} else { .request({
this.error(res.data.msg); url: "/cnc/Upload/Submit?templateName=BeatAllocation",
} method: "post",
}); })
}, .then((res) => {
Export() { if (res.data.ret === 1) {
axios window.location.href =
.request({ axios.publicPath + "" + res.data.data;
url: "/cnc/Upload/Submit?templateName=BeatAllocation", } else {
method: "post", this.$Message.error(res.data.msg);
}) }
.then((res) => { });
if (res.data.ret === 1) { },
window.location.href = axios.publicPath + "" + res.data.data;
} else {
this.$Message.error(res.data.msg);
}
});
}, },
},
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.treeSelect { .treeSelect {
span { span {
background: #2d8cf1; background: #2d8cf1;
color: #fff; color: #fff;
margin: 0; margin: 0;
padding: 0 4px; padding: 0 4px;
border-radius: 3px; border-radius: 3px;
cursor: pointer; cursor: pointer;
vertical-align: top; vertical-align: top;
} }
} }
.labelInfo { .labelInfo {
text-align: left !important; text-align: left !important;
} }
</style> </style>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div class="divborder newSearchDiv" style="margin:0px;"> <div class="divborder newSearchDiv" style="margin:0px;">
<div class="filter"> <div class="filter">
<label>{{$t('100088')}}</label> <label>{{$t('100088')}}</label>
<!-- <Select v-model="productname" label-in-value filterable clearable remote <!-- <Select v-model="productname " label-in-value filterable clearable remote
:remote-method="remoteMethod" :remote-method="remoteMethod"
:loading="loading1" class="searchSelect" > :loading="loading1" class="searchSelect" >
<Option v-for="item in products" :value="item.id" :key="item.id">{{ item.name }}({{item.code}})</Option> <Option v-for="item in products" :value="item.id" :key="item.id">{{ item.name }}({{item.code}})</Option>
......
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