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

复验ok

parent 7df5be74
<template> <template>
<div class="h100 table-content1"> <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="mb70" v-for="(item,i) in datas" :key="i"> <div class="mb70" v-for="(item, i) in datas" :key="i">
<p class="fwBold">{{item.routingHeader}}------{{item.routingHeaderCode}}</p> <p class="fwBold">
<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"> {{ item.routingHeader }}------{{ item.routingHeaderCode }}
<template slot-scope="{ row, index }" slot="counts"> </p>
<InputNumber :max="row.totalCount-row.applicationNumber" :min="0" v-model="row.count" @on-change="inputChange1(i,row,index)" :disabled="row._disabled" /> <Table
</template> border
<template slot-scope="{ row, index }" slot="remarks"> :columns="cols"
<Input type="text" v-model="row.remark" @on-change="inputChange1(i,row,index)" :disabled="row._disabled" /> :data="item.suport"
</template> :ref="'table' + item.routingHeaderId"
</Table> 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> </div>
<FooterToolbar v-show="footerToolbar" class="ftball pt10"> <FooterToolbar v-show="footerToolbar" class="ftball pt10">
<!--<div class="tip">已选{{selectItems.length}}项</div>--> <!--<div class="tip">已选{{selectItems.length}}项</div>-->
<Form :model="orderForm" :inline="true" :label-width="0" ref="formValidate" :rules="ruleValidate"> <Form
<FormItem prop="QuotationFinishDate"> :model="orderForm"
<DatePicker v-model="orderForm.QuotationFinishDate" type="date" style="color:black" placeholder="请选择齐套日期" @on-change="getTimeQuotationFD"></DatePicker> :inline="true"
</FormItem> :label-width="0"
<FormItem l><Button type="primary" class="mr10 ml10" @click="application">申请配套</Button></FormItem> ref="formValidate"
</Form> :rules="ruleValidate"
>
<FormItem prop="QuotationFinishDate">
<DatePicker
v-model="orderForm.QuotationFinishDate"
type="date"
style="color: black"
placeholder="请选择齐套日期"
@on-change="getTimeQuotationFD"
></DatePicker>
</FormItem>
<FormItem l
><Button type="primary" class="mr10 ml10" @click="application"
>申请配套</Button
></FormItem
>
</Form>
</FooterToolbar> </FooterToolbar>
<Modal v-model="modalAccessoryList" :title="title" fullscreen footer-hide> <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>
<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
<Row> :model="entity"
<Col span="12"> :label-width="110"
<FormItem label="工序">{{entity.routingDetailName}}</FormItem> ref="formValidateSet"
</Col> :rules="ruleValidate"
<Col span="12"> >
<FormItem label="物料名">{{entity.materialName}}</FormItem> <Row>
</Col> <Col span="12">
<Col span="12"> <FormItem label="工序">{{ entity.routingDetailName }}</FormItem>
<FormItem label="物料编号">{{entity.materialNumber}}</FormItem> </Col>
</Col> <Col span="12">
<Col span="12"> <FormItem label="物料名">{{ entity.materialName }}</FormItem>
<FormItem label="需求数量">{{entity.needCount}}</FormItem> </Col>
</Col> <Col span="12">
<Col span="12"> <FormItem label="物料编号">{{ entity.materialNumber }}</FormItem>
<FormItem label="已申请">{{entity.applicationNumber}}</FormItem> </Col>
</Col> <Col span="12">
<Col span="12"> <FormItem label="需求数量">{{ entity.needCount }}</FormItem>
<FormItem label="可再申请" prop="count"> </Col>
<InputNumber :max="entity.needCount-entity.applicationNumber" :min="0" v-model="entity.count" /> <Col span="12">
</FormItem> <FormItem label="已申请">{{ entity.applicationNumber }}</FormItem>
</Col> </Col>
<Col span="12"> <Col span="12">
<FormItem label="齐套日期" prop="finishDate"> <FormItem label="可再申请" prop="count">
<DatePicker v-model="entity.finishDate" type="date" placeholder="请选择齐套日期" @on-change="getTimeFinish"></DatePicker> <InputNumber
</FormItem> :max="entity.needCount - entity.applicationNumber"
</Col> :min="0"
<Col span="24"> v-model="entity.count"
<FormItem label="备注"> />
<Input type="text" v-model="entity.remark" /> </FormItem>
</FormItem> </Col>
</Col> <Col span="12">
<Col span="24"> <FormItem label="齐套日期" prop="finishDate">
<p class="fr"> <DatePicker
<Button type="primary" class="mr10 ml10" @click="application1">申请配套</Button> v-model="entity.finishDate"
<Button @click="canelSet">取消</Button> type="date"
</p> placeholder="请选择齐套日期"
</Col> @on-change="getTimeFinish"
</Row> ></DatePicker>
</Form> </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> </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", {
width: 70, type: "selection",
align: "center", 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
}
});
}, },
getTimeQuotationFD(value) { {
this.orderForm.QuotationFinishDate = key: "routingDetailNo",
value != "" ? this.getFormatDateEnd(value) : value; title: this.l("routingDetailNo"),
align: "left",
}, },
getTimeFinish(value) { {
this.entity.finishDate = key: "routingDetailName",
value != "" ? this.getFormatDateEnd(value) : value; title: this.l("routingDetailName"),
align: "left",
}, },
getFormatDateEnd(dates) { {
const d = new Date(dates); key: "nameMaterial",
const resDate = title: this.l("nameMaterial"),
d.getFullYear() + align: "left",
"-" +
this.p(d.getMonth() + 1) +
"-" +
this.p(d.getDate()) +
" 23:59:59";
return resDate;
}, },
p(s) { {
return s < 10 ? "0" + s : s; key: "materialNumber",
title: this.l("materialNumber"),
align: "left",
}, },
selectionChange(v) { {
//根据状态修改this.datas数组数据 key: "totalCount",
if (this.curArr == 3) { title: this.l("totalCount"),
//单条取消选择 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) { {
this.curArr = 1; key: "count",
this.cRow = row; title: this.l("count1"),
align: "right",
slot: "counts",
width: 120,
}, },
selectListAll(items) { {
this.curArr = 2; key: "remark",
title: this.l("remark"),
align: "left",
slot: "remarks",
}, },
selectListCancel(items, row) { {
this.curArr = 3; key: "action",
this.cRow = row; title: "操作",
}, align: "center",
selectAllCancel(items) { width: "120",
this.curArr = 4; render: (h, params) => {
}, return h(
inputChange1(i, row, index) { "op",
//输入数量 {
this.$set(this.datas[i].suport, index, row); attrs: {
oprate: "detail",
},
on: {
click: () => this.setAcc(params.row),
},
},
params.row._disabled &&
params.row.totalCount - params.row.applicationNumber > 0
? "临时申请"
: ""
);
},
}, },
application() { ],
//申请配套操作 orderForm: {
this.$refs["formValidate"].validate((valid) => { QuotationFinishDate: "",
if (valid) { },
let temItems = []; datas: [],
let temSelectItems = this.$u.clone(this.datas); selectItems: [],
temSelectItems.forEach((e) => { footerToolbar: true,
e.suport.forEach((ele) => { orderId: this.eid,
if (ele._checked && ele.count > 0) { mesCodes: this.mesCode,
let temObj = { productNames: this.productName,
routingHeaderId: ele.routingHeaderId, drawnNumbers: this.drawnNumber,
routingDeatilId: ele.routingDetailId, counts: this.count,
routingDetailName: ele.routingDetailName, curArr: 0, //标记当前操作工艺规程列表是否为空
routingDetailSeq: ele.routingDetailNo, ruleValidate: {
materialId: ele.materialId, QuotationFinishDate: [
materialName: ele.nameMaterial, {
materialNumber: ele.materialNumber, required: true,
needCount: ele.totalCount, message: "_",
count: ele.count, // trigger: "change",
remark: ele.remark ? ele.remark : "", },
}; ],
temItems.push(temObj); finishDate: [
} {
}); required: true,
}); message: "请选择齐套日期",
let parms = { trigger: "change",
main: { },
orderId: this.orderId, ],
productName: this.productNames, count: [
drawnNumber: this.drawnNumbers, {
count: this.counts, required: true,
creator: this.$store.state.userInfo.userName, message: "请输入申请数量",
finishDate: this.orderForm.QuotationFinishDate, type: "number",
orderCode: this.mesCode, trigger: "change",
}, },
items: temItems, ],
}; },
//alert(JSON.stringify(parms.items)); tempList: [],
if (parms.items.length == 0) { cRow: null,
this.$Message.error("请输入申请数量"); cArr: [],
} else { entity: {
Api.supportmainCreate(parms).then((res) => { routingHeaderId: null,
if (res.success) { routingDeatilId: null,
this.$Message.success("申请成功"); routingDetailName: "",
this.$emit("on-ok"); 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,
productingPreparationPeople: 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++;
}); });
}, });
application1() { this.datas = r.result;
//临时申请配套操作 //----测试多个工艺start
this.$refs["formValidateSet"].validate((valid) => { // let temre = this.$u.clone(r.result);
if (valid) { // temre.forEach((ele) => {
let temItems = []; // ele.routingHeaderId = 281;
let temObj = { // ele.suport.forEach((eles) => {
routingHeaderId: this.entity.routingHeaderId, // eles.routingHeaderId = 281;
routingDeatilId: this.entity.routingDeatilId, // eles.id = eles.id + 20;
routingDetailName: this.entity.routingDetailName, // eles.nameMaterial = eles.nameMaterial + "tttt";
routingDetailSeq: this.entity.routingDetailSeq, // });
materialId: this.entity.materialId, // });
materialName: this.entity.materialName, // this.datas = r.result.concat(temre);
materialNumber: this.entity.materialNumber, //----测试多个工艺end
needCount: this.entity.needCount, }
count: this.entity.count, });
remark: this.entity.remark, },
}; getTimeQuotationFD(value) {
temItems.push(temObj); this.orderForm.QuotationFinishDate =
let parms = { value != "" ? this.getFormatDateEnd(value) : value;
main: { },
orderId: this.orderId, getTimeFinish(value) {
productName: this.productNames, this.entity.finishDate =
drawnNumber: this.drawnNumbers, value != "" ? this.getFormatDateEnd(value) : value;
count: this.counts, },
creator: this.$store.state.userInfo.userName, getFormatDateEnd(dates) {
finishDate: this.entity.finishDate, const d = new Date(dates);
orderCode: this.mesCode, const resDate =
}, d.getFullYear() +
items: temItems, "-" +
}; this.p(d.getMonth() + 1) +
//alert(JSON.stringify(parms)); "-" +
this.p(d.getDate()) +
Api.supportmainCreate(parms).then((res) => { " 23:59:59";
if (res.success) { return resDate;
this.$Message.success("申请成功"); },
this.canelSet(); p(s) {
this.load(this.eid); 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);
}
}); });
}, });
setAcc(row) { let parms = {
//临时设置 main: {
row.materialName = row.nameMaterial; orderId: this.orderId,
row.needCount = row.totalCount; productName: this.productNames,
row.routingDetailSeq = row.routingDetailNo; drawnNumber: this.drawnNumbers,
row.routingDeatilId = row.routingDetailId; count: this.counts,
this.entity = row; creator: this.$store.state.userInfo.userName,
this.modalAccSet = true; finishDate: this.orderForm.QuotationFinishDate,
}, orderCode: this.mesCode,
openAcc() { productingPreparationPeople: this.productingPreparationPeople,
//打开申请单页面 },
this.title = "申请单"; items: temItems,
this.detailAcc = () => import("./detailAccessory"); };
this.modalAccessoryList = true; //alert(JSON.stringify(parms.items));
}, if (parms.items.length == 0) {
cancel() { this.$Message.error("请输入申请数量");
this.modalAccessoryList = false; } else {
}, Api.supportmainCreate(parms).then((res) => {
canelSet() { if (res.success) {
//临时设置取消 this.$Message.success("申请成功");
this.modalAccSet = false; this.$emit("on-ok");
}, }
onOk() { });
//重新加载页面数据 }
this.load(this.eid); }
}, });
l(key) {
let vkey = "support_item" + "." + key;
return this.$t(vkey) || key;
},
}, },
watch: { application1() {
eid(v) { //临时申请配套操作
if (v != 0) { this.$refs["formValidateSet"].validate((valid) => {
this.load(v); 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;
},
},
watch: {
eid(v) {
if (v != 0) {
this.load(v);
}
}, },
},
}; };
</script> </script>
<template> <template>
<div class="h100"> <div class="h100">
<DataGrid :columns="columns" ref="grid" :action="action" @on-selection-change="selectInfo" :batch="false"> <DataGrid
<template slot="easySearch"> :columns="columns"
<Form ref="formInline" :model="easySearch" inline> ref="grid"
<FormItem prop="keys"> :action="action"
<Input search enter-button placeholder="请输入关键字订单编号/项目名称" v-model="easySearch.keys.value" v-width="300" @on-search="search" /> @on-selection-change="selectInfo"
</FormItem> :batch="false"
</Form> >
</template> <template slot="easySearch">
<template slot="searchBack"> <Form ref="formInline" :model="easySearch" inline>
<Badge :count="this.$store.state.countAps" overflow-count="99" style="margin-right:15px;" type="info" v-if="showAps"> <FormItem prop="keys">
<a href="javascript:;" @click="goAps">APS排产&nbsp;&nbsp;&nbsp;</a> <Input
</Badge> search
<Badge :count="this.$store.state.countAi" overflow-count="99" style="margin-right:15px;" type="info" v-if="showAi"> enter-button
<a href="javascript:;" @click="goAi">智能排产&nbsp;&nbsp;&nbsp;</a> placeholder="请输入关键字订单编号/项目名称"
</Badge> v-model="easySearch.keys.value"
<Badge :count="this.$store.state.countAll" overflow-count="99" style="margin-right:15px;" type="info" v-if="showAll"> v-width="300"
<a @click="goCemplate">整机排产&nbsp;&nbsp;&nbsp;</a> @on-search="search"
</Badge> />
<Badge :count="this.$store.state.countRun" overflow-count="99" type="info" v-if="showRun"> </FormItem>
<a @click="goStream">流水排产&nbsp;&nbsp;&nbsp;</a> </Form>
</Badge> </template>
</template> <template slot="searchBack">
<template slot="searchForm"> <Badge
<Search /> :count="this.$store.state.countAps"
</template> overflow-count="99"
<template slot="buttons"></template> style="margin-right: 15px"
type="info"
v-if="showAps"
>
<a href="javascript:;" @click="goAps">APS排产&nbsp;&nbsp;&nbsp;</a>
</Badge>
<Badge
:count="this.$store.state.countAi"
overflow-count="99"
style="margin-right: 15px"
type="info"
v-if="showAi"
>
<a href="javascript:;" @click="goAi">智能排产&nbsp;&nbsp;&nbsp;</a>
</Badge>
<Badge
:count="this.$store.state.countAll"
overflow-count="99"
style="margin-right: 15px"
type="info"
v-if="showAll"
>
<a @click="goCemplate">整机排产&nbsp;&nbsp;&nbsp;</a>
</Badge>
<Badge
:count="this.$store.state.countRun"
overflow-count="99"
type="info"
v-if="showRun"
>
<a @click="goStream">流水排产&nbsp;&nbsp;&nbsp;</a>
</Badge>
</template>
<template slot="searchForm">
<Search />
</template>
<template slot="buttons"></template>
</DataGrid> </DataGrid>
<FooterToolbar extra v-if="footerBar" class="ftball"> <FooterToolbar extra v-if="footerBar" class="ftball">
<Row> <Row>
<Checkbox @on-change="handleSelectAll(single)" v-model="single">全选</Checkbox> <Checkbox @on-change="handleSelectAll(single)" v-model="single"
<span class="footerSpan">已选 {{selectCount}} 项</span> >全选</Checkbox
&nbsp;&nbsp;&nbsp;&nbsp; >
<Button type="primary" @click="modalDispatch">工艺派发</Button>&nbsp;&nbsp;&nbsp;&nbsp; <span class="footerSpan">已选 {{ selectCount }} 项</span>
<Button type="primary" @click="modalSchedule">移入排产</Button>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;
<Button @click="canselFooter">取消</Button> <Button type="primary" @click="modalDispatch">工艺派发</Button
</Row> >&nbsp;&nbsp;&nbsp;&nbsp;
<Button type="primary" @click="modalSchedule">移入排产</Button
>&nbsp;&nbsp;&nbsp;&nbsp;
<Button @click="canselFooter">取消</Button>
</Row>
</FooterToolbar> </FooterToolbar>
<Modal v-model="addModal" title="新增" footer-hide> <Modal v-model="addModal" title="新增" footer-hide>
<Add @on-close="cancel" @on-ok="addOk" /> <Add @on-close="cancel" @on-ok="addOk" />
</Modal> </Modal>
<Modal v-model="editModal" title="编辑" footer-hide> <Modal v-model="editModal" title="编辑" footer-hide>
<Edit :eid="curId" @on-close="cancel" @on-ok="addOk" /> <Edit :eid="curId" @on-close="cancel" @on-ok="addOk" />
</Modal> </Modal>
<Modal v-model="detailModal" title="详情"> <Modal v-model="detailModal" title="详情">
<Detail :eid="curId" /> <Detail :eid="curId" />
</Modal> </Modal>
<Modal v-model="deletelModal" title="删除" @on-ok="removeOk" @on-cancel="cancel"> <Modal
<p>确定删除?</p> v-model="deletelModal"
title="删除"
@on-ok="removeOk"
@on-cancel="cancel"
>
<p>确定删除?</p>
</Modal> </Modal>
<Modal v-model="dispatchModal" title="工艺派发" footer-hide width="800"> <Modal v-model="dispatchModal" title="工艺派发" footer-hide width="800">
<Dispatch @on-close="cancel" :ids="listBatchIds" @on-ok="addOk" /> <Dispatch @on-close="cancel" :ids="listBatchIds" @on-ok="addOk" />
</Modal> </Modal>
<Modal v-model="scheduleModal" title="移入排产" width="800"> <Modal v-model="scheduleModal" title="移入排产" width="800">
<p>&nbsp;</p> <p>&nbsp;</p>
<h4>请选择排产模型:</h4> <h4>请选择排产模型:</h4>
<!-- <!--
<Dictionary <Dictionary
code="aps.plan.scheduleType" code="aps.plan.scheduleType"
v-model="scheduleType" v-model="scheduleType"
...@@ -65,39 +110,59 @@ ...@@ -65,39 +110,59 @@
@on-change="onchangeScheduleType" @on-change="onchangeScheduleType"
></Dictionary> ></Dictionary>
--> -->
<RadioGroup v-model="scheduleType" class="radioList" @on-change="onchangeScheduleType"> <RadioGroup
<Radio :label="1" border :disabled="this.$store.state.countAi>0"> v-model="scheduleType"
<span>Aps排产</span> class="radioList"
</Radio> @on-change="onchangeScheduleType"
<Radio :label="4" border :disabled="this.$store.state.countAps>0"> >
<span>智能排产</span> <Radio :label="1" border :disabled="this.$store.state.countAi > 0">
</Radio> <span>Aps排产</span>
<Radio :label="2" border> </Radio>
<span>整机排产</span> <Radio :label="4" border :disabled="this.$store.state.countAps > 0">
</Radio> <span>智能排产</span>
<Radio :label="3" border> </Radio>
<span>流水排产</span> <Radio :label="2" border>
</Radio> <span>整机排产</span>
</RadioGroup> </Radio>
<p class="pl30 pt10" v-show="scheduleType!=null"> <Radio :label="3" border>
确定将订单 <span>流水排产</span>
<span class="fwBold">{{resultsOrderList}}</span> 移入 </Radio>
<span class="red fwBold">{{scheduleTypeName}}</span> </RadioGroup>
</p> <p class="pl30 pt10" v-show="scheduleType != null">
<p>&nbsp;</p> 确定将订单
<p>&nbsp;</p> <span class="fwBold">{{ resultsOrderList }}</span> 移入
<div slot="footer"> <span class="red fwBold">{{ scheduleTypeName }}</span
<Button @click="cancel">取消</Button> >
<Button type="primary" @click="scheduleOk">确定</Button> </p>
</div> <p>&nbsp;</p>
<p>&nbsp;</p>
<div slot="footer">
<Button @click="cancel">取消</Button>
<Button type="primary" @click="scheduleOk">确定</Button>
</div>
</Modal> </Modal>
<Modal v-model="orderSupportModal" title="配套下发" footer-hide width="1300"> <Modal
<orderSupport ref="orderSupport"></orderSupport> v-model="orderSupportModal"
title="配套下发"
footer-hide
width="1300"
>
<orderSupport ref="orderSupport"></orderSupport>
</Modal> </Modal>
<Modal v-model="modalAccessory" :title="title" fullscreen footer-hide> <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" /> <component
:is="details"
:eid="orderId"
:mesCode="mesCode"
:productName="productName"
:drawnNumber="drawnNumber"
:productingPreparationPeople="productingPreparationPeople"
:count="count"
@on-close="cancel"
@on-ok="addOk"
/>
</Modal> </Modal>
</div> </div>
</template> </template>
<script> <script>
...@@ -109,733 +174,750 @@ import Search from "./search"; ...@@ -109,733 +174,750 @@ import Search from "./search";
import Dispatch from "./dispatch"; import Dispatch from "./dispatch";
import orderSupport from "../../produce/orderSupport"; import orderSupport from "../../produce/orderSupport";
export default { export default {
name: "list", name: "list",
components: { components: {
Add, Add,
Edit, Edit,
Detail, Detail,
Search, Search,
Dispatch, Dispatch,
orderSupport, orderSupport,
}, },
data() { data() {
return { return {
action: Api.index, action: Api.index,
easySearch: { productingPreparationPeople: 0,
keys: { easySearch: {
op: "mesCode,projectNumber", keys: {
value: null, op: "mesCode,projectNumber",
}, value: null,
},
addModal: false,
editModal: false,
detailModal: false,
deletelModal: false,
dispatchModal: false,
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",
title: '多选',
type: "selection",
width: 50,
align: "center",
},
{
title: this.l("mesCode"),
key: "mesCode",
width: 240,
align: "left",
},
{
key: "productName",
title: this.l("productName"),
align: "left",
easy: true,
width: 160,
high: true,
tooltip: true,
},
{
key: "status",
title: this.l("status"),
align: "center",
high: true,
code: "plan.order.status",
},
{
key: "mainRoutingSetStatus",
title: this.l("mainRoutingSetStatus"),
align: "center",
high: true,
code: "aps.plan.mainRoutingStatus",
},
{
key: "isSupportingFinish",
title: this.l("isSupportingFinish"),
align: "center",
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",
title: this.l("projectNumber"),
align: "left",
easy: true,
high: true,
},
{
key: "batchNumber",
title: this.l("batchNumber"),
align: "left",
easy: true,
high: true,
},
{
key: "urgencyLevel",
title: this.l("urgencyLevel"),
align: "left",
easy: true,
high: true,
code: "plan.order.urgencyLevel",
},
{
key: "taskType",
title: this.l("taskType"),
align: "left",
easy: true,
high: true,
hide: true,
code: "plan.order.taskType",
},
{
key: "drawnNumber",
title: this.l("drawnNumber"),
align: "left",
easy: true,
high: true,
},
{
key: "quantity",
title: this.l("quantity"),
align: "right",
high: true,
},
{
key: "productCode",
title: this.l("productCode"),
align: "left",
easy: true,
high: true,
hide: true,
},
{
key: "isPreschedule",
title: this.l("isPreschedule"),
align: "center",
width: 100,
high: true,
code: "aps.plan.ispreschedule",
},
{
key: "taskRequire",
title: this.l("taskRequire"),
align: "left",
easy: true,
high: true,
hide: true
},
{
key: "productingPreparationPeople",
title: this.l("productingPreparationPeople"),
align: "left",
high: true,
hide: true,
type: 'workShopName'
},
{
key: "productingPreparationFinishDate",
title: this.l("productingPreparationFinishDate"),
align: "left",
high: true,
hide: true
},
{
key: "quotationPeople",
title: this.l("quotationPeople"),
align: "left",
high: true,
hide: true,
type: "user"
},
{
key: "quotationFinishDate",
title: this.l("quotationFinishDate"),
align: "left",
high: true,
hide: true
},
{
key: "demandStartDate",
title: this.l("demandStartDate"),
align: "left",
high: true,
hide: true,
type: "date"
},
{
key: "demandFinishDate",
title: this.l("demandFinishDate"),
align: "left",
high: true,
hide: true,
type: "date"
},
// {
// key: "spareQty",
// title: this.l("spareQty"),
// align: "left",
// high: true,
// hide: true,
// },
// {
// key: "demandStart",
// title: this.l("demandStart"),
// align: "left",
// high: true,
// hide: true,
// },
// {
// key: "demandFinish",
// title: this.l("demandFinish"),
// align: "left",
// high: true,
// hide: true,
// },
// {
// key: "partNamePro",
// title: this.l("partNamePro"),
// align: "left",
// easy: true,
// high: true,
// hide: true,
// },
{
title: "操作",
key: "action",
width: 140,
align: "center",
render: (h, params) => {
return h("div", {
class: "action"
}, [
h(
"op", {
attrs: {
oprate: "detail",
title: params.row.mainRoutingSetStatus == 0 ?
"工艺派发" : "移入排产",
},
style: {
color: params.row.mainRoutingSetStatus == 0 ? "red" : "",
},
on: {
click: () =>
params.row.mainRoutingSetStatus == 0 ||
params.row.mainRoutingSetStatus == 1 ?
this.goMethod(params.row) : null,
},
},
params.row.mainRoutingSetStatus == 0 && params.row.isPreschedule == 0 ?
"工艺派发" :
params.row.mainRoutingSetStatus == 1 && params.row.isPreschedule == 0 ?
"移入排产" :
""
),
h(
"op", {
attrs: {
oprate: "detail",
title: params.row.isSupportingFinish == 2 ||
params.row.isSupportingFinish == 3 ?
"配套派发" : "",
},
style: {
color: params.row.mainRoutingSetStatus == 0 ? "red" : "",
},
on: {
click: () =>
params.row.isSupportingFinish == 2 ||
params.row.isSupportingFinish == 3 ?
this.supportDis(params.row) : null,
},
},
params.row.isSupportingFinish == 2 ||
params.row.isSupportingFinish == 3 ?
"配套派发" :
""
),
]);
},
},
],
selectCount: 0,
selectList: [],
footerBar: false,
results: [],
listBatchIds: [],
listBatchIds1: [], //临时存储选择的ids
single: false,
resultsStatusArr: [],
resultsStatus: 0,
dispatchStatus: 0, //派发标识
scheduleStatus: 0, //排产标识
resultsOrderList: "",
scheduleType: null,
scheduleTypeName: "",
showAps: false,
showAi: false,
showAll: false,
showRun: false,
isPrescheduleStatu: 0,
};
},
mounted() {
this.loadInitCount();
},
async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
handleSelectAll(status) {
//选择列表数据
this.$refs.grid.selectAll(status);
}, },
selectInfo(value) { },
if (value.length > 0) { addModal: false,
this.footerBar = true; editModal: false,
} else { detailModal: false,
this.footerBar = false; deletelModal: false,
} dispatchModal: false,
this.selectList = []; scheduleModal: false,
this.selectList = value; orderSupportModal: false,
curId: 0,
this.selectCount = this.selectList.length; statuList:
let statueArry = []; this.$store.getters.dictionaryByKey("aps.plan.supportingStatus") || [],
let tempmesCodeList = []; name: "",
this.resultsStatusArr = []; items: null,
this.isPrescheduleStatu = 0 title: "",
value.forEach((data) => { details: null,
var that = this; uId: "",
statueArry.push(data.id); hid: 0,
this.resultsStatusArr.push(data.mainRoutingSetStatus); orderId: 0,
if (data.isPreschedule == 2) { mesCode: "",
this.isPrescheduleStatu = 2 productName: "",
} drawnNumber: "",
tempmesCodeList.push(data.mesCode); count: 0,
}); modalAccessory: false,
columns: [
let mainRS = this.uniq(this.resultsStatusArr); //数组去重 {
if (mainRS.length == 1) { key: "selection",
this.results = []; title: "多选",
this.results = statueArry; type: "selection",
this.getListId(statueArry); width: 50,
this.resultsOrderList = JSON.stringify(tempmesCodeList) //提示mesCode align: "center",
.replace("[", "")
.replace("]", "")
.replace(/\"/g, "");
if (mainRS[0] == 0) {
//未派发
this.dispatchStatus = 1;
this.scheduleStatus = 0;
} else if (mainRS[0] == 1) {
//已派发
this.dispatchStatus = 0;
this.scheduleStatus = 1;
} else {
//派发中
this.dispatchStatus = 0;
this.scheduleStatus = 0;
}
} else {
this.dispatchStatus = 0;
this.scheduleStatus = 0;
}
}, },
//得到需要批量操作的ids {
getListId(value) { title: this.l("mesCode"),
this.listBatchIds1 = value; key: "mesCode",
if (this.listBatchIds1.length > 0) { width: 240,
this.footerBar = true; align: "left",
} else {
this.footerBar = false;
}
}, },
canselFooter() { {
this.footerBar = false; key: "productName",
this.handleSelectAll(false); title: this.l("productName"),
align: "left",
easy: true,
width: 160,
high: true,
tooltip: true,
}, },
modalDispatch() { {
//打开工艺派发 key: "status",
this.listBatchIds = this.listBatchIds1; //用于列表操作时和多选时的listBatchId的冲突 title: this.l("status"),
if (this.dispatchStatus == 1) { align: "center",
this.dispatchModal = true; high: true,
} else { code: "plan.order.status",
this.$Message.error("所选订单里存在已派发订单!");
}
}, },
modalSchedule() { {
//移入排产 key: "mainRoutingSetStatus",
this.scheduleType = null; title: this.l("mainRoutingSetStatus"),
this.scheduleTypeName = ""; align: "center",
this.listBatchIds = this.listBatchIds1; high: true,
if (this.scheduleStatus == 1 && this.isPrescheduleStatu != 2) { code: "aps.plan.mainRoutingStatus",
this.scheduleModal = true;
} else {
this.$Message.error("所选订单里存在未派发订单!");
}
}, },
goMethod(value) { {
//行内点击后面按钮 key: "isSupportingFinish",
this.canselFooter(); title: this.l("isSupportingFinish"),
this.resultsOrderList = value.mesCode; align: "center",
this.listBatchIds = [value.id]; render: (h, params) => {
this.scheduleType = null; return h(
this.scheduleTypeName = ""; "op",
if (value.mainRoutingSetStatus == 0) { {
//this.dispatchStatus = 1 attrs: {
//this.scheduleStatus = 0 oprate: "detail",
this.dispatchModal = true; },
} else if (value.mainRoutingSetStatus == 1) { style: {
//this.dispatchStatus = 0 color: this.setName(params.row.isSupportingFinish).color,
//this.scheduleStatus = 1 },
this.scheduleModal = true; on: {
} click: () => this.openAccessory(params.row),
}, },
supportDis(value) { },
(this.orderSupportModal = true), this.setName(params.row.isSupportingFinish).name
this.$refs.orderSupport.loaddata(value.id); );
},
}, },
scheduleOk() { {
if (this.scheduleType == null) { key: "projectNumber",
this.$Message.error("请选择排产模型"); title: this.l("projectNumber"),
} else { align: "left",
let params = { easy: true,
ids: this.listBatchIds, high: true,
poolType: this.scheduleType,
};
Api.moveinbatch(params)
.then((r) => {
if (r.success && r.result == true) {
this.$Message.success("移入排产成功");
this.$refs.grid.reload(this.easySearch);
this.changeCountOut(this.scheduleType, this.listBatchIds.length);
} else {
if (!r.result.res) {
this.$Message.error(r.result.msg);
} else {
this.$Message.error("移入排产失败");
}
}
})
.catch((err) => {
this.$Message.error("移入排产失败");
});
this.canselFooter();
this.cancel();
}
}, },
//跳转到aps排产池(有判断) {
goAps() { key: "batchNumber",
Api.moveintoaps().then((res) => { title: this.l("batchNumber"),
if (res.success) { align: "left",
if (res.result.res) { easy: true,
this.$router.push({ high: true,
name: "aps-aps",
// params: { customerId: id }
});
} else {
this.$Message.error(res.result.msg);
}
}
});
}, },
//跳转到智能排产池(有判断) {
goAi() { key: "urgencyLevel",
Api.moveintoai().then((res) => { title: this.l("urgencyLevel"),
if (res.success) { align: "left",
if (res.result.res) { easy: true,
//test high: true,
this.$router.push({ code: "plan.order.urgencyLevel",
name: "aps-ai",
// params: { customerId: id }
});
} else {
this.$Message.error(res.result.msg);
}
}
});
}, },
goCemplate() {
this.$router.push({ {
name: "aps-complete", key: "taskType",
}); title: this.l("taskType"),
align: "left",
easy: true,
high: true,
hide: true,
code: "plan.order.taskType",
}, },
goStream() {
this.$router.push({ {
name: "aps-stream", key: "drawnNumber",
}); title: this.l("drawnNumber"),
align: "left",
easy: true,
high: true,
}, },
add() { {
this.addModal = true; key: "quantity",
title: this.l("quantity"),
align: "right",
high: true,
}, },
addOk() { {
this.$refs.grid.load(); key: "productCode",
this.addModal = false; title: this.l("productCode"),
this.detailModal = false; align: "left",
this.editModal = false; easy: true,
this.curId = 0; high: true,
//aps hide: true,
this.dispatchModal = false;
this.scheduleModal = false;
this.listBatchIds = [];
this.listBatchIds1 = [];
this.canselFooter();
this.modalAccessory = false;
}, },
search() { {
this.$refs.grid.reload(this.easySearch); key: "isPreschedule",
title: this.l("isPreschedule"),
align: "center",
width: 100,
high: true,
code: "aps.plan.ispreschedule",
}, },
detail(id) { {
this.detailModal = true; key: "taskRequire",
this.curId = id; title: this.l("taskRequire"),
align: "left",
easy: true,
high: true,
hide: true,
}, },
edit(id) { {
this.editModal = true; key: "productingPreparationPeople",
this.curId = id; title: this.l("productingPreparationPeople"),
align: "left",
high: true,
hide: true,
type: "workShopName",
}, },
remove(id) { {
this.deletelModal = true; key: "productingPreparationFinishDate",
this.curId = id; title: this.l("productingPreparationFinishDate"),
align: "left",
high: true,
hide: true,
}, },
removeOk() { {
Api.delete({ key: "quotationPeople",
id: this.curId title: this.l("quotationPeople"),
}).then((r) => { align: "left",
if (r.success) { high: true,
this.$refs.grid.load(); hide: true,
this.deletelModal = false; type: "user",
this.$Message.success("删除成功");
}
});
}, },
removeCancel() { {
this.deletelModal = false; key: "quotationFinishDate",
title: this.l("quotationFinishDate"),
align: "left",
high: true,
hide: true,
}, },
cancel() { {
this.curId = 0; key: "demandStartDate",
this.addModal = false; title: this.l("demandStartDate"),
this.detailModal = false; align: "left",
this.editModal = false; high: true,
this.deletedlModal = false; hide: true,
//aps type: "date",
this.dispatchModal = false;
this.scheduleModal = false;
this.modalAccessory = false;
// this.listBatchIds = []
// this.listBatchIds1 = []
// this.canselFooter()
}, },
l(key) { {
let vkey = "mes_order" + "." + key; key: "demandFinishDate",
return this.$t(vkey) || key; title: this.l("demandFinishDate"),
align: "left",
high: true,
hide: true,
type: "date",
}, },
uniq(array) { // {
//数组去重 // key: "spareQty",
array.sort(); // title: this.l("spareQty"),
var temp = []; // align: "left",
temp = [array[0]]; // high: true,
for (var i = 1; i < array.length; i++) { // hide: true,
if (array[i] !== temp[temp.length - 1]) { // },
temp.push(array[i]); // {
} // key: "demandStart",
} // title: this.l("demandStart"),
return temp; // align: "left",
// high: true,
// hide: true,
// },
// {
// key: "demandFinish",
// title: this.l("demandFinish"),
// align: "left",
// high: true,
// hide: true,
// },
// {
// key: "partNamePro",
// title: this.l("partNamePro"),
// align: "left",
// easy: true,
// high: true,
// hide: true,
// },
{
title: "操作",
key: "action",
width: 140,
align: "center",
render: (h, params) => {
return h(
"div",
{
class: "action",
},
[
h(
"op",
{
attrs: {
oprate: "detail",
title:
params.row.mainRoutingSetStatus == 0
? "工艺派发"
: "移入排产",
},
style: {
color: params.row.mainRoutingSetStatus == 0 ? "red" : "",
},
on: {
click: () =>
params.row.mainRoutingSetStatus == 0 ||
params.row.mainRoutingSetStatus == 1
? this.goMethod(params.row)
: null,
},
},
params.row.mainRoutingSetStatus == 0 &&
params.row.isPreschedule == 0
? "工艺派发"
: params.row.mainRoutingSetStatus == 1 &&
params.row.isPreschedule == 0
? "移入排产"
: ""
),
h(
"op",
{
attrs: {
oprate: "detail",
title:
params.row.isSupportingFinish == 2 ||
params.row.isSupportingFinish == 3
? "配套派发"
: "",
},
style: {
color: params.row.mainRoutingSetStatus == 0 ? "red" : "",
},
on: {
click: () =>
params.row.isSupportingFinish == 2 ||
params.row.isSupportingFinish == 3
? this.supportDis(params.row)
: null,
},
},
params.row.isSupportingFinish == 2 ||
params.row.isSupportingFinish == 3
? "配套派发"
: ""
),
]
);
},
}, },
//移入排产前选择排产模型 ],
onchangeScheduleType(val) { selectCount: 0,
switch (Number(val)) { selectList: [],
case 4: footerBar: false,
this.scheduleTypeName = "智能排产"; results: [],
break; listBatchIds: [],
case 2: listBatchIds1: [], //临时存储选择的ids
this.scheduleTypeName = "整机排产"; single: false,
break; resultsStatusArr: [],
case 3: resultsStatus: 0,
this.scheduleTypeName = "流水排产"; dispatchStatus: 0, //派发标识
break; scheduleStatus: 0, //排产标识
default: resultsOrderList: "",
this.scheduleTypeName = "APS排产"; scheduleType: null,
scheduleTypeName: "",
showAps: false,
showAi: false,
showAll: false,
showRun: false,
isPrescheduleStatu: 0,
};
},
mounted() {
this.loadInitCount();
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
handleSelectAll(status) {
//选择列表数据
this.$refs.grid.selectAll(status);
},
selectInfo(value) {
if (value.length > 0) {
this.footerBar = true;
} else {
this.footerBar = false;
}
this.selectList = [];
this.selectList = value;
this.selectCount = this.selectList.length;
let statueArry = [];
let tempmesCodeList = [];
this.resultsStatusArr = [];
this.isPrescheduleStatu = 0;
value.forEach((data) => {
var that = this;
statueArry.push(data.id);
this.resultsStatusArr.push(data.mainRoutingSetStatus);
if (data.isPreschedule == 2) {
this.isPrescheduleStatu = 2;
}
tempmesCodeList.push(data.mesCode);
});
let mainRS = this.uniq(this.resultsStatusArr); //数组去重
if (mainRS.length == 1) {
this.results = [];
this.results = statueArry;
this.getListId(statueArry);
this.resultsOrderList = JSON.stringify(tempmesCodeList) //提示mesCode
.replace("[", "")
.replace("]", "")
.replace(/\"/g, "");
if (mainRS[0] == 0) {
//未派发
this.dispatchStatus = 1;
this.scheduleStatus = 0;
} else if (mainRS[0] == 1) {
//已派发
this.dispatchStatus = 0;
this.scheduleStatus = 1;
} else {
//派发中
this.dispatchStatus = 0;
this.scheduleStatus = 0;
}
} else {
this.dispatchStatus = 0;
this.scheduleStatus = 0;
}
},
//得到需要批量操作的ids
getListId(value) {
this.listBatchIds1 = value;
if (this.listBatchIds1.length > 0) {
this.footerBar = true;
} else {
this.footerBar = false;
}
},
canselFooter() {
this.footerBar = false;
this.handleSelectAll(false);
},
modalDispatch() {
//打开工艺派发
this.listBatchIds = this.listBatchIds1; //用于列表操作时和多选时的listBatchId的冲突
if (this.dispatchStatus == 1) {
this.dispatchModal = true;
} else {
this.$Message.error("所选订单里存在已派发订单!");
}
},
modalSchedule() {
//移入排产
this.scheduleType = null;
this.scheduleTypeName = "";
this.listBatchIds = this.listBatchIds1;
if (this.scheduleStatus == 1 && this.isPrescheduleStatu != 2) {
this.scheduleModal = true;
} else {
this.$Message.error("所选订单里存在未派发订单!");
}
},
goMethod(value) {
//行内点击后面按钮
this.canselFooter();
this.resultsOrderList = value.mesCode;
this.listBatchIds = [value.id];
this.scheduleType = null;
this.scheduleTypeName = "";
if (value.mainRoutingSetStatus == 0) {
//this.dispatchStatus = 1
//this.scheduleStatus = 0
this.dispatchModal = true;
} else if (value.mainRoutingSetStatus == 1) {
//this.dispatchStatus = 0
//this.scheduleStatus = 1
this.scheduleModal = true;
}
},
supportDis(value) {
(this.orderSupportModal = true),
this.$refs.orderSupport.loaddata(value.id);
},
scheduleOk() {
if (this.scheduleType == null) {
this.$Message.error("请选择排产模型");
} else {
let params = {
ids: this.listBatchIds,
poolType: this.scheduleType,
};
Api.moveinbatch(params)
.then((r) => {
if (r.success && r.result == true) {
this.$Message.success("移入排产成功");
this.$refs.grid.reload(this.easySearch);
this.changeCountOut(this.scheduleType, this.listBatchIds.length);
} else {
if (!r.result.res) {
this.$Message.error(r.result.msg);
} else {
this.$Message.error("移入排产失败");
}
} }
}, })
//移入排产成功后给标题增加数量 .catch((err) => {
changeCountOut(type, count) { this.$Message.error("移入排产失败");
switch (type) { });
case 4: //智能排产池排产订单数量 this.canselFooter();
this.$store.commit("setCountAi", this.$store.state.countAi + count); this.cancel();
break; }
case 2: //整机排产池排产订单数量 },
this.$store.commit("setCountAll", this.$store.state.countAll + count); //跳转到aps排产池(有判断)
break; goAps() {
case 3: //流水排产池排产订单数量 Api.moveintoaps().then((res) => {
this.$store.commit("setCountRun", this.$store.state.countRun + count); if (res.success) {
break; if (res.result.res) {
default: this.$router.push({
//APS排产池排产订单数量 name: "aps-aps",
this.$store.commit("setCountAps", this.$store.state.countAps + count); // params: { customerId: id }
});
} else {
this.$Message.error(res.result.msg);
}
}
});
},
//跳转到智能排产池(有判断)
goAi() {
Api.moveintoai().then((res) => {
if (res.success) {
if (res.result.res) {
//test
this.$router.push({
name: "aps-ai",
// params: { customerId: id }
});
} else {
this.$Message.error(res.result.msg);
}
}
});
},
goCemplate() {
this.$router.push({
name: "aps-complete",
});
},
goStream() {
this.$router.push({
name: "aps-stream",
});
},
add() {
this.addModal = true;
},
addOk() {
this.$refs.grid.load();
this.addModal = false;
this.detailModal = false;
this.editModal = false;
this.curId = 0;
//aps
this.dispatchModal = false;
this.scheduleModal = false;
this.listBatchIds = [];
this.listBatchIds1 = [];
this.canselFooter();
this.modalAccessory = false;
},
search() {
this.$refs.grid.reload(this.easySearch);
},
detail(id) {
this.detailModal = true;
this.curId = id;
},
edit(id) {
this.editModal = true;
this.curId = id;
},
remove(id) {
this.deletelModal = true;
this.curId = id;
},
removeOk() {
Api.delete({
id: this.curId,
}).then((r) => {
if (r.success) {
this.$refs.grid.load();
this.deletelModal = false;
this.$Message.success("删除成功");
}
});
},
removeCancel() {
this.deletelModal = false;
},
cancel() {
this.curId = 0;
this.addModal = false;
this.detailModal = false;
this.editModal = false;
this.deletedlModal = false;
//aps
this.dispatchModal = false;
this.scheduleModal = false;
this.modalAccessory = false;
// this.listBatchIds = []
// this.listBatchIds1 = []
// this.canselFooter()
},
l(key) {
let vkey = "mes_order" + "." + key;
return this.$t(vkey) || key;
},
uniq(array) {
//数组去重
array.sort();
var temp = [];
temp = [array[0]];
for (var i = 1; i < array.length; i++) {
if (array[i] !== temp[temp.length - 1]) {
temp.push(array[i]);
}
}
return temp;
},
//移入排产前选择排产模型
onchangeScheduleType(val) {
switch (Number(val)) {
case 4:
this.scheduleTypeName = "智能排产";
break;
case 2:
this.scheduleTypeName = "整机排产";
break;
case 3:
this.scheduleTypeName = "流水排产";
break;
default:
this.scheduleTypeName = "APS排产";
}
},
//移入排产成功后给标题增加数量
changeCountOut(type, count) {
switch (type) {
case 4: //智能排产池排产订单数量
this.$store.commit("setCountAi", this.$store.state.countAi + count);
break;
case 2: //整机排产池排产订单数量
this.$store.commit("setCountAll", this.$store.state.countAll + count);
break;
case 3: //流水排产池排产订单数量
this.$store.commit("setCountRun", this.$store.state.countRun + count);
break;
default:
//APS排产池排产订单数量
this.$store.commit("setCountAps", this.$store.state.countAps + count);
}
},
//进入页面加载排产count-----
loadInitCount() {
let currentUserId = this.$store.state.userInfo.userId;
let para = {
id: currentUserId,
};
Api.listbyuser(para).then((datas) => {
if (datas.success && datas.result && datas.result.length > 0) {
datas.result.forEach((dateScheduleId) => {
switch (dateScheduleId.apsScheduleId) {
case 1:
this.showAps = true;
break;
case 2:
this.showAll = true;
break;
case 3:
this.showRun = true;
break;
default:
this.showAi = true;
} }
}, });
//进入页面加载排产count----- }
loadInitCount() { });
let currentUserId = this.$store.state.userInfo.userId;
let para = { this.$store.commit("setCountAps", 0);
id: currentUserId this.$store.commit("setCountAi", 0);
}; this.$store.commit("setCountAll", 0);
Api.listbyuser(para).then((datas) => { this.$store.commit("setCountRun", 0);
if (datas.success && datas.result && datas.result.length > 0) { Api.getpoolordercount()
datas.result.forEach((dateScheduleId) => { .then((res) => {
switch (dateScheduleId.apsScheduleId) { if (res.success && res.result && res.result.length > 0) {
case 1: res.result.forEach((data) => {
this.showAps = true; this.changeCountOut(data.poolType, data.count);
break;
case 2:
this.showAll = true;
break;
case 3:
this.showRun = true;
break;
default:
this.showAi = true;
}
});
}
}); });
}
})
.catch((err) => {
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) {
if (row.mainRoutingSetStatus != 1) {
this.$Message.error("请设置订单工艺!");
return;
} else {
this.orderId = row.id;
this.mesCode = row.mesCode;
this.productName = row.productName;
this.drawnNumber = row.drawnNumber;
this.count = row.quantity;
this.productingPreparationPeople = row.productingPreparationPeople;
this.$store.commit("setCountAps", 0); if (row.mainRoutingSetStatus == 1 && row.isSupportingFinish == 0) {
this.$store.commit("setCountAi", 0); this.$Message.error("请去工艺设置生成料单!");
this.$store.commit("setCountAll", 0); // this.title = "申请配套";
this.$store.commit("setCountRun", 0); // this.details = () => import("./addAccessory");
Api.getpoolordercount() } else {
.then((res) => { this.title = "配套清单";
if (res.success && res.result && res.result.length > 0) { this.details = () => import("./editAccessory");
res.result.forEach((data) => { this.modalAccessory = true;
this.changeCountOut(data.poolType, data.count); }
}); }
} },
}) ok() {
.catch((err) => { this.modalAccessory = false;
this.$Message.error("获取排产池排产数量失败"); this.curId = 0;
});
},
//配套申请
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) {
if (row.mainRoutingSetStatus != 1) {
this.$Message.error("请设置订单工艺!");
return;
} else {
this.orderId = row.id;
this.mesCode = row.mesCode;
this.productName = row.productName;
this.drawnNumber = row.drawnNumber;
this.count = row.quantity;
if (row.mainRoutingSetStatus == 1 && row.isSupportingFinish == 0) {
this.$Message.error("请去工艺设置生成料单!");
// this.title = "申请配套";
// this.details = () => import("./addAccessory");
} else {
this.title = "配套清单";
this.details = () => import("./editAccessory");
this.modalAccessory = true;
}
}
},
ok() {
this.modalAccessory = false;
this.curId = 0;
},
}, },
},
}; };
</script> </script>
<style lang="less"> <style lang="less">
.footerSpan { .footerSpan {
width: 120px; width: 120px;
} }
.demo-badge-alone { .demo-badge-alone {
background: #5cb85c !important; background: #5cb85c !important;
} }
.radioList { .radioList {
margin: 10px 30px; margin: 10px 30px;
} }
.radioList label { .radioList label {
margin-top: 5px; margin-top: 5px;
} }
</style> </style>
import Api from '@/plugins/request' import Api from '@/plugins/request'
export default { export default {
index:`${resourceUrl}/materialpowder/itempaged`, index:`${material}/material/paged`,
paged(params){ paged(params){
return Api.post(`${resourceUrl}/materialpowder/itempaged`,params); return Api.post(`${material}/material/paged`,params);
}, },
get(params){ get(params){
return Api.get(`${resourceUrl}/materialpowder/get`,params); return Api.get(`${material}/materialpowder/get`,params);
}, },
create(params){ create(params){
return Api.post(`${resourceUrl}/materialpowder/create`,params); return Api.post(`${material}/materialpowder/create`,params);
}, },
update(params){ update(params){
return Api.post(`${resourceUrl}/materialpowder/update`,params); return Api.post(`${material}/materialpowder/update`,params);
}, },
//删除: //删除:
delete(params) { delete(params) {
return Api.delete(`${resourceUrl}/materialpowder/delete`,{params:params}); return Api.delete(`${material}/materialpowder/delete`,{params:params});
}, },
} }
\ No newline at end of file
<template> <template>
<div> <div>
<DataGrid :columns="columns" ref="grid" :high='false' :action="action" :conditions="easySearch"></DataGrid> <DataGrid
:columns="columns"
ref="grid"
:high="false"
:action="action"
:conditions="easySearch"
></DataGrid>
</div> </div>
</template> </template>
<script> <script>
import Api from '../api' import Api from "../api";
export default { export default {
// name: 'list', // name: 'list',
// components:{ // components:{
...@@ -18,145 +24,157 @@ export default { ...@@ -18,145 +24,157 @@ export default {
detailModal: false, detailModal: false,
deletelModal: false, deletelModal: false,
easySearch: { easySearch: {
keys: { op: 'brand,name', value: '',default:true }, keys: { op: "brand,name", value: "", default: true },
reinspectionStatus: { op: 'Equal', value: 3 } reinspectionStatus: { op: "Equal", value: 1 },
}, },
curId: 0, curId: 0,
columns: [ columns: [
{ key: 'id', title: this.l('id'), hide: true, align: 'left' }, { key: "id", title: this.l("id"), hide: true, align: "left" },
{
key: 'brand',
title: this.l('brand'),
align: 'left',
easy: true,
high: true
},
{
key: 'name',
title: this.l('name'),
align: 'left',
easy: true,
high: true
},
{ {
key: 'specifications', key: "codeRuleType",
title: this.l('specifications'), title: "类型",
align: 'left', align: "center",
easy: true, code: "material.code.type",
high: true import: true,
hide: true,
}, },
// {
// key: "codeRuleId",
// title: "编码名称",
// materialKey: "3",
// import: true,
// hide: true,
// render: (h, params) => {
// return h("span", {}, this.getType3(params.row.codeRuleId));
// },
// },
// {
// key: "rootCategoryId",
// title: "大类",
// align: "right",
// materialKey: "1",
// import: true,
// hide: true,
// render: (h, params) => {
// return h("span", {}, this.getType1(params.row.rootCategoryId));
// },
// },
// {
// key: "categoryId",
// title: "子类",
// align: "right",
// materialKey: "2",
// import: true,
// hide: true,
// render: (h, params) => {
// return h("span", {}, this.getType2(params.row.categoryId));
// },
// },
{ {
key: 'batchNo', key: "code",
title: this.l('batchNo'), title: "编码",
align: 'left', align: "left",
easy: true, render: (h, params) => {
high: true, return h(
hide:true, "div",
{
props: {},
on: {
click: () => this.details(params.row),
},
},
!params.row.code || params.row.code == 0
? "未分配"
: params.row.code
);
},
}, },
{ {
key: 'originalManufacturer', key: "name",
title: this.l('originalManufacturer'), title: "名称",
align: 'left', align: "left",
easy: true,
high: true,
hide:true,
}, },
{ {
key: 'reinspectionDate', key: "status",
title: this.l('reinspectionDate'), title: "状态",
align: 'left', align: "center",
render: (h, paras) => { code: "material.main.status",
return h('span', paras.row.reinspectionDate)
},
high: true,
width:180,
}, },
{ {
key: 'remainingAmount', key: "version",
title: this.l('remainingAmount'), title: "版本",
align: 'left', align: "left",
high: true code: "material.main.version",
}, },
{ {
key: 'storeId', key: "drawing",
title: this.l('storeId'), title: "图号",
align: 'left', align: "left",
render: (h, paras) => {
return h('span', paras.row.storeId)
},
high: true
}, },
{ {
key: 'location', key: "creationTime",
title: this.l('location'), title: "创建时间",
align: 'left', hide: true,
easy: true, align: "left",
high: true type: "date",
}, },
{ {
key: 'category', key: "creatorUserId",
title: this.l('category'), title: "创建人",
align: 'center', hide: true,
high: true, align: "left",
code: 'mes_xingchi_resource.material.powderType' type: "user",
},
{
key: 'reinspectionStatus',
title: this.l('reinspectionStatus'),
align: 'center',
code: 'mes_xingchi_resource.material.recheckState',
easy: true,
high: true
}, },
// render:(h,paras)=>{return h('span',paras.row.reinspectionStatus)} , // render:(h,paras)=>{return h('span',paras.row.reinspectionStatus)} ,
{ {
title: '操作', title: "操作",
key: 'id', key: "id",
width: 150, width: 150,
align: 'center', align: "center",
render: (h, params) => { render: (h, params) => {
// let herfurl = params.row.certificateUploadPath; // let herfurl = params.row.certificateUploadPath;
return h('div', { class: 'action' }, [ return h("div", { class: "action" }, [
h( h(
'op', "op",
{ {
attrs:{ attrs: {
oprate:'detail' oprate: "detail",
} , },
class: 'view', class: "view",
on: { click: () => { on: {
this.detail(params.row) click: () => {
} } this.detail(params.row);
}, },
'查看复验单' },
) },
]) "查看复验单"
} ),
} ]);
] },
} },
}, ],
mounted() { };
}, },
mounted() {},
methods: { methods: {
reload(){ reload() {
this.$refs.grid.load() this.$refs.grid.load();
}, },
detail(row) { detail(row) {
let ssdata = row.certificateUploadPath let ssdata = row.certificateUploadPath;
if(this.$u.isNull(ssdata)){ if (this.$u.isNull(ssdata)) {
this.$Message.warning('复验单为空!') this.$Message.warning("复验单为空!");
}else{ } else {
var item=JSON.parse(ssdata)[0]["filePath"], var item = JSON.parse(ssdata)[0]["filePath"],
url = fileUrlDown + item; url = fileUrlDown + item;
window.open(url) window.open(url);
// this.$Message.warning('文件格式不支持') // this.$Message.warning('文件格式不支持')
} }
}, },
removeCancel() { removeCancel() {
this.deletelModal = false this.deletelModal = false;
}, },
l(key) { l(key) {
/* /*
...@@ -186,11 +204,11 @@ export default { ...@@ -186,11 +204,11 @@ export default {
lastModifierUserId:'', lastModifierUserId:'',
} }
*/ */
let vkey = 'waitReview' + '.' + key let vkey = "waitReview" + "." + key;
return this.$t(vkey) || key return this.$t(vkey) || key;
} },
} },
} };
</script> </script>
<style lang="less"> <style lang="less">
</style> </style>
\ No newline at end of file
<template> <template>
<div> <div>
<DataGrid :columns="columns" ref="grid" :high='false' :action="action" :conditions="easySearch"> <DataGrid
:columns="columns"
ref="grid"
:high="false"
:action="action"
:conditions="easySearch"
>
<!-- <template slot="searchForm"> <!-- <template slot="searchForm">
<!-- <Search /> <!-- <Search />
</template>--> </template>-->
...@@ -9,32 +15,39 @@ ...@@ -9,32 +15,39 @@
</template>--> </template>-->
</DataGrid> </DataGrid>
<Modal v-model="detailModal" title="复验" width="490" footer-hide> <Modal v-model="detailModal" title="复验" width="490" footer-hide>
<Form :model="setNumForm" :label-width="90" :rules="rules" > <Form :model="setNumForm" :label-width="90" :rules="rules">
<Row> <Row>
<Col span="24"> <Col span="24">
<FormItem label="合格证编码"> <FormItem label="合格证编码">
<Input v-model="setNumForm.substrateCoding" placeholder="系统自动生成可修改"></Input> <Input
v-model="setNumForm.substrateCoding"
placeholder="系统自动生成可修改"
></Input>
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
<Row> <Row>
<Col span="24"> <Col span="24">
<FormItem label="复验文件" prop="storeTitle"> <FormItem label="复验文件" prop="storeTitle">
<inputFile v-model="setNumForm.imgName" :parms="qcfileparms" files /> <inputFile
v-model="setNumForm.imgName"
:parms="qcfileparms"
files
/>
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
<Row v-if="redmsg"> <Row v-if="redmsg">
<Col> <Col>
<span class="red">请选择上传文件!</span> <span class="red">请选择上传文件!</span>
</Col> </Col>
</Row> </Row>
<Row> <Row>
<Col span="15">&nbsp;</Col> <Col span="15">&nbsp;</Col>
<Col span="9"> <Col span="9">
<Button @click="handleClose" class="mr20">取消</Button> <Button @click="handleClose" class="mr20">取消</Button>
<Button type="primary" @click="suerUp()" v-noClick>保存</Button> <Button type="primary" @click="suerUp()" v-noClick>保存</Button>
</Col> </Col>
</Row> </Row>
</Form> </Form>
<!-- <Detail :eid="curId" /> --> <!-- <Detail :eid="curId" /> -->
...@@ -42,184 +55,202 @@ ...@@ -42,184 +55,202 @@
</div> </div>
</template> </template>
<script> <script>
import Api from '../api' import Api from "../api";
import service from '@/plugins/request' import service from "@/plugins/request";
export default { export default {
name: 'list', name: "list",
// components:{ // components:{
// Add,Edit,Detail,Search // Add,Edit,Detail,Search
// }, // },
data() { data() {
return { return {
action: Api.index, action: Api.index,
addModal: false, addModal: false,
editModal: false, editModal: false,
detailModal: false, detailModal: false,
deletelModal: false, deletelModal: false,
redmsg:false, redmsg: false,
rules: { rules: {
storeTitle: [ storeTitle: [
{ required: true, message: '请选择库位', trigger: 'blur' } { required: true, message: "请选择库位", trigger: "blur" },
], ],
},
qcfileparms: "app=qms&eid=" + this.curId + "&name=ProcessRecord", //模块+单条数据id+文件字段名
setNumForm: {
substrateCoding: "",
id: 0,
imgName: "",
},
easySearch: {
keys: { op: "brand,name", value: "", default: true },
reinspectionStatus: { op: "Equal", value: 0 },
status: { op: "Equal", value: 3 },
},
columns: [
{ key: "id", title: this.l("id"), hide: true, align: "left" },
{
key: "codeRuleType",
title: "类别",
align: "center",
code: "material.code.type",
import: true,
hide: true,
}, },
qcfileparms: 'app=qms&eid=' + this.curId + '&name=ProcessRecord', //模块+单条数据id+文件字段名 // {
setNumForm: { // key: "codeRuleId",
substrateCoding: '', // title: "编码名称",
id: 0, // materialKey: "3",
imgName: '' // import: true,
// hide: true,
// render: (h, params) => {
// return h("span", {}, this.getType3(params.row.codeRuleId));
// },
// },
// {
// key: "rootCategoryId",
// title: "大类",
// align: "right",
// materialKey: "1",
// import: true,
// hide: true,
// render: (h, params) => {
// return h("span", {}, this.getType1(params.row.rootCategoryId));
// },
// },
// {
// key: "categoryId",
// title: "子类",
// align: "right",
// materialKey: "2",
// import: true,
// hide: true,
// render: (h, params) => {
// return h("span", {}, this.getType2(params.row.categoryId));
// },
// },
{
key: "code",
title: "编码",
align: "left",
render: (h, params) => {
return h(
"div",
{
props: {},
on: {
click: () => this.details(params.row),
},
},
!params.row.code || params.row.code == 0
? "未分配"
: params.row.code
);
},
}, },
easySearch: { {
keys: { op: 'brand,name', value: '',default:true}, key: "name",
reinspectionStatus: { op: 'Equal', value: 1 } title: "名称",
align: "left",
}, },
columns: [ {
{ key: 'id', title: this.l('id'), hide: true, align: 'left' }, key: "status",
{ title: "状态",
key: 'brand', align: "center",
title: this.l('brand'), code: "material.main.status",
align: 'left', },
easy: true, {
high: true key: "version",
},{ title: "版本",
key: 'name', align: "left",
title: this.l('name'), code: "material.main.version",
align: 'left', },
easy: true, {
high: true key: "drawing",
},{ title: "图号",
key: 'specifications', align: "left",
title: this.l('specifications'), },
align: 'left', {
easy: true, key: "creationTime",
high: true title: "创建时间",
},{ hide: true,
key: 'batchNo', align: "left",
title: this.l('batchNo'), type: "date",
align: 'left', },
easy: true, {
high: true, key: "creatorUserId",
hide:true, title: "创建人",
},{ hide: true,
key: 'originalManufacturer', align: "left",
title: this.l('originalManufacturer'), type: "user",
align: 'left', },
easy: true, {
high: true, title: "操作",
hide:true, key: "id",
}, width: 100,
// { align: "center",
// key: 'reinspectionDate', render: (h, params) => {
// title: this.l('reinspectionDate'), return h("div", { class: "action" }, [
// align: 'center', h(
// render: (h, paras) => { "op",
// return h('span', paras.row.reinspectionDate) {
// }, attrs: {
// high: true, oprate: "detail",
// width:180, },
// }, on: { click: () => this.detail(params.row.id) },
{ },
key: 'remainingAmount', "复验"
title: this.l('remainingAmount'), ),
align: 'left', ]);
high: true },
},{ },
key: 'storeId', ],
title: this.l('storeId'), };
align: 'left',
render: (h, paras) => {
return h('span', paras.row.storeId)
},
high: true
},{
key: 'location',
title: this.l('location'),
align: 'left',
easy: true,
high: true
},{
key: 'category',
title: this.l('category'),
align: 'center',
high: true,
code: 'mes_xingchi_resource.material.powderType'
},{
key: 'reinspectionStatus',
title: this.l('reinspectionStatus'),
code: 'mes_xingchi_resource.material.recheckState',
align: 'center',
easy: true,
high: true,
width:100
},
{
title: '操作',
key: 'id',
width: 100,
align: 'center',
render: (h, params) => {
return h('div', { class: 'action' }, [
h(
'op',
{
attrs:{
oprate:'detail'
} ,
on: { click: () => this.detail(params.row.id) }
},
'复验'
)
])
}
}
]
}
},
mounted() {
}, },
mounted() {},
methods: { methods: {
detail(id) { detail(id) {
this.detailModal = true this.detailModal = true;
this.setNumForm = { this.setNumForm = {
substrateCoding: '', substrateCoding: "",
id: id, id: id,
imgName: '' imgName: "",
} };
// this.setNumForm.id = id; // this.setNumForm.id = id;
}, },
suerUp() { suerUp() {
if(this.setNumForm.imgName == ''||this.setNumForm.imgName == null){ if (this.setNumForm.imgName == "" || this.setNumForm.imgName == null) {
this.detailModal = true; this.detailModal = true;
this.redmsg = true; this.redmsg = true;
}else{ } else {
this.redmsg = false; this.redmsg = false;
let url = `${resourceUrl}/materialpowder/exam`, let url = `${material}/material/exam`,
parmse = { parmse = {
"id": this.setNumForm.id, id: this.setNumForm.id,
"certificateNumber": this.setNumForm.substrateCoding, certificateNumber: this.setNumForm.substrateCoding,
"certificateUploadPath": this.setNumForm.imgName, certificateUploadPath: this.setNumForm.imgName,
}; };
service.post(`${url}`,parmse).then((res) => { service.post(`${url}`, parmse).then((res) => {
if(res.success){ if (res.success) {
this.$Message.success('订单已复验。') this.$Message.success("订单已复验。");
this.detailModal = false; this.detailModal = false;
this.$refs.grid.load() this.$refs.grid.load();
}else{ } else {
this.$Message.warning('请重新复验!') this.$Message.warning("请重新复验!");
} }
}) });
} }
}, },
handleClose() { handleClose() {
this.detailModal = false this.detailModal = false;
}, },
// 列表title // 列表title
l(key) { l(key) {
let vkey = 'waitReview' + '.' + key let vkey = "waitReview" + "." + key;
return this.$t(vkey) || key return this.$t(vkey) || key;
} },
} },
} };
</script> </script>
<style lang="less"> <style lang="less">
</style> </style>
\ No newline at end of file
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