Commit 2018928a authored by renjintao's avatar renjintao

料单配套

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