Commit 2018928a authored by renjintao's avatar renjintao

料单配套

parent a72385df
<template> <template>
<div class="h100"> <div class="h100">
<DataGrid :columns="columns" ref="grid" :action="action"> <DataGrid :columns="columns" ref="grid" :action="action" :conditions="easySearch">
<template slot="easySearch"> <template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline> <Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys"> <FormItem prop="keys">
<Input placeholder="请输入申请单号或订单编号" v-model="easySearch.keys.value" v-width="240" /> <Input placeholder="请输入申请单号或订单编号" v-model="easySearch.keys.value" v-width="240" />
</FormItem> </FormItem>
<FormItem> <FormItem>
<Button type="primary" @click="search">查询</Button> <Dictionary code="accessory.status" placeholder="请选择配套状态" :multiple="true" v-model="easySearch.status.value"></Dictionary>
</FormItem> </FormItem>
</Form> <FormItem>
</template> <Button type="primary" @click="search">查询</Button>
</FormItem>
</Form>
</template>
</DataGrid> </DataGrid>
<Modal v-model="modal" :title="title" width="1200" fullscreen footer-hide @on-cancel="ok"> <Modal v-model="modal" :title="title" width="1200" fullscreen footer-hide @on-cancel="ok">
<component :is="detail" :eid="curId" :row="entity" @on-close="cancel" @on-ok="ok" /> <component :is="detail" :eid="curId" :row="entity" @on-close="cancel" @on-ok="ok" />
</Modal> </Modal>
</div> </div>
</template> </template>
<script> <script>
import Api from "./api"; import Api from "./api";
export default { export default {
name: "list", name: "list",
components: {}, components: {},
head: { head: {
title: "配套记录主表", title: "配套记录主表",
author: "henq", author: "henq",
description: "support_main 8/8/2020 9:47:54 AM", description: "support_main 8/8/2020 9:47:54 AM",
}, },
data() { data() {
return { return {
action: Api.index, action: Api.index,
easySearch: { easySearch: {
keys: { op: "orderCode,code", value: null }, keys: {
}, op: "orderCode,code",
statuList: this.$store.getters.dictionaryByKey("accessory.status") || [], value: null
statuList1: this.$store.getters.dictionaryByKey("outstore.status") || [], },
modal: false, status: {
title: "新增", op: "In",
detail: null, value: [0, 1]
curId: 0, }
entity: {}, },
columns: [ statuList: this.$store.getters.dictionaryByKey("accessory.status") || [],
{ statuList1: this.$store.getters.dictionaryByKey("outstore.status") || [],
key: "code", modal: false,
title: this.l("code"), title: "新增",
align: "left", detail: null,
easy: true, curId: 0,
}, entity: {},
{ columns: [{
key: "finishDate", key: "code",
title: this.l("finishDate"), title: this.l("code"),
align: "center", align: "left",
type: "date", easy: true,
width:200,
},
{
key: "orderCode",
title: this.l("orderCode"),
align: "left",
easy: true,
},
{
key: "creationTime",
title: this.l("creationTime"),
align: "center",
type: "date",
width:200,
},
{ key: "creator", title: this.l("creator"), align: "left" },
{
key: "status",
title: this.l("status"),
align: "center",
width:150,
render: (h, params) => {
return h(
"span",
{
style: {
color: this.setName(this.statuList,params.row.status).color,
}, },
},
this.setName(this.statuList,params.row.status).name
);
},
},
{
title: "操作",
key: "action",
width: 140,
align: "center",
render: (h, params) => {
return h("div", { class: "action" }, [
h(
"op",
{ {
attrs: { oprate: "detail" }, key: "finishDate",
on: { click: () => this.getAccessory(params.row) }, title: this.l("finishDate"),
align: "center",
type: "date",
width: 200,
}, },
"配套"
),
h(
"op",
{ {
attrs: { oprate: "edit" }, key: "orderCode",
style:{color:params.row.status==0?"#bebebe":""}, title: this.l("orderCode"),
on: { click: () => params.row.status!=0?this.getOutBound(params.row):null }, align: "left",
easy: true,
}, },
"出库单" {
), key: "creationTime",
]); title: this.l("creationTime"),
}, align: "center",
}, type: "date",
], width: 200,
}; },
}, {
mounted() { key: "creator",
this.search(); title: this.l("creator"),
}, align: "left"
async fetch({ store, params }) { },
await store.dispatch("loadDictionary"); // 加载数据字典 {
}, key: "status",
methods: { title: this.l("status"),
ok() { align: "center",
this.$refs.grid.load(); width: 150,
this.modal = false; code: 'accessory.status'
this.curId = 0; },
}, {
search() { title: "操作",
this.$refs.grid.reload(this.easySearch); key: "action",
}, width: 140,
align: "center",
getAccessory(row) { render: (h, params) => {
this.curId = row.id; return h("div", {
this.title = "配套"; class: "action"
this.entity = row; }, [
this.detail = () => import("./accessory"); h(
this.modal = true; "op", {
}, attrs: {
getOutBound(row) { oprate: "detail"
this.curId = row.id; },
this.title = "出库单"; on: {
this.entity = row; click: () => this.getAccessory(params.row)
this.detail = () => import("./outbound"); },
this.modal = true; },
"配套"
),
h(
"op", {
attrs: {
oprate: "edit"
},
style: {
color: params.row.status == 0 ? "#bebebe" : ""
},
on: {
click: () => params.row.status != 0 ? this.getOutBound(params.row) : null
},
},
"出库单"
),
]);
},
},
],
};
}, },
//配套申请 mounted() {
setName(list, v) { this.search();
let outPar = {
name: "",
color: "",
};
if ((v + "").indexOf(",") == -1) {
var item;
list.map((u) => {
if (u.code == v) {
item = u;
}
});
if (item) {
//this.items = item;
outPar = {
name: item.name,
color: item.color,
};
}
}
return outPar;
}, },
cancel() { async fetch({
this.curId = 0; store,
this.modal = false; params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典
}, },
l(key) { methods: {
let vkey = "support_main" + "." + key; ok() {
return this.$t(vkey) || key; this.$refs.grid.load();
this.modal = false;
this.curId = 0;
},
search() {
this.$refs.grid.reload(this.easySearch);
},
getAccessory(row) {
this.curId = row.id;
this.title = "配套";
this.entity = row;
this.detail = () => import("./accessory");
this.modal = true;
},
getOutBound(row) {
this.curId = row.id;
this.title = "出库单";
this.entity = row;
this.detail = () => import("./outbound");
this.modal = true;
},
//配套申请
setName(list, v) {
let outPar = {
name: "",
color: "",
};
if ((v + "").indexOf(",") == -1) {
var item;
list.map((u) => {
if (u.code == v) {
item = u;
}
});
if (item) {
//this.items = item;
outPar = {
name: item.name,
color: item.color,
};
}
}
return outPar;
},
cancel() {
this.curId = 0;
this.modal = false;
},
l(key) {
let vkey = "support_main" + "." + 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