Commit 869ad06e authored by 仇晓婷's avatar 仇晓婷

Merge branch 'product' of http://git.mes123.com/zhouyx/mes-ui into product

parents 7c454632 46e9df6b
......@@ -360,7 +360,7 @@ export default {
productName: '产品名称',
quantity: '计划数量',
productQuantity: '合格数量',
qualifiedQuantity:'合格数量',
qualifiedQuantity: '合格数量',
actualFinishDate: '完成时间',
productingPreparationPeople: '承制单位',
uncertificateQuantity: '待开具数量',
......@@ -1569,9 +1569,54 @@ export default {
unitPrice: '单价',
originalManufacturer: '原厂家',
remark: '备注',
materialCode:'物料编码',
materialCode: '物料编码',
},
stock_item:{
stock_item: {
creationTime: '创建时间',
creatorUserId: '创建人',
lastModificationTime: '更新时间',
lastModifierUserId: '更新人',
isDeleted: '删除人',
deletionTime: '删除时间',
deleterUserId: '删除人',
name: '名称',
materialType: '类型',
brand: '牌号',
specifications: '规格',
originalManufacturer: '原厂家',
batch: '批次',
unitPrice: '单价',
certificateOfApproval: '合格证',
storeId: '',
storeTitle: '库位',
creator: '',
stockId: '物料库存主键',
total: '入库数量',
remark: '备注',
code: '入库编号',
materialId: '物料id',
materialCode: '物料编码',
nowTotal: '剩余数量',
},
support_main: {
creationTime: '创建时间',
creatorUserId: '创建人',
lastModificationTime: '更新时间',
lastModifierUserId: '更新人',
isDeleted: '删除人',
deletionTime: '删除时间',
deleterUserId: '删除人',
orderId: '订单id',
productName: '产品名称',
drawnNumber: '图号',
count: '订单数量',
creator: '申请人',
status: '状态',
finishDate: '齐套时间',
orderCode: '订单编号',
code: '申请单号',
},
support_item:{
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
......@@ -1579,23 +1624,22 @@ export default {
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
name:'名称',
materialType:'类型',
brand:'牌号',
specifications:'规格',
originalManufacturer:'原厂家',
batch:'批次',
unitPrice:'单价',
certificateOfApproval:'合格证',
storeId:'',
storeTitle:'库位',
creator:'',
stockId:'物料库存主键',
total:'入库数量',
remark:'备注',
code:'入库编号',
supportMainId:'主表id',
routingHeaderId:'工艺id',
routingDeatilId:'工序id',
routingDetailName:'工序',
routingDetailSeq:'工序号',
routingDetailNo:'工序号',
count:'申请数量',
status:'状态',
materialId:'物料id',
materialCode:'物料编码',
nowTotal:'剩余数量',
materialName:'物料名称',
nameMaterial:'物料名称',
materialNumber:'物料编号',
needCount:'需要数量',
totalCount:'需要数量',
outStockNumber:'出库数量',
orderId:'',
remark:'备注',
}
}
......@@ -23,14 +23,14 @@
>
<template slot-scope="{ row, index }" slot="counts">
<InputNumber
:max="row.materialCount"
:max="row.totalCount"
:min="0"
v-model="row.count"
@on-blur="inputChange1(i,row,index)"
/>
</template>
<template slot-scope="{ row, index }" slot="remarks">
<Input type="text" v-model="row.remarks" @on-blur="inputChange1(i,row,index)" />
<Input type="text" v-model="row.remark" @on-blur="inputChange1(i,row,index)" />
</template>
</Table>
</div>
......@@ -72,39 +72,39 @@ export default {
},
{
key: "routingDetailNo",
title: "工序号",
title: this.l("routingDetailNo"),
align: "left",
},
{
key: "routingDetailName",
title: "工序",
title: this.l("routingDetailName"),
align: "left",
},
{
key: "nameMaterial",
title: "物料名",
title: this.l("nameMaterial"),
align: "left",
},
{
key: "materialNumber",
title: "物料编号",
title: this.l("materialNumber"),
align: "left",
},
{
key: "materialCount",
title: "需求数量",
key: "totalCount",
title: this.l("totalCount"),
align: "left",
},
{
key: "counts",
title: "申请数量",
key: "count",
title: this.l("count"),
align: "right",
slot: "counts",
width: 120,
},
{
key: "remarks",
title: "备注",
key: "remark",
title: this.l("remark"),
align: "left",
slot: "remarks",
},
......@@ -155,14 +155,13 @@ export default {
r.result.forEach((e) => {
let i = 0;
e.suport.forEach((el) => {
el.count = el.materialCount;
el.count = el.totalCount;
el._checked = true;
el._index = i++;
//el._disabled=true
});
});
this.datas = r.result;
//----测试多个工艺start
//----测试多个工艺start----
// let temre = this.$u.clone(r.result);
// temre.forEach((ele) => {
// ele.routingHeaderId = 281;
......@@ -173,15 +172,10 @@ export default {
// });
// });
// this.datas = r.result.concat(temre);
//----测试多个工艺end
//----测试多个工艺end----
}
});
},
l(key) {
let vkey = "plan_resource" + "." + key;
return this.$t(vkey) || key;
},
getTimeQuotationFD(value) {
this.orderForm.QuotationFinishDate =
value != "" ? this.getFormatDateEnd(value) : value;
......@@ -222,44 +216,16 @@ export default {
this.$set(this.datas[v].suport, index, ele);
});
}
// if (this.curArr.length == 0) {
// //取消全部时
// let temc = this.$u.clone(this.selectItems);
// let temb = this.delByHeadId(temc, v);
// this.selectItems = [];
// this.selectItems = temb;
// this.footerToolbar = this.selectItems.length > 0;
// //alert("this.selectAllCancel___" + JSON.stringify(this.selectItems));
// }
},
selectList(items, row) {
this.curArr = 1;
//this.selectItems.push(row);
// alert("this.selectItems___" + JSON.stringify(this.selectItems));
//this.footerToolbar = this.selectItems.length > 0;
this.cRow = row;
},
selectListAll(items) {
this.curArr = 2;
// let tema = this.selectItems.concat(items);
// let temo = this.delSame(tema);
// this.selectItems = [];
// this.selectItems = temo;
//alert("this.selectListAlls___" + JSON.stringify(this.selectItems));
// this.footerToolbar = this.selectItems.length > 0;
},
selectListCancel(items, row) {
this.curArr = 3;
// let tempSelectItems = this.$u.clone(this.selectItems);
//let delId = row.id;
// let arrs = this.delById(tempSelectItems, delId);
// this.selectItems = [];
// this.selectItems = arrs;
//alert("this.selectListCancel___" + JSON.stringify(this.selectItems));
//this.footerToolbar = this.selectItems.length > 0;
// this.$set(this.datas[i].suport, index, row);
this.cRow = row;
},
selectAllCancel(items) {
......@@ -317,7 +283,7 @@ export default {
materialId: ele.materialId,
materialName: ele.nameMaterial,
materialNumber: ele.materialNumber,
needCount: ele.materialCount,
needCount: ele.totalCount,
count: ele.count, //
remark: ele.remark ? ele.remark : "",
};
......@@ -343,7 +309,7 @@ export default {
if (res.success) {
this.$Message.success("申请成功");
//this.$emit("cancel");
this.$emit('on-ok')
this.$emit("on-ok");
}
});
}
......@@ -359,6 +325,10 @@ export default {
});
this.footerToolbar = false;
},
l(key) {
let vkey = "support_item" + "." + key;
return this.$t(vkey) || key;
},
},
watch: {
eid(v) {
......
......@@ -53,5 +53,9 @@ export default {
batchdelete(params){//批量撤回
return Api.post(`${technologyUrl}supportitem/batchdelete`, params);
},
matchdetaillist(params){//配套审核单列表
return Api.get(`${technologyUrl}materiallist/matchdetaillist`, params);
},
}
\ No newline at end of file
......@@ -19,13 +19,13 @@
</div>
</Content>
<Sider hide-trigger style="background:#fff;color:black;" width="300">
<Collapse value="1" class="mt20" style="position:fixed;width:260px">
<Collapse value="1" class="mt20 ml20" style="position:fixed;width:260px">
<Panel name="1">
申请记录
<div slot="content" class="pl30 pb10 lh25">
<div slot="content" class="pl20 pb10 lh25">
<p v-for="(items,i) in datas" :key="i">
<a :href="'#item'+i">
<span>{{items.applyTime.substring(0,10)}}</span>
<span>{{items.applyTime}}</span>
<span class="fr mr10">{{items.creator}}</span>
</a>
</p>
......@@ -50,39 +50,39 @@ export default {
cols: [
{
key: "materialName",
title: "物料名",
title: this.l("materialName"),
align: "left",
},
{
key: "materialNumber",
title: "物料编号",
title: this.l("materialNumber"),
align: "left",
},
{
key: "needCount",
title: "需求数量",
title: this.l("needCount"),
align: "right",
},
{
key: "count",
title: "申请数量",
title: this.l("count"),
align: "right",
width: 120,
},
{
key: "counts",
title: "状态",
key: "status",
title: this.l("status"),
align: "center",
width: 120,
},
{
key: "remark",
title: "备注",
title: this.l("remark"),
align: "left",
},
{
key: "action",
title: "状态",
title: "操作",
width: 120,
align: "center",
render: (h, params) => {
......@@ -148,10 +148,15 @@ export default {
if(res.success&&res.result)
{
this.$Message.success("撤销成功");
this.load(this.eid);
this.$emit('on-ok')
}
})
},
l(key) {
let vkey = "support_item" + "." + key;
return this.$t(vkey) || key;
},
},
watch: {
eid(v) {
......
<template>
<div class="h100 table-content">
<p class="mb10">
订单编号:{{mesCodes}}
<span class="ml20">产品名称:{{productNames}}</span>
<span class="ml20">生产数量:{{counts}}</span>
<span class="fr mr20">
<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-blur="inputChange1(i,row,index)"
:disabled="row._disabled"
/>
</template>
<template slot-scope="{ row, index }" slot="remarks">
<Input
type="text"
v-model="row.remark"
@on-blur="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>
<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"
/>
</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>
</Modal>
</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",
},
{
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("count"),
align: "right",
slot: "counts",
width: 120,
},
{
key: "outStockNumber",
title: this.l("outStockNumber"),
align: "right",
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) {
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 = {
main: {
orderId: this.orderId,
productName: this.productNames,
drawnNumber: this.drawnNumbers,
count: this.counts,
creator: this.$store.state.userInfo.userName,
finishDate: this.orderForm.QuotationFinishDate,
},
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,
},
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>
......@@ -244,8 +244,8 @@ export default {
},
},
this.setName(params.row.isSupportingFinish).name
);
},
)
}
},
{
key: "projectNumber",
......@@ -805,7 +805,7 @@ export default {
};
}
}
return outPar;
return outPar
},
openAccessory(row) {
this.orderId = row.id;
......@@ -817,8 +817,8 @@ export default {
this.title = "申请配套";
this.details = () => import("./addAccessory");
} else {
this.title = "申请单";
this.details = () => import("./detailAccessory");
this.title = "配套清单";
this.details = () => import("./editAccessory");
}
this.modalAccessory = true;
......
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