Yang 3 years ago
commit 116e7ac736

8
components.d.ts vendored

@ -10,9 +10,8 @@ declare module '@vue/runtime-core' {
LayButton: typeof import('@layui/layui-vue')['LayButton'] LayButton: typeof import('@layui/layui-vue')['LayButton']
LayCard: typeof import('@layui/layui-vue')['LayCard'] LayCard: typeof import('@layui/layui-vue')['LayCard']
LayCheckbox: typeof import('@layui/layui-vue')['LayCheckbox'] LayCheckbox: typeof import('@layui/layui-vue')['LayCheckbox']
LayCheckboxGroup: typeof import('@layui/layui-vue')['LayCheckboxGroup']
LayCol: typeof import('@layui/layui-vue')['LayCol'] LayCol: typeof import('@layui/layui-vue')['LayCol']
LayCollapse: typeof import('@layui/layui-vue')['LayCollapse']
LayCollapseItem: typeof import('@layui/layui-vue')['LayCollapseItem']
LayColorPicker: typeof import('@layui/layui-vue')['LayColorPicker'] LayColorPicker: typeof import('@layui/layui-vue')['LayColorPicker']
LayConfigProvider: typeof import('@layui/layui-vue')['LayConfigProvider'] LayConfigProvider: typeof import('@layui/layui-vue')['LayConfigProvider']
LayContainer: typeof import('@layui/layui-vue')['LayContainer'] LayContainer: typeof import('@layui/layui-vue')['LayContainer']
@ -32,8 +31,6 @@ declare module '@vue/runtime-core' {
LayLogo: typeof import('@layui/layui-vue')['LayLogo'] LayLogo: typeof import('@layui/layui-vue')['LayLogo']
LayMenu: typeof import('@layui/layui-vue')['LayMenu'] LayMenu: typeof import('@layui/layui-vue')['LayMenu']
LayMenuItem: typeof import('@layui/layui-vue')['LayMenuItem'] LayMenuItem: typeof import('@layui/layui-vue')['LayMenuItem']
LayProgress: typeof import('@layui/layui-vue')['LayProgress']
LayQuote: typeof import('@layui/layui-vue')['LayQuote']
LayRadio: typeof import('@layui/layui-vue')['LayRadio'] LayRadio: typeof import('@layui/layui-vue')['LayRadio']
LayRow: typeof import('@layui/layui-vue')['LayRow'] LayRow: typeof import('@layui/layui-vue')['LayRow']
LayScroll: typeof import('@layui/layui-vue')['LayScroll'] LayScroll: typeof import('@layui/layui-vue')['LayScroll']
@ -45,9 +42,6 @@ declare module '@vue/runtime-core' {
LayTab: typeof import('@layui/layui-vue')['LayTab'] LayTab: typeof import('@layui/layui-vue')['LayTab']
LayTabItem: typeof import('@layui/layui-vue')['LayTabItem'] LayTabItem: typeof import('@layui/layui-vue')['LayTabItem']
LayTable: typeof import('@layui/layui-vue')['LayTable'] LayTable: typeof import('@layui/layui-vue')['LayTable']
LayTextarea: typeof import('@layui/layui-vue')['LayTextarea']
LayTooltip: typeof import('@layui/layui-vue')['LayTooltip']
LayUpload: typeof import('@layui/layui-vue')['LayUpload']
LightIcon: typeof import('./src/components/LightIcon.vue')['default'] LightIcon: typeof import('./src/components/LightIcon.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink'] RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView'] RouterView: typeof import('vue-router')['RouterView']

@ -1,17 +1,23 @@
<template> <template>
<lay-container fluid="true" class="content-box"> <lay-container fluid="true" class="content-box">
<lay-table class="row-select" v-if="dataColumn.length>0" height="320px" :columns="dataColumn" <FormulaView :teamId="dataInfoObj.FTeamID" :halfId="dataInfoObj.FMaterialHalfIDs"></FormulaView>
<lay-layer area="90%" v-model="showFreezingColumnSettingBox" title="固定列设置">
<FreezingColumnSetting v-if="showFreezingColumnSettingBox" :columns="tmpDataColumn" :freezingColumns="freezingColumnSetting" @cancelClick="setFreezingColumnsSetting"></FreezingColumnSetting>
</lay-layer>
<lay-table id="dataTable" v-if="dataColumn.length>0" height="320px" :columns="dataColumn"
:data-source="dataList" :cellStyle="cellStyle" :cellClassName="cellClassName"> :data-source="dataList" :cellStyle="cellStyle" :cellClassName="cellClassName">
<template v-slot:toolbar v-if="dataInfoObj.FCanEdit!=2"> <template v-slot:toolbar v-if="dataInfoObj.FCanEdit!=2">
<lay-button size="sm" @click="saveBatch" type="primary" :disabled="editColumn.length===0">保存 <lay-button size="sm" @click="saveBatch" type="primary" :disabled="editColumn.length===0">保存
</lay-button> </lay-button>
<!-- <lay-button size="sm" type="primary" :class="this.isBomShow ? 'isBomShow' : 'isBomHidden'" @click="changeVisible2">BOM</lay-button>-->
<lay-input :class="this.isShow ? 'isShow' : 'isHidden'" v-model="inputCodeValue" :readonly="true"> <lay-input :class="this.isShow ? 'isShow' : 'isHidden'" v-model="inputCodeValue" :readonly="true">
<template #prepend>半成品编号</template> <template #prepend>半成品编号</template>
</lay-input> </lay-input>
<lay-input :class="this.isShow ? 'isShow' : 'isHidden'" v-model="inputDescValue" :readonly="true"> <lay-input :class="this.isShow ? 'isShow' : 'isHidden'" v-model="inputDescValue" :readonly="true">
<template #prepend>描述</template> <template #prepend>描述</template>
</lay-input> </lay-input>
<lay-button size="sm" type="primary" style="float:right;" :disabled="editColumn.length===0" @click="_clickFreezingColumnSetting()">
</lay-button>
</template> </template>
<template v-for="item in editColumn" v-slot:[item.key]="{ data }"> <template v-for="item in editColumn" v-slot:[item.key]="{ data }">
<lay-select v-if="item.key=='FTypeID1'" size="sm" v-model="data['FTypeID1']" <lay-select v-if="item.key=='FTypeID1'" size="sm" v-model="data['FTypeID1']"
@ -32,9 +38,6 @@
</template> </template>
</lay-table> </lay-table>
<OperateLog v-if="dataInfoObj.FTeamID" ref="OperateLog" :dataInfoObj="dataInfoObj"></OperateLog> <OperateLog v-if="dataInfoObj.FTeamID" ref="OperateLog" :dataInfoObj="dataInfoObj"></OperateLog>
<!-- <lay-layer title="标题" :move="false" v-model="visible2">-->
<!-- 内容-->
<!-- </lay-layer>-->
</lay-container> </lay-container>
</template> </template>
@ -76,8 +79,6 @@
.isHidden{ .isHidden{
display: none; display: none;
} }
.isBomShow{
}
.isBomHidden{ .isBomHidden{
display: none; display: none;
} }
@ -103,10 +104,14 @@
changeInfoData changeInfoData
} from "/src/api/api/materialType"; } from "/src/api/api/materialType";
import OperateLog from "./OperateLog.vue"; import OperateLog from "./OperateLog.vue";
import FormulaView from "./FormulaView.vue";
import FreezingColumnSetting from './FreezingColumnSetting.vue';
export default { export default {
components: { components: {
OperateLog OperateLog,
FormulaView,
FreezingColumnSetting
}, },
setup() { setup() {
const dataColumn = ref([]); const dataColumn = ref([]);
@ -133,7 +138,10 @@
const visible2 = ref(false) const visible2 = ref(false)
const changeVisible2 = function() { const changeVisible2 = function() {
visible2.value = !visible2.value visible2.value = !visible2.value
} };
const showFreezingColumnSettingBox = ref(false);
const freezingColumnSetting = ref([]);
const tmpDataColumn = ref([]);
return { return {
dataColumn, dataColumn,
dataList, dataList,
@ -148,7 +156,10 @@
isShow: false, isShow: false,
isBomShow :false, isBomShow :false,
visible2, visible2,
changeVisible2 changeVisible2,
showFreezingColumnSettingBox,
freezingColumnSetting,
tmpDataColumn
}; };
}, },
props: { props: {
@ -258,6 +269,7 @@
this.editColumn = editColumn; this.editColumn = editColumn;
this.dataList = _data.rows; this.dataList = _data.rows;
this.dataColumn = dataColumn; this.dataColumn = dataColumn;
setTimeout(function() { setTimeout(function() {
layer.close(idx); layer.close(idx);
}, 500); }, 500);
@ -344,6 +356,54 @@
layer.close(idx); layer.close(idx);
layer.msg('您没有做任何更改') layer.msg('您没有做任何更改')
} }
},
_clickFreezingColumnSetting() {
this.tmpDataColumn = this.dataColumn;
this.dataColumn = ref([]);
this.showFreezingColumnSettingBox = true;
console.log('before', this.tmpDataColumn);
},
setFreezingColumns() {
let freezingColumns = [];
if (this.freezingColumnSetting && this.freezingColumnSetting.length > 0) {
this.freezingColumnSetting.forEach(column => {
let colIndex = this.tmpDataColumn.findIndex(d => d.key === column);
if (colIndex >= 0) {
let proxyFc = this.tmpDataColumn.splice(colIndex, 1)[0];
const {proxy, revoke} = Proxy.revocable(proxyFc, {});
const fc = {...proxy};
revoke();
console.log('fc', fc);
if (fc) {
fc.fixed = "left";
freezingColumns.push(fc);
}
}
})
}
if (freezingColumns && freezingColumns.length > 0) {
for(let i=freezingColumns.length-1; i>=0; i--) {
this.tmpDataColumn.unshift(freezingColumns[i]);
}
// freezingColumns = freezingColumns.concat(this.tmpDataColumn);
this.dataColumn = this.tmpDataColumn;
console.log('after', this.dataColumn);
} else {
this.dataColumn = this.tmpDataColumn;
}
},
setFreezingColumnsSetting(fcs) {
if (fcs && fcs.length > 0) {
this.freezingColumnSetting = fcs;
// this.freezingColumnSetting = ["FTestCode", "FMaterialGroup", "FWorkCenter"];
this.setFreezingColumns();
} else {
this.dataColumn = this.tmpDataColumn;
}
this.showFreezingColumnSettingBox = false;
} }
} }
} }

@ -0,0 +1,118 @@
<template>
<lay-table style="margin:0 0 30px 0;" height="200px" :columns="dataColumn" :data-source="dataList">
<template v-slot:toolbar>
<p style="float:left;">配方视图</p>
</template>
</lay-table>
</template>
<script>
import {
ref
} from 'vue';
import {
getTeamworkView
} from "/src/api/api/teamwork";
export default {
setup() {
const viewList = ref([]);
const dataColumn = ref([
{type: 'number', title: '序号', width: '56'},
{key: '工厂', title: '工厂', align: 'center', width: '130px'},
{key: '开始生效日期', title: '开始生效日期', align: 'center', width: '130px'},
{key: 'BOM用途', title: 'BOM用途', align: 'center', width: '130px'},
{key: 'BOM状态', title: 'BOM状态', align: 'center', width: '130px'},
{key: '可选文本', title: '可选文本', align: 'center', width: '130px'},
{key: '可选BOM', title: '可选BOM', align: 'center', width: '130px'},
{key: '父项编码', title: '父项编码', align: 'center', width: '200px'},
{key: '父项描述', title: '父项描述', align: 'center', width: '300px'},
{key: '基本数量', title: '基本数量', align: 'center', width: '130px'},
{key: '基本单位', title: '基本单位', align: 'center', width: '130px'},
{key: '子项序号', title: '子项序号', align: 'center', width: '130px'},
{key: '项目类别', title: '项目类别', align: 'center', width: '130px'},
{key: '子项编码', title: '子项编码', align: 'center', width: '200px'},
{key: '子件描述', title: '子件描述', align: 'center', width: '300px'},
{key: '组件数量', title: '组件数量', align: 'center', width: '130px'},
{key: '计量单位', title: '计量单位', align: 'center', width: '130px'},
{key: '工程变更号', title: '工程变更号', align: 'center', width: '130px'},
{key: '项目ID', title: '项目ID', align: 'center', width: '130px'},
{key: '物料供应标识符', title: '物料供应标识符', align: 'center', width: '130px'},
{key: '备件标示', title: '备件标示', align: 'center', width: '130px'},
{key: '生产仓储地点', title: '生产仓储地点', align: 'center', width: '130px'},
{key: '组件损耗率', title: '组件损耗率', align: 'center', width: '130px'},
{key: '成本核算标识相关', title: '成本核算标识相关', align: 'center', width: '130px'},
{key: '生产相关', title: '生产相关', align: 'center', width: '130px'},
{key: 'BOM项目文本1', title: 'BOM项目文本1', align: 'center', width: '130px'},
{key: 'BOM项目文本2', title: 'BOM项目文本2', align: 'center', width: '130px'},
{key: '替代项目组', title: '替代项目组', align: 'center', width: '130px'},
{key: '优先级', title: '优先级', align: 'center', width: '130px'},
{key: '策略', title: '策略', align: 'center', width: '130px'},
{key: '使用可能性', title: '使用可能性', align: 'center', width: '130px'},
{key: '固定损耗数量', title: '固定损耗数量', align: 'center', width: '130px'}
]);
const dataList = ref([]);
return {
viewList,
dataColumn,
dataList
}
},
props: {
teamId: {
type: String,
default: () => ""
},
halfId: {
type: String,
default: () => ""
}
},
mounted() {
this.initPage();
},
methods: {
async initPage() {
let dataColumn = [{
type: "number",
title: "序号",
width: "56"
}];
let dataList = [];
let postData = {
FTeamID: this.teamId,
FViewType: 2,
FType: 1,
HalfId : this.halfId
};
let result = await getTeamworkView(postData);
let formulaList = result["List1"]
if (formulaList) {
for (let key in formulaList[0]) {
let width = (key.indexOf("描述") != -1 || key == "文本" || key == "物料") ? "300px" :
"130px";
width = key.indexOf("编码") != -1 ? "200px" : width;
dataColumn.push({
key: key,
title: key.split('.').pop(),
align: "center",
width: width
});
}
formulaList.forEach((item) => {
dataList.push(item);
});
}
// this.dataColumn = dataColumn;
this.dataList = dataList;
}
}
}
</script>

@ -0,0 +1,78 @@
<template>
<lay-container>
<view class="layui-item33 color999" :style="'max-height:900px'">
<lay-row space="10">
<lay-col md="4" sm="12" xs="24" v-for="(item, index) in columns">
<lay-checkbox-group v-model="checkedItem">
<lay-checkbox :name="item.title" skin="primary" :value="item.key">
{{ item.title }}
</lay-checkbox>
</lay-checkbox-group>
</lay-col>
</lay-row>
</view>
<view class="menuBtn">
<lay-button type="primary" @click="submitClick"></lay-button>
<lay-button @click="cancelClick"></lay-button>
</view>
</lay-container>
</template>
<script>
import {
ref
} from 'vue';
export default {
setup() {
const columnList = ref([]);
const checkedItem = ref([]);
return {
columnList,
checkedItem,
}
},
props: {
columns: {
type: Object,
default: () => [],
},
freezingColumns: {
type: Object,
default: () => [],
}
},
mounted() {
this.initPage();
},
methods: {
initPage() {
this.columnList = this.columns;
this.checkedItem = this.freezingColumns
},
cancelClick() {
this.$emit('cancelClick');
},
submitClick() {
this.$emit('cancelClick', this.checkedItem);
}
}
}
</script>
<style scoped>
.layui-item33 {
width: 90%;
padding-right: 30px;
margin: 30px auto 10px;
display: block;
overflow: auto;
position: relative;
clear: both;
}
.menuBtn {
display: block;
text-align: center;
width: 96%;
margin: 20px auto;
}
</style>
Loading…
Cancel
Save