Commit 1c4d984b authored by renjintao's avatar renjintao

物料领用ing

parent 0c4ad817
......@@ -297,6 +297,9 @@ div::-webkit-scrollbar-corner {
.mr30 {
margin-right: 30px;
}
.mr40 {
margin-right: 40px;
}
.mtb10 {
margin: 10px 0;
......
......@@ -1672,7 +1672,10 @@ export default {
storeTitle: '库位名称',
stockCode: '物料序号',
count1:"可申请数",
count2:"申请数"
count2:"申请数",
count3:"已领用数/出库数",
count4:"领用",
applicationNumber:"申请数"
},
//导入中心
import_center:{
......
<template>
<div class="h100 table-content">
<div class="h100 table-content1">
<p class="mb10">
订单编号:{{mesCodes}}
<span class="ml20">产品名称:{{productNames}}</span>
<span class="ml20">生产数量:{{counts}}</span>
<span class="fr mr20" v-if="false">
<a href="javascript:;">出库单</a>
</span>
<span class="fr mr20">
<a href="javascript:;" @click="openAcc">申请单</a>
</span>
订单编号:{{mesCodes}}
<span class="ml20">产品名称:{{productNames}}</span>
<span class="ml20">生产数量:{{counts}}</span>
<span class="fr mr20" v-if="false">
<a href="javascript:;">出库单</a>
</span>
<span class="fr mr20">
<a href="javascript:;" @click="openAcc">申请单</a>
</span>
</p>
<div class="mb20" v-for="(item,i) in datas" :key="i">
<p class="fwBold">{{item.routingHeader}}------{{item.routingHeaderCode}}</p>
<Table
border
:columns="cols"
:data="item.suport"
:ref="'table'+item.routingHeaderId"
class="tableCommon"
@on-selection-change="selectionChange(i)"
@on-select-cancel="selectListCancel"
@on-select-all-cancel="selectAllCancel"
@on-select="selectList"
@on-select-all="selectListAll"
>
<template slot-scope="{ row, index }" slot="counts">
<InputNumber
:max="row.totalCount-row.applicationNumber"
:min="0"
v-model="row.count"
@on-change="inputChange1(i,row,index)"
:disabled="row._disabled"
/>
</template>
<template slot-scope="{ row, index }" slot="remarks">
<Input
type="text"
v-model="row.remark"
@on-change="inputChange1(i,row,index)"
:disabled="row._disabled"
/>
</template>
</Table>
<p class="fwBold">{{item.routingHeader}}------{{item.routingHeaderCode}}</p>
<Table border :columns="cols" :data="item.suport" :ref="'table'+item.routingHeaderId" class="tableCommon" @on-selection-change="selectionChange(i)" @on-select-cancel="selectListCancel" @on-select-all-cancel="selectAllCancel" @on-select="selectList" @on-select-all="selectListAll">
<template slot-scope="{ row, index }" slot="counts">
<InputNumber :max="row.totalCount-row.applicationNumber" :min="0" v-model="row.count" @on-change="inputChange1(i,row,index)" :disabled="row._disabled" />
</template>
<template slot-scope="{ row, index }" slot="remarks">
<Input type="text" v-model="row.remark" @on-change="inputChange1(i,row,index)" :disabled="row._disabled" />
</template>
</Table>
</div>
<FooterToolbar v-show="footerToolbar" class="ftball">
<!--<div class="tip">已选{{selectItems.length}}项</div>-->
<Form :model="orderForm" :label-width="110" ref="formValidate" :rules="ruleValidate">
<FormItem label=" " prop="QuotationFinishDate">
<DatePicker
v-model="orderForm.QuotationFinishDate"
type="date"
style="color:black"
placeholder="请选择齐套日期"
@on-change="getTimeQuotationFD"
></DatePicker>
</FormItem>
</Form>
<Button type="primary" class="mr10 ml10" @click="application">申请配套</Button>
<FooterToolbar v-show="footerToolbar" class="ftball pt10">
<!--<div class="tip">已选{{selectItems.length}}项</div>-->
<Form :model="orderForm" :inline="true" :label-width="110" ref="formValidate" :rules="ruleValidate">
<FormItem label=" " prop="QuotationFinishDate">
<DatePicker v-model="orderForm.QuotationFinishDate" type="date" style="color:black" placeholder="请选择齐套日期" @on-change="getTimeQuotationFD"></DatePicker>
</FormItem>
<FormItem label=""><Button type="primary" class="mr10 ml10" @click="application">申请配套</Button></FormItem>
</Form>
</FooterToolbar>
<Modal v-model="modalAccessoryList" :title="title" fullscreen footer-hide>
<component
:is="detailAcc"
:eid="orderId"
:mesCode="mesCodes"
:productName="productNames"
:drawnNumber="drawnNumber"
:count="counts"
@on-close="cancel"
@on-ok="onOk"
/>
<component :is="detailAcc" :eid="orderId" :mesCode="mesCodes" :productName="productNames" :drawnNumber="drawnNumber" :count="counts" @on-close="cancel" @on-ok="onOk" />
</Modal>
<Modal v-model="modalAccSet" title="临时设置" footer-hide width="800">
<Form :model="entity" :label-width="110" ref="formValidateSet" :rules="ruleValidate">
<Row>
<Col span="12">
<FormItem label="工序">{{entity.routingDetailName}}</FormItem>
</Col>
<Col span="12">
<FormItem label="物料名">{{entity.materialName}}</FormItem>
</Col>
<Col span="12">
<FormItem label="物料编号">{{entity.materialNumber}}</FormItem>
</Col>
<Col span="12">
<FormItem label="需求数量">{{entity.needCount}}</FormItem>
</Col>
<Col span="12">
<FormItem label="已申请">{{entity.applicationNumber}}</FormItem>
</Col>
<Col span="12">
<FormItem label="可再申请" prop="count">
<InputNumber
:max="entity.needCount-entity.applicationNumber"
:min="0"
v-model="entity.count"
/>
</FormItem>
</Col>
<Col span="12">
<FormItem label="齐套日期" prop="finishDate">
<DatePicker
v-model="entity.finishDate"
type="date"
placeholder="请选择齐套日期"
@on-change="getTimeFinish"
></DatePicker>
</FormItem>
</Col>
<Col span="24">
<FormItem label="备注">
<Input type="text" v-model="entity.remark" />
</FormItem>
</Col>
<Col span="24">
<p class="fr">
<Button type="primary" class="mr10 ml10" @click="application1">申请配套</Button>
<Button @click="canelSet">取消</Button>
</p>
</Col>
</Row>
</Form>
<Form :model="entity" :label-width="110" ref="formValidateSet" :rules="ruleValidate">
<Row>
<Col span="12">
<FormItem label="工序">{{entity.routingDetailName}}</FormItem>
</Col>
<Col span="12">
<FormItem label="物料名">{{entity.materialName}}</FormItem>
</Col>
<Col span="12">
<FormItem label="物料编号">{{entity.materialNumber}}</FormItem>
</Col>
<Col span="12">
<FormItem label="需求数量">{{entity.needCount}}</FormItem>
</Col>
<Col span="12">
<FormItem label="已申请">{{entity.applicationNumber}}</FormItem>
</Col>
<Col span="12">
<FormItem label="可再申请" prop="count">
<InputNumber :max="entity.needCount-entity.applicationNumber" :min="0" v-model="entity.count" />
</FormItem>
</Col>
<Col span="12">
<FormItem label="齐套日期" prop="finishDate">
<DatePicker v-model="entity.finishDate" type="date" placeholder="请选择齐套日期" @on-change="getTimeFinish"></DatePicker>
</FormItem>
</Col>
<Col span="24">
<FormItem label="备注">
<Input type="text" v-model="entity.remark" />
</FormItem>
</Col>
<Col span="24">
<p class="fr">
<Button type="primary" class="mr10 ml10" @click="application1">申请配套</Button>
<Button @click="canelSet">取消</Button>
</p>
</Col>
</Row>
</Form>
</Modal>
</div>
</div>
</template>
<script>
import Api from "./api";
export default {
name: "addAccessory",
data() {
return {
title: "",
detailAcc: null,
modalAccessoryList: false,
modalAccSet: false,
disabled: false,
deletelModal: false,
curId: 0,
editIndex: -1,
editNum: "",
cols: [
{
type: "selection",
width: 70,
align: "center",
name: "addAccessory",
data() {
return {
title: "",
detailAcc: null,
modalAccessoryList: false,
modalAccSet: false,
disabled: false,
deletelModal: false,
curId: 0,
editIndex: -1,
editNum: "",
cols: [{
type: "selection",
width: 70,
align: "center",
},
{
key: "routingDetailNo",
title: this.l("routingDetailNo"),
align: "left",
},
{
key: "routingDetailName",
title: this.l("routingDetailName"),
align: "left",
},
{
key: "nameMaterial",
title: this.l("nameMaterial"),
align: "left",
},
{
key: "materialNumber",
title: this.l("materialNumber"),
align: "left",
},
{
key: "totalCount",
title: this.l("totalCount"),
align: "left",
},
{
key: "count",
title: this.l("count1"),
align: "right",
slot: "counts",
width: 120,
},
{
key: "remark",
title: this.l("remark"),
align: "left",
slot: "remarks",
},
{
key: "action",
title: "操作",
align: "center",
width: "120",
render: (h, params) => {
return h(
"op", {
attrs: {
oprate: "detail",
},
on: {
click: () => this.setAcc(params.row),
},
},
params.row._disabled &&
params.row.totalCount - params.row.applicationNumber > 0 ?
"临时申请" :
""
);
},
},
],
orderForm: {
QuotationFinishDate: "",
},
datas: [],
selectItems: [],
footerToolbar: true,
orderId: this.eid,
mesCodes: this.mesCode,
productNames: this.productName,
drawnNumbers: this.drawnNumber,
counts: this.count,
curArr: 0, //标记当前操作工艺规程列表是否为空
ruleValidate: {
QuotationFinishDate: [{
required: true,
message: "_",
trigger: "change",
}, ],
finishDate: [{
required: true,
message: "请选择齐套日期",
trigger: "change",
}, ],
count: [{
required: true,
message: "请输入申请数量",
type: "number",
trigger: "change",
}, ],
},
tempList: [],
cRow: null,
cArr: [],
entity: {
routingHeaderId: null,
routingDeatilId: null,
routingDetailName: "",
routingDetailSeq: null,
materialId: null,
materialName: "",
materialNumber: "",
needCount: 0,
applicationNumber: 0,
count: 0,
remark: "",
finishDate: "",
},
};
},
props: {
eid: Number,
mesCode: String,
productName: String,
drawnNumber: String,
count: Number,
},
mounted() {
this.load(this.eid);
},
async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
load(v) {
Api.matchdetaillist({
id: v
}).then((r) => {
if (r.success) {
r.result.forEach((e) => {
let i = 0;
e.suport.forEach((el) => {
el.count = el.totalCount - el.applicationNumber;
if (el.applicationNumber > 0) {
el._checked = false;
el._disabled = true;
} else {
el._checked = true;
el._disabled = false;
}
el._index = i++;
});
});
this.datas = r.result;
//----测试多个工艺start
// let temre = this.$u.clone(r.result);
// temre.forEach((ele) => {
// ele.routingHeaderId = 281;
// ele.suport.forEach((eles) => {
// eles.routingHeaderId = 281;
// eles.id = eles.id + 20;
// eles.nameMaterial = eles.nameMaterial + "tttt";
// });
// });
// this.datas = r.result.concat(temre);
//----测试多个工艺end
}
});
},
{
key: "routingDetailNo",
title: this.l("routingDetailNo"),
align: "left",
getTimeQuotationFD(value) {
this.orderForm.QuotationFinishDate =
value != "" ? this.getFormatDateEnd(value) : value;
},
{
key: "routingDetailName",
title: this.l("routingDetailName"),
align: "left",
getTimeFinish(value) {
this.entity.finishDate =
value != "" ? this.getFormatDateEnd(value) : value;
},
{
key: "nameMaterial",
title: this.l("nameMaterial"),
align: "left",
getFormatDateEnd(dates) {
const d = new Date(dates);
const resDate =
d.getFullYear() +
"-" +
this.p(d.getMonth() + 1) +
"-" +
this.p(d.getDate()) +
" 23:59:59";
return resDate;
},
{
key: "materialNumber",
title: this.l("materialNumber"),
align: "left",
p(s) {
return s < 10 ? "0" + s : s;
},
{
key: "totalCount",
title: this.l("totalCount"),
align: "left",
selectionChange(v) {
//根据状态修改this.datas数组数据
if (this.curArr == 3) {
//单条取消选择
this.cRow._checked = false;
this.$set(this.datas[v].suport, this.cRow._index, this.cRow);
} else if (this.curArr == 1) {
//单条选择
this.cRow._checked = true;
this.$set(this.datas[v].suport, this.cRow._index, this.cRow);
} else if (this.curArr == 2) {
//多条选择
this.datas[v].suport.forEach((ele, index, array) => {
if (ele._disabled) {
ele._checked = false;
} else {
ele._checked = true;
}
this.$set(this.datas[v].suport, index, ele);
});
} else if (this.curArr == 4) {
//多条取消
this.datas[v].suport.forEach((ele, index, array) => {
ele._checked = false;
this.$set(this.datas[v].suport, index, ele);
});
}
},
{
key: "count",
title: this.l("count1"),
align: "right",
slot: "counts",
width: 120,
selectList(items, row) {
this.curArr = 1;
this.cRow = row;
},
{
key: "remark",
title: this.l("remark"),
align: "left",
slot: "remarks",
selectListAll(items) {
this.curArr = 2;
},
{
key: "action",
title: "操作",
align: "center",
width: "120",
render: (h, params) => {
return h(
"op",
{
attrs: {
oprate: "detail",
},
on: {
click: () => this.setAcc(params.row),
},
},
params.row._disabled &&
params.row.totalCount - params.row.applicationNumber > 0
? "临时申请"
: ""
);
},
selectListCancel(items, row) {
this.curArr = 3;
this.cRow = row;
},
],
orderForm: {
QuotationFinishDate: "",
},
datas: [],
selectItems: [],
footerToolbar: true,
orderId: this.eid,
mesCodes: this.mesCode,
productNames: this.productName,
drawnNumbers: this.drawnNumber,
counts: this.count,
curArr: 0, //标记当前操作工艺规程列表是否为空
ruleValidate: {
QuotationFinishDate: [
{
required: true,
message: "_",
trigger: "change",
},
],
finishDate: [
{
required: true,
message: "请选择齐套日期",
trigger: "change",
},
],
count: [
{
required: true,
message: "请输入申请数量",
type: "number",
trigger: "change",
},
],
},
tempList: [],
cRow: null,
cArr: [],
entity: {
routingHeaderId: null,
routingDeatilId: null,
routingDetailName: "",
routingDetailSeq: null,
materialId: null,
materialName: "",
materialNumber: "",
needCount: 0,
applicationNumber: 0,
count: 0,
remark: "",
finishDate: "",
},
};
},
props: {
eid: Number,
mesCode: String,
productName: String,
drawnNumber: String,
count: Number,
},
mounted() {
this.load(this.eid);
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
load(v) {
Api.matchdetaillist({ id: v }).then((r) => {
if (r.success) {
r.result.forEach((e) => {
let i = 0;
e.suport.forEach((el) => {
el.count = el.totalCount - el.applicationNumber;
if (el.applicationNumber > 0) {
el._checked = false;
el._disabled = true;
} else {
el._checked = true;
el._disabled = false;
}
el._index = i++;
});
});
this.datas = r.result;
//----测试多个工艺start
// let temre = this.$u.clone(r.result);
// temre.forEach((ele) => {
// ele.routingHeaderId = 281;
// ele.suport.forEach((eles) => {
// eles.routingHeaderId = 281;
// eles.id = eles.id + 20;
// eles.nameMaterial = eles.nameMaterial + "tttt";
// });
// });
// this.datas = r.result.concat(temre);
//----测试多个工艺end
}
});
},
getTimeQuotationFD(value) {
this.orderForm.QuotationFinishDate =
value != "" ? this.getFormatDateEnd(value) : value;
},
getTimeFinish(value) {
this.entity.finishDate =
value != "" ? this.getFormatDateEnd(value) : value;
},
getFormatDateEnd(dates) {
const d = new Date(dates);
const resDate =
d.getFullYear() +
"-" +
this.p(d.getMonth() + 1) +
"-" +
this.p(d.getDate()) +
" 23:59:59";
return resDate;
},
p(s) {
return s < 10 ? "0" + s : s;
},
selectionChange(v) {
//根据状态修改this.datas数组数据
if (this.curArr == 3) {
//单条取消选择
this.cRow._checked = false;
this.$set(this.datas[v].suport, this.cRow._index, this.cRow);
} else if (this.curArr == 1) {
//单条选择
this.cRow._checked = true;
this.$set(this.datas[v].suport, this.cRow._index, this.cRow);
} else if (this.curArr == 2) {
//多条选择
this.datas[v].suport.forEach((ele, index, array) => {
if (ele._disabled) {
ele._checked = false;
} else {
ele._checked = true;
}
this.$set(this.datas[v].suport, index, ele);
});
} else if (this.curArr == 4) {
//多条取消
this.datas[v].suport.forEach((ele, index, array) => {
ele._checked = false;
this.$set(this.datas[v].suport, index, ele);
});
}
},
selectList(items, row) {
this.curArr = 1;
this.cRow = row;
},
selectListAll(items) {
this.curArr = 2;
},
selectListCancel(items, row) {
this.curArr = 3;
this.cRow = row;
},
selectAllCancel(items) {
this.curArr = 4;
},
inputChange1(i, row, index) {
//输入数量
this.$set(this.datas[i].suport, index, row);
},
application() {
//申请配套操作
this.$refs["formValidate"].validate((valid) => {
if (valid) {
let temItems = [];
let temSelectItems = this.$u.clone(this.datas);
temSelectItems.forEach((e) => {
e.suport.forEach((ele) => {
if (ele._checked && ele.count > 0) {
let temObj = {
routingHeaderId: ele.routingHeaderId,
routingDeatilId: ele.routingDetailId,
routingDetailName: ele.routingDetailName,
routingDetailSeq: ele.routingDetailNo,
materialId: ele.materialId,
materialName: ele.nameMaterial,
materialNumber: ele.materialNumber,
needCount: ele.totalCount,
count: ele.count, //
remark: ele.remark ? ele.remark : "",
};
temItems.push(temObj);
}
selectAllCancel(items) {
this.curArr = 4;
},
inputChange1(i, row, index) {
//输入数量
this.$set(this.datas[i].suport, index, row);
},
application() {
//申请配套操作
this.$refs["formValidate"].validate((valid) => {
if (valid) {
let temItems = [];
let temSelectItems = this.$u.clone(this.datas);
temSelectItems.forEach((e) => {
e.suport.forEach((ele) => {
if (ele._checked && ele.count > 0) {
let temObj = {
routingHeaderId: ele.routingHeaderId,
routingDeatilId: ele.routingDetailId,
routingDetailName: ele.routingDetailName,
routingDetailSeq: ele.routingDetailNo,
materialId: ele.materialId,
materialName: ele.nameMaterial,
materialNumber: ele.materialNumber,
needCount: ele.totalCount,
count: ele.count, //
remark: ele.remark ? ele.remark : "",
};
temItems.push(temObj);
}
});
});
let parms = {
main: {
orderId: this.orderId,
productName: this.productNames,
drawnNumber: this.drawnNumbers,
count: this.counts,
creator: this.$store.state.userInfo.userName,
finishDate: this.orderForm.QuotationFinishDate,
orderCode: this.mesCode,
},
items: temItems,
};
//alert(JSON.stringify(parms.items));
if (parms.items.length == 0) {
this.$Message.error("请输入申请数量");
} else {
Api.supportmainCreate(parms).then((res) => {
if (res.success) {
this.$Message.success("申请成功");
this.$emit("on-ok");
}
});
}
}
});
});
let parms = {
main: {
orderId: this.orderId,
productName: this.productNames,
drawnNumber: this.drawnNumbers,
count: this.counts,
creator: this.$store.state.userInfo.userName,
finishDate: this.orderForm.QuotationFinishDate,
orderCode:this.mesCode,
},
items: temItems,
};
//alert(JSON.stringify(parms.items));
if (parms.items.length == 0) {
this.$Message.error("请输入申请数量");
} else {
Api.supportmainCreate(parms).then((res) => {
if (res.success) {
this.$Message.success("申请成功");
this.$emit("on-ok");
}
},
application1() {
//临时申请配套操作
this.$refs["formValidateSet"].validate((valid) => {
if (valid) {
let temItems = [];
let temObj = {
routingHeaderId: this.entity.routingHeaderId,
routingDeatilId: this.entity.routingDeatilId,
routingDetailName: this.entity.routingDetailName,
routingDetailSeq: this.entity.routingDetailSeq,
materialId: this.entity.materialId,
materialName: this.entity.materialName,
materialNumber: this.entity.materialNumber,
needCount: this.entity.needCount,
count: this.entity.count,
remark: this.entity.remark,
};
temItems.push(temObj);
let parms = {
main: {
orderId: this.orderId,
productName: this.productNames,
drawnNumber: this.drawnNumbers,
count: this.counts,
creator: this.$store.state.userInfo.userName,
finishDate: this.entity.finishDate,
orderCode: this.mesCode,
},
items: temItems,
};
//alert(JSON.stringify(parms));
Api.supportmainCreate(parms).then((res) => {
if (res.success) {
this.$Message.success("申请成功");
this.canelSet();
this.load(this.eid);
}
});
}
});
}
}
});
},
setAcc(row) {
//临时设置
row.materialName = row.nameMaterial;
row.needCount = row.totalCount;
row.routingDetailSeq = row.routingDetailNo;
row.routingDeatilId = row.routingDetailId;
this.entity = row;
this.modalAccSet = true;
},
openAcc() {
//打开申请单页面
this.title = "申请单";
this.detailAcc = () => import("./detailAccessory");
this.modalAccessoryList = true;
},
cancel() {
this.modalAccessoryList = false;
},
canelSet() {
//临时设置取消
this.modalAccSet = false;
},
onOk() {
//重新加载页面数据
this.load(this.eid);
},
l(key) {
let vkey = "support_item" + "." + key;
return this.$t(vkey) || key;
},
},
application1() {
//临时申请配套操作
this.$refs["formValidateSet"].validate((valid) => {
if (valid) {
let temItems = [];
let temObj = {
routingHeaderId: this.entity.routingHeaderId,
routingDeatilId: this.entity.routingDeatilId,
routingDetailName: this.entity.routingDetailName,
routingDetailSeq: this.entity.routingDetailSeq,
materialId: this.entity.materialId,
materialName: this.entity.materialName,
materialNumber: this.entity.materialNumber,
needCount: this.entity.needCount,
count: this.entity.count,
remark: this.entity.remark,
};
temItems.push(temObj);
let parms = {
main: {
orderId: this.orderId,
productName: this.productNames,
drawnNumber: this.drawnNumbers,
count: this.counts,
creator: this.$store.state.userInfo.userName,
finishDate: this.entity.finishDate,
orderCode:this.mesCode,
},
items: temItems,
};
//alert(JSON.stringify(parms));
Api.supportmainCreate(parms).then((res) => {
if (res.success) {
this.$Message.success("申请成功");
this.canelSet();
this.load(this.eid);
watch: {
eid(v) {
if (v != 0) {
this.load(v);
}
});
}
});
},
setAcc(row) {
//临时设置
row.materialName = row.nameMaterial;
row.needCount = row.totalCount;
row.routingDetailSeq = row.routingDetailNo;
row.routingDeatilId = row.routingDetailId;
this.entity = row;
this.modalAccSet = true;
},
openAcc() {
//打开申请单页面
this.title = "申请单";
this.detailAcc = () => import("./detailAccessory");
this.modalAccessoryList = true;
},
cancel() {
this.modalAccessoryList = false;
},
canelSet() {
//临时设置取消
this.modalAccSet = false;
},
onOk() {
//重新加载页面数据
this.load(this.eid);
},
l(key) {
let vkey = "support_item" + "." + key;
return this.$t(vkey) || key;
},
},
watch: {
eid(v) {
if (v != 0) {
this.load(v);
}
},
},
},
};
</script>
<template>
<div class="wu_bg">
<div class="star" v-if="!starmodal">
<a class="start" @click="starFun" >
物料领用</a>
</div>
</div>
<div class="h100 table-content1">
<p class="mb10 ml40 mr40">
订单编号:{{entity.mesCode}}
<span class="ml20">产品名称:{{entity.productName}}</span>
<span class="ml20">生产数量:{{entity.count}}</span>
<span class="ml20">物料状态:</span>
</p>
<div class="mb20 ml40 mr40" v-for="(item,i) in datas" :key="i">
<p class="fwBold">{{item.routingHeader}}------{{item.routingHeaderCode}}</p>
<Table border :columns="cols" :data="item.suport" :ref="'table'+item.routingHeaderId" class="tableCommon">
<template slot-scope="{ row, index }" slot="counts4">
<InputNumber :max="row.outStockNumber-row.receiveNumber" :min="0" v-model="row.count4" @on-change="inputChange1(i,row,index)" :disabled="row._disabled" />
</template>
</Table>
</div>
<FooterToolbar v-show="footerToolbar">
<Button type="primary" class="mr10 ">物料领用</Button>
</FooterToolbar>
</div>
</template>
<script>
import Api from "../../../aps/plan/api";
export default {
name:'starOrder',
data(){
return{
starmodal: false,
}
name: 'starOrder',
data() {
return {
entity: {},
title: "",
detailAcc: null,
modalAccessoryList: false,
modalAccSet: false,
disabled: false,
deletelModal: false,
curId: 0,
editIndex: -1,
editNum: "",
cols: [{
key: "routingDetailNo",
title: this.l("routingDetailNo"),
align: "left",
},
{
key: "routingDetailName",
title: this.l("routingDetailName"),
align: "left",
},
{
key: "nameMaterial",
title: this.l("nameMaterial"),
align: "left",
},
{
key: "materialNumber",
title: this.l("materialNumber"),
align: "left",
},
{
key: "totalCount",
title: this.l("totalCount"),
align: "left",
},
{
key: "applicationNumber",
title: this.l("applicationNumber"),
align: "right",
width: 120,
},
{
key: "",
title: this.l("count3"),
align: "right",
slot: "counts",
width: 150,
render: (h, params) => {
return h(
"div", {},
params.row.receiveNumber + "/" + params.row.outStockNumber
)
}
},
{
key: "count4",
title: this.l("count4"),
align: "center",
width: 120,
slot: "counts4",
},
{
key: "remark",
title: this.l("remark"),
align: "left",
}
],
orderForm: {
QuotationFinishDate: "",
},
datas: [],
selectItems: [],
footerToolbar: true,
orderId: null,
mesCode: "",
productName: "",
drawnNumber: "",
count: null,
curArr: 0, //标记当前操作工艺规程列表是否为空
ruleValidate: {
QuotationFinishDate: [{
required: true,
message: "_",
trigger: "change",
}, ],
finishDate: [{
required: true,
message: "请选择齐套日期",
trigger: "change",
}, ],
count: [{
required: true,
message: "请输入申请数量",
type: "number",
trigger: "change",
}, ],
},
tempList: [],
cRow: null,
cArr: [],
};
},
props: {
row: Object,
gdid: Number,
},
created() {
// this.treeHeight = window.innerHeight - 120;
},
async fetch({ store, params }) {
async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
mounted() {
this.loadInfo()
window.onresize = () => {
///浏览器窗口大小变化
return (() => {
this.treeHeight = window.innerHeight - 120;
})();
///浏览器窗口大小变化
return (() => {
this.treeHeight = window.innerHeight - 120;
})();
};
},
methods: {
starFun(){
this.$Message.success("开工...")
loadInfo() {
this.entity = this.row
let v = this.row.orderId
Api.matchdetaillist({
id: v
}).then((r) => {
if (r.success) {
r.result.forEach((e) => {
let i = 0;
e.suport.forEach((el) => {
el.count = el.totalCount - el.applicationNumber;
if (el.outStockNumber - el.receiveNumber > 0) {
el.count4 = el.outStockNumber - el.receiveNumber
el._disabled = false;
} else {
el.count4 = 0;
el._disabled = true;
}
el._index = i++;
});
});
this.datas = r.result;
}
});
},
inputChange1(i, row, index) {
//输入数量
this.$set(this.datas[i].suport, index, row);
},
l(key) {
let vkey = "support_item" + "." + key;
return this.$t(vkey) || key;
},
},
watch: {
row(v) {
this.entity = this.$u.clone(v);
this.productName = this.entity.productName
},
gdid(v) {
if (v > 0) {
// this.load(v);
}
},
},
}
</script>
<style lang="less">
.table-content1 {
.table-footer {
line-height: 45px;
text-align: right;
}
.ivu-footer-toolbar {
text-align: right;
background: rgba(0, 0, 0, 0.7);
color: #fff;
}
.ivu-footer-toolbar-right {
float: right;
}
}
</style>
<template>
<div class="order_list">
<div class="order_list">
<div class="card_box">
<Card
class="card_order"
v-for="(item,index) in listTasks"
:style="order==item.id?'box-shadow: 0px 0px 15px #333;':''"
@click.native="goPage(item)"
:key="index"
:class="item.status==12 ? 'card_border1' : (item.status==14 ? 'card_border2': (item.status==5 ?'card_border3':
(item.status==7?'card_border4':(item.status==-1?'card_border5':''))))"
>
<!-- :class="item.status=='未开工'? 'card_border1' : (item.status=='执行中' ? 'card_border2': (item.status=='暂停中' ?'card_border3':
<Card class="card_order" v-for="(item,index) in listTasks" :style="order==item.id?'box-shadow: 0px 0px 15px #333;':''" @click.native="goPage(item)" :key="index" :class="item.status==12 ? 'card_border1' : (item.status==14 ? 'card_border2': (item.status==5 ?'card_border3':
(item.status==7?'card_border4':(item.status==-1?'card_border5':''))))">
<!-- :class="item.status=='未开工'? 'card_border1' : (item.status=='执行中' ? 'card_border2': (item.status=='暂停中' ?'card_border3':
(item.status=='交检中'?'card_border4':(item.status=='交接中'?'card_border5':''))))"-->
<p slot="title">
{{item.mesCode}}
<state code="taskList.status" ref="state" class="fr" :value="item.status" type="text"></state>
<!-- <span >{{item.status}}</span> -->
</p>
<p class="order_tit">{{item.productName}}</p>
<p>
<Icon type="ios-pricetags" />
{{item.taskName}}
</p>
<p>{{item.beginTime}}~{{item.endTime}}</p>
</Card>
<p>{{listTasks.length}} 个工单</p>
<p slot="title">
{{item.mesCode}}
<state code="taskList.status" ref="state" class="fr" :value="item.status" type="text"></state>
<!-- <span >{{item.status}}</span> -->
</p>
<p class="order_tit">{{item.productName}}</p>
<p>
<Icon type="ios-pricetags" />
{{item.taskName}}
</p>
<p>{{item.beginTime}}~{{item.endTime}}</p>
</Card>
<p>{{listTasks.length}} 个工单</p>
</div>
</div>
</div>
</template>
<script>
import Api from "../../api";
export default {
name: "orderlist",
data() {
return {
gnFlag: 0,
listTasks: [],
dataLength: 0
};
},
props: {
order: {
type: [String, Number]
},
asc: {
type: Boolean,
default: true
name: "orderlist",
data() {
return {
gnFlag: 0,
listTasks: [],
dataLength: 0
};
},
statu: {
type: Number,
default: -9
},
refresh: {
type: Boolean,
default: true
}
},
created() {
this.loadTree();
},
methods: {
loadTree() {
let parmse = {
status: this.statu,
isAsc: this.asc
};
Api.getCardList(parmse).then(res => {
if (res.success) {
this.listTasks = res.result;
this.dataLength = res.result.length;
props: {
order: {
type: [String, Number]
},
asc: {
type: Boolean,
default: true
},
statu: {
type: Number,
default: -9
},
refresh: {
type: Boolean,
default: true
}
});
},
gnFunto(number, type) {
this.gnFlag = number;
created() {
this.loadTree();
},
goPage(item) {
this.$router.push({
path: "/produce/execute",
query: {
id: item.id,
orderId: item.orderId,
executeId: item.executeId,
headid: item.routingHeaderId,
routid: item.routingDetailId, //工序ID
quantity: item.quantity, //派工数量
dispatchStatus: item.status
methods: {
loadTree() {
let parmse = {
status: this.statu,
isAsc: this.asc
};
Api.getCardList(parmse).then(res => {
if (res.success) {
this.listTasks = res.result;
this.dataLength = res.result.length;
}
});
},
gnFunto(number, type) {
this.gnFlag = number;
},
goPage(item) {
this.$router.push({
path: "/produce/execute",
query: {
id: item.id,
orderId: item.orderId,
executeId: item.executeId,
headid: item.routingHeaderId,
routid: item.routingDetailId, //工序ID
quantity: item.quantity, //派工数量
dispatchStatus: item.status,
mesCode: item.mesCode,
productName: item.productName,
drawnNumber: item.drawnNumber,
}
});
}
});
}
},
watch: {
order(v) {
//alert(v)
},
asc(v) {
this.asc = v;
this.loadTree();
},
statu(v) {
this.statu = v;
this.loadTree();
},
refresh(v) {
this.refresh=v;
this.loadTree();
watch: {
order(v) {
//alert(v)
},
asc(v) {
this.asc = v;
this.loadTree();
},
statu(v) {
this.statu = v;
this.loadTree();
},
refresh(v) {
this.refresh = v;
this.loadTree();
}
}
}
};
</script>
\ No newline at end of file
</script>
......@@ -2,7 +2,7 @@
@import "./execute.less";
</style>
<template>
<div class="execute_box">
<div class="execute_box">
<!-- <div class="top_title">
<span class="fl">{{orderTitle}}</span>
<div>工单编号: 12001011</div>
......@@ -11,164 +11,155 @@
<a class="gd_list" @click="changeFresh">工单列表</a>
<a class="gn_area" @click="functionalMode = true">功能区</a>
<!-- 工单列表 -->
<Drawer
placement="left"
class="gd_box"
:closable="false"
:inner="true"
:transfer="false"
v-model="orderlistMode"
>
<div slot="header">
<div class="header">
<a class="gd_tt" @click="goToOrder">
<Icon type="ios-undo-outline" />工单列表
</a>
<Dictionary
code="taskList.status"
class="select_star fr"
v-model="odermodel"
@on-change="searchOrder"
></Dictionary>
<Drawer placement="left" class="gd_box" :closable="false" :inner="true" :transfer="false" v-model="orderlistMode">
<div slot="header">
<div class="header">
<a class="gd_tt" @click="goToOrder">
<Icon type="ios-undo-outline" />工单列表
</a>
<Dictionary code="taskList.status" class="select_star fr" v-model="odermodel" @on-change="searchOrder"></Dictionary>
</div>
<div class="select_t" style="height:40px">
<Button @click="changeAsc" class="fr" shape="circle" icon="md-calendar">{{ascTitle}}</Button>
</div>
</div>
<div class="select_t" style="height:40px">
<Button @click="changeAsc" class="fr" shape="circle" icon="md-calendar">{{ascTitle}}</Button>
</div>
</div>
<!-- 列表卡片主内容 -->
<orderlist ref="orderlistref" :asc="asc" :statu="statu" :refresh="refresh" :order="inputId" />
<!-- 列表卡片主内容 -->
<orderlist ref="orderlistref" :asc="asc" :statu="statu" :refresh="refresh" :order="inputId" />
</Drawer>
<!-- 功能区 -->
<Drawer
class="gn_box"
:closable="false"
:inner="true"
:transfer="false"
v-model="functionalMode"
>
<functional @changeTitle="changeTitle" ref="functional" />
<Drawer class="gn_box" :closable="false" :inner="true" :transfer="false" v-model="functionalMode">
<functional @changeTitle="changeTitle" ref="functional" />
</Drawer>
</div>
</div>
</template>
<script>
import functional from "./components/functional";
import orderlist from "./components/orderlist";
export default {
components: { functional, orderlist },
data() {
return {
orderTitle: "进度汇报",
orderindex: 0,
listLength: 0, //工单数量
starmodal: true,
orderlistMode: false,
functionalMode: false,
gdId: 0,
detail: null,
row: {},
odermodel: -9,
orderId: this.$route.query.id,
condition: [],
inputId: null,
asc: true,
ascTitle: "时间正序排序",
statu: -9,
refresh: true
};
},
created() {
let row = {};
row.id = this.$route.query.id;
row.orderId = this.$route.query.orderId;
row.executeId = this.$route.query.executeId;
row.headid=this.$route.query.headid;
row.routingdetailId=this.$route.query.routid;
this.row = row;
this.inputId = this.$route.query.id;
this.detail = () => import("./starOrder/index");
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
mounted() {},
comments: {},
methods: {
// getListLength(len){ this.listLength = len },
// 返回工单列表
goToOrder() {
this.$router.push("/produce/orderlist");
components: {
functional,
orderlist
},
searchOrder(value) {
if (value == null || typeof value == "undefined") {
value = -9;
}
this.statu = value;
// this.$refs.orderlistref.loadTree(value);
data() {
return {
orderTitle: "进度汇报",
orderindex: 0,
listLength: 0, //工单数量
starmodal: true,
orderlistMode: false,
functionalMode: false,
gdId: 0,
detail: null,
row: {},
odermodel: -9,
orderId: this.$route.query.id,
condition: [],
inputId: null,
asc: true,
ascTitle: "时间正序排序",
statu: -9,
refresh: true
};
},
changeTitle(number, type) {
this.orderTitle = type;
this.orderindex = number;
if (number == 0) {
created() {
let row = {};
row.id = this.$route.query.id;
row.orderId = this.$route.query.orderId;
row.executeId = this.$route.query.executeId;
row.headid = this.$route.query.headid;
row.routingdetailId = this.$route.query.routid;
row.mesCode = this.$route.query.mesCode;
row.productName = this.$route.query.productName;
row.drawnNumber = this.$route.query.drawnNumber;
row.count = this.$route.query.quantity;
this.row = row;
this.inputId = this.$route.query.id;
this.detail = () => import("./starOrder/index");
} //进度汇报
if (number == 1) {
this.$Message.info("尊敬的用户,您没有该权限!");
// this.detail = () => import("./MaterialCollec/index");
} //物料领用
if (number == 2) {
// this.detail = () => import("./productSet/index");
this.$Message.info("尊敬的用户,您没有该权限!");
} //产品装配
if (number == 3) {
this.detail = () => import("./taskTime/index");
} //工时分配
if (number == 4) {
this.$Message.info("尊敬的用户,您没有该权限!");
// this.detail = () => import("./preparation/index");
} //生产准备
if (number == 5) {
this.detail = () => import("./ProcessCheck/index");
} //工艺查看
if (number == 6) {
this.detail = () => import("./ProcessCase/index");
} //工艺案例
if (number == 7) {
this.detail = () => import("./judgment/index");
} //质量判定
if (number == 8) {
this.detail = () => import("./datafilling/index");
} //数据填报
if (number == 10) {
this.detail = () => import("./datafilling/check");
} //质量检验
if (number == 9) {
// this.$Message.info("尊敬的用户,您没有该权限!");
// this.detail = () => import("./testdata/index");
} //测试数据
},
//按时间排序按钮
changeAsc() {
this.asc = !this.asc;
if (this.asc) {
this.ascTitle = "时间正序排序";
} else {
this.ascTitle = "时间倒序排序";
}
async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
//刷新orderlist列表
changeFresh() {
this.refresh = !this.refresh;
this.orderlistMode = true;
}
},
watch: {
"$route.query.id"(v) {
this.row.id = v;
this.inputId = v;
this.detail = () => import("./starOrder/index");
mounted() {},
comments: {},
methods: {
// getListLength(len){ this.listLength = len },
// 返回工单列表
goToOrder() {
this.$router.push("/produce/orderlist");
},
searchOrder(value) {
if (value == null || typeof value == "undefined") {
value = -9;
}
this.statu = value;
// this.$refs.orderlistref.loadTree(value);
},
changeTitle(number, type) {
this.orderTitle = type;
this.orderindex = number;
if (number == 0) {
this.detail = () => import("./starOrder/index");
} //进度汇报
if (number == 1) {
this.detail = () => import("./MaterialCollec/index");
} //物料领用
if (number == 2) {
// this.detail = () => import("./productSet/index");
this.$Message.info("尊敬的用户,您没有该权限!");
} //产品装配
if (number == 3) {
this.detail = () => import("./taskTime/index");
} //工时分配
if (number == 4) {
this.$Message.info("尊敬的用户,您没有该权限!");
// this.detail = () => import("./preparation/index");
} //生产准备
if (number == 5) {
this.detail = () => import("./ProcessCheck/index");
} //工艺查看
if (number == 6) {
this.detail = () => import("./ProcessCase/index");
} //工艺案例
if (number == 7) {
this.detail = () => import("./judgment/index");
} //质量判定
if (number == 8) {
this.detail = () => import("./datafilling/index");
} //数据填报
if (number == 10) {
this.detail = () => import("./datafilling/check");
} //质量检验
if (number == 9) {
// this.$Message.info("尊敬的用户,您没有该权限!");
// this.detail = () => import("./testdata/index");
} //测试数据
},
//按时间排序按钮
changeAsc() {
this.asc = !this.asc;
if (this.asc) {
this.ascTitle = "时间正序排序";
} else {
this.ascTitle = "时间倒序排序";
}
},
//刷新orderlist列表
changeFresh() {
this.refresh = !this.refresh;
this.orderlistMode = true;
}
},
watch: {
"$route.query.id"(v) {
this.row.id = v;
this.inputId = v;
this.detail = () => import("./starOrder/index");
}
}
}
};
</script>
......@@ -232,6 +232,9 @@ div::-webkit-scrollbar-corner {
.mr30 {
margin-right: 30px;
}
.mr40 {
margin-right: 40px;
}
.mtb10 {
margin: 10px 0;
}
......
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