Commit b81efa96 authored by 仇晓婷's avatar 仇晓婷

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

parents 91060729 6d4133a0
......@@ -314,7 +314,15 @@ div::-webkit-scrollbar-corner {
.pt10 {
padding: 10px 0px 0;
}
.pb5 {
padding-bottom: 5px;
}
.pb10 {
padding-bottom: 10px;
}
.pb20 {
padding-bottom: 20px;
}
.ptb5 {
padding-top: 5px;
padding-bottom: 5px;
......@@ -324,6 +332,7 @@ div::-webkit-scrollbar-corner {
padding: 10px;
}
.p10 {
padding: 10px;
}
......@@ -335,6 +344,12 @@ div::-webkit-scrollbar-corner {
.pl30 {
padding-left: 30px
}
.pl40 {
padding-left: 40px
}
.pl50 {
padding-left: 50px
}
.pl5 {
padding-left: 5px
......
<template>
<div class="h100 table-content">
<p class="mb10">
订单编号:{{mesCodes}}
<span class="ml20">产品名称:{{productNames}}</span>
<span class="ml20">生产数量:{{counts}}</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.materialCount"
: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)" />
</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>
<Button @click="cancelBatch" v-show="false">取消</Button>
</FooterToolbar>
</div>
</template>
<script>
import Api from "./api";
export default {
name: "addAccessory",
data() {
return {
disabled: false,
deletelModal: false,
curId: 0,
editIndex: -1,
editNum: "",
cols: [
{
type: "selection",
width: 70,
align: "center",
},
{
key: "routingDetailNo",
title: "工序号",
align: "left",
},
{
key: "routingDetailName",
title: "工序",
align: "left",
},
{
key: "nameMaterial",
title: "物料名",
align: "left",
},
{
key: "materialNumber",
title: "物料编号",
align: "left",
},
{
key: "materialCount",
title: "需求数量",
align: "left",
},
{
key: "counts",
title: "申请数量",
align: "right",
slot: "counts",
width: 120,
},
{
key: "remarks",
title: "备注",
align: "left",
slot: "remarks",
},
],
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",
},
],
},
tempList: [],
cRow: null,
cArr: [],
};
},
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.matchlist({ id: v }).then((r) => {
if (r.success) {
r.result.forEach((e) => {
let i = 0;
e.suport.forEach((el) => {
el.count = el.materialCount;
el._checked = true;
el._index = i++;
//el._disabled=true
});
});
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
}
});
},
l(key) {
let vkey = "plan_resource" + "." + key;
return this.$t(vkey) || key;
},
getTimeQuotationFD(value) {
this.orderForm.QuotationFinishDate =
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) {
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) => {
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);
});
}
// 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) {
this.curArr = 4;
},
delById(arr, id) {
//取消删除某行数据
arr.forEach((element) => {
if (element.id == id) {
if (arr.indexOf(element) > -1) {
var i = arr.indexOf(element);
arr.splice(i, 1);
}
}
});
return arr;
},
delSame(arr) {
//数组根据id去重复
var newArr = [];
var arrId = [];
for (var item of arr) {
if (arrId.indexOf(item["id"]) == -1) {
arrId.push(item["id"]);
newArr.push(item);
}
}
return newArr;
},
delByHeadId(arr, id) {
//根据工艺规程id进行去除过滤
let arrs = arr.filter((item, i) => {
return item.routingHeaderId != id;
});
return arrs;
},
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.materialCount,
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,
};
if (parms.items.length == 0) {
this.$Message.error("请输入申请数量");
} else {
Api.supportmainCreate(parms).then((res) => {
if (res.success) {
this.$Message.success("申请成功");
//this.$emit("cancel");
this.$emit('on-ok')
}
});
}
}
});
},
cancelBatch() {
//取消选择
this.selectItems = [];
let temd = this.$u.clone(this.datas);
temd.forEach((res) => {
this.$refs["table" + res.routingHeaderId][0].selectAll(false);
});
this.footerToolbar = false;
},
},
watch: {
eid(v) {
if (v != 0) {
this.load(v);
}
},
},
};
</script>
......@@ -36,5 +36,22 @@ export default {
},
moveintoai(){////跳转进入智能排产池前判断
return Api.post(`${PlanUrl}/messchedule/moveintoai`);
}
},
//配套相关
matchlist(params){//申请配套列表
return Api.get(`${technologyUrl}materiallist/matchlist`, params);
},
supportmainPaged(params){////配套记录
return Api.post(`${technologyUrl}supportmain/paged`, params);
},
supportmainCreate(params){////保存配套
return Api.post(`${technologyUrl}supportmain/create`, params);
},
groupitemlist(params){//申请单列表
return Api.post(`${technologyUrl}supportmain/groupitemlist`, params);
},
batchdelete(params){//批量撤回
return Api.post(`${technologyUrl}supportitem/batchdelete`, params);
},
}
\ No newline at end of file
<template>
<div class="h100 table-content">
<p class="mb10">
订单编号:{{mesCodes}}
<span class="ml20">产品名称:{{productNames}}</span>
<span class="ml20">生产数量:{{counts}}</span>
</p>
<Layout>
<Content>
<div class="mb20" v-for="(item,index) in datas" :key="index">
<p class="fwBold" :id="'item'+index">
齐套日期:{{item.finishDate}}
<span class="ml20">申请人:{{item.creator}}</span>
<span class="ml20">申请时间:{{item.applyTime}}</span>
</p>
<Table border :columns="cols" :data="item.children" class="tableCommon"></Table>
<Button type="primary" class="mt10" @click="application(1,item.children)" size="large">撤回</Button>
</div>
</Content>
<Sider hide-trigger style="background:#fff;color:black;" width="300">
<Collapse value="1" class="mt20" style="position:fixed;width:260px">
<Panel name="1">
申请记录
<div slot="content" class="pl30 pb10 lh25">
<p v-for="(items,i) in datas" :key="i">
<a :href="'#item'+i">
<span>{{items.applyTime.substring(0,10)}}</span>
<span class="fr mr10">{{items.creator}}</span>
</a>
</p>
</div>
</Panel>
</Collapse>
</Sider>
</Layout>
</div>
</template>
<script>
import Api from "./api";
export default {
name: "detailAccessory",
data() {
return {
disabled: false,
deletelModal: false,
curId: 0,
editIndex: -1,
editNum: "",
cols: [
{
key: "materialName",
title: "物料名",
align: "left",
},
{
key: "materialNumber",
title: "物料编号",
align: "left",
},
{
key: "needCount",
title: "需求数量",
align: "right",
},
{
key: "count",
title: "申请数量",
align: "right",
width: 120,
},
{
key: "counts",
title: "状态",
align: "center",
width: 120,
},
{
key: "remark",
title: "备注",
align: "left",
},
{
key: "action",
title: "状态",
width: 120,
align: "center",
render: (h, params) => {
return h("div", { class: "action" }, [
h(
"op",
{
attrs: {
oprate: "detail",
},
on: {
click: () => this.application(0, params.row),
},
},
"撤回"
),
]);
},
},
],
datas: [],
selectItems: [],
footerToolbar: false,
orderId: this.eid,
mesCodes: this.mesCode,
productNames: this.productName,
drawnNumbers: this.drawnNumber,
counts: this.count,
};
},
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.groupitemlist({ id: v }).then((r) => {
if (r.success) {
this.datas = r.result;
}
});
},
application(type, arr) {//撤回配套申请 type:0 单条 1 全部
let parms = [];
if (type == 0) {
parms.push(arr.id);
} else {
arr.forEach((ele) => {
parms.push(ele.id);
});
}
Api.batchdelete(parms).then(res=>{
if(res.success&&res.result)
{
this.$Message.success("撤销成功");
this.$emit('on-ok')
}
})
},
},
watch: {
eid(v) {
if (v != 0) {
this.load(v);
}
},
},
};
</script>
......@@ -98,16 +98,16 @@
-->
<RadioGroup v-model="scheduleType" class="radioList" @on-change="onchangeScheduleType">
<Radio :label="1" border :disabled="this.$store.state.countAi>0">
<span >Aps排产</span>
<span>Aps排产</span>
</Radio>
<Radio :label="4" border :disabled="this.$store.state.countAps>0">
<span >智能排产</span>
<span>智能排产</span>
</Radio>
<Radio :label="2" border>
<span >整机排产</span>
<span>整机排产</span>
</Radio>
<Radio :label="3" border>
<span >流水排产</span>
<span>流水排产</span>
</Radio>
</RadioGroup>
<p class="pl30 pt10" v-show="scheduleType!=null">
......@@ -125,6 +125,18 @@
<Modal v-model="orderSupportModal" title="配套下发" footer-hide width="1300">
<orderSupport ref="orderSupport"></orderSupport>
</Modal>
<Modal v-model="modalAccessory" :title="title" fullscreen footer-hide>
<component
:is="details"
:eid="orderId"
:mesCode="mesCode"
:productName="productName"
:drawnNumber="drawnNumber"
:count="count"
@on-close="cancel"
@on-ok="addOk"
/>
</Modal>
</div>
</template>
<script>
......@@ -162,6 +174,20 @@ export default {
scheduleModal: false,
orderSupportModal: false,
curId: 0,
statuList:
this.$store.getters.dictionaryByKey("aps.plan.supportingStatus") || [],
name: "",
items: null,
title: "",
details: null,
uId: "",
hid: 0,
orderId: 0,
mesCode: "",
productName: "",
drawnNumber: "",
count: 0,
modalAccessory: false,
columns: [
{
key: "selection",
......@@ -203,8 +229,23 @@ export default {
key: "isSupportingFinish",
title: this.l("isSupportingFinish"),
align: "center",
high: true,
code: "aps.plan.supportingStatus",
render: (h, params) => {
return h(
"op",
{
attrs: {
oprate: "detail",
},
style: {
color: this.setName(params.row.isSupportingFinish).color,
},
on: {
click: () => this.openAccessory(params.row),
},
},
this.setName(params.row.isSupportingFinish).name
);
},
},
{
key: "projectNumber",
......@@ -611,6 +652,7 @@ export default {
this.listBatchIds = [];
this.listBatchIds1 = [];
this.canselFooter();
this.modalAccessory = false;
},
search() {
this.$refs.grid.reload(this.easySearch);
......@@ -623,7 +665,6 @@ export default {
this.editModal = true;
this.curId = id;
},
remove(id) {
this.deletelModal = true;
this.curId = id;
......@@ -649,6 +690,7 @@ export default {
//aps
this.dispatchModal = false;
this.scheduleModal = false;
this.modalAccessory = false;
// this.listBatchIds = []
// this.listBatchIds1 = []
// this.canselFooter()
......@@ -742,6 +784,49 @@ export default {
this.$Message.error("获取排产模型数量失败");
});
},
//配套申请
setName(v) {
let outPar = {
name: "",
color: "",
};
if ((v + "").indexOf(",") == -1) {
var item;
this.statuList.map((u) => {
if (u.code == v) {
item = u;
}
});
if (item) {
//this.items = item;
outPar = {
name: item.name,
color: item.color,
};
}
}
return outPar;
},
openAccessory(row) {
this.orderId = row.id;
this.mesCode = row.mesCode;
this.productName = row.productName;
this.drawnNumber = row.drawnNumber;
this.count = row.quantity;
if (row.isSupportingFinish == 0) {
this.title = "申请配套";
this.details = () => import("./addAccessory");
} else {
this.title = "申请单";
this.details = () => import("./detailAccessory");
}
this.modalAccessory = true;
},
ok() {
this.modalAccessory = false;
this.curId = 0;
},
},
};
</script>
......
......@@ -242,6 +242,15 @@ div::-webkit-scrollbar-corner {
.pt10 {
padding: 10px 0px 0;
}
.pb5 {
padding-bottom: 5px;
}
.pb10 {
padding-bottom: 10px;
}
.pb20 {
padding-bottom: 20px;
}
.ptb5 {
padding-top: 5px;
padding-bottom: 5px;
......@@ -258,6 +267,12 @@ div::-webkit-scrollbar-corner {
.pl30 {
padding-left: 30px;
}
.pl40 {
padding-left: 40px;
}
.pl50 {
padding-left: 50px;
}
.pl5 {
padding-left: 5px;
}
......
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