Commit 1c4d984b authored by renjintao's avatar renjintao

物料领用ing

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