|
|
|
@ -47,10 +47,11 @@ |
|
|
|
fixed="right" |
|
|
|
header-align="center" |
|
|
|
align="center" |
|
|
|
width="60" |
|
|
|
width="100" |
|
|
|
label="操作"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-link v-if="!authUpdate" style="cursor: pointer" @click="updateModal(scope.row)">修改</el-link> |
|
|
|
<el-link style="cursor: pointer" @click="costHistorySearch(scope.row)">成本历史</el-link> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
@ -121,7 +122,7 @@ |
|
|
|
</el-form> |
|
|
|
<el-form :inline="true" label-position="top" :model="modalData" style="margin-top: 0px;"> |
|
|
|
<el-form-item label="备注" style="height: 80px"> |
|
|
|
<el-input v-model="modalData.remark" style="width: 565px"></el-input> |
|
|
|
<el-input v-model="modalData.costRemark" style="width: 565px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
|
@ -131,16 +132,45 @@ |
|
|
|
</el-footer> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<!-- 成本历史模态框 --> |
|
|
|
<el-dialog title="物料成本信息 - 成本历史" @close="closeCostHistoryDialog" :close-on-click-modal="false" v-drag :visible.sync="costHistoryFlag" width="680px"> |
|
|
|
<el-table |
|
|
|
:height="height - 300" |
|
|
|
:data="costHistoryList" |
|
|
|
border |
|
|
|
style="width: 100%;"> |
|
|
|
<el-table-column |
|
|
|
v-for="(item,index) in columnCostHistoryList" :key="index" |
|
|
|
:sortable="item.columnSortable" |
|
|
|
:prop="item.columnProp" |
|
|
|
:header-align="item.headerAlign" |
|
|
|
:show-overflow-tooltip="item.showOverflowTooltip" |
|
|
|
:align="item.align" |
|
|
|
:fixed="item.fixed==''?false:item.fixed" |
|
|
|
:min-width="item.columnWidth" |
|
|
|
:label="item.columnLabel"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span> |
|
|
|
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<el-button type="primary" @click="closeCostHistoryDialog">关闭</el-button> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<choose-list-eam ref="baseList" @getBaseData="getBaseData"></choose-list-eam> |
|
|
|
|
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
import {partCostInformationSearch,partCostInformationEdit} from "@/api/part/partCostInformation"; |
|
|
|
import {partInformationSearch,partCostInformationEdit} from "@/api/part/partInformation"; |
|
|
|
import Chooselist from "../common/Chooselist.vue"; |
|
|
|
import {getSiteAndBuByUserName} from "../../../api/qc/qc"; |
|
|
|
import ChooseListEam from "../common/Chooselist_eam.vue"; |
|
|
|
import {verifyData} from "../../../api/part/partInformation"; |
|
|
|
import {costHistorySearch, verifyData} from "../../../api/part/partInformation"; |
|
|
|
import {getTableDefaultListLanguage, getTableUserListLanguage} from "../../../api/table"; |
|
|
|
|
|
|
|
export default { |
|
|
|
components: { |
|
|
|
@ -186,7 +216,7 @@ export default { |
|
|
|
standardCostCurrency: '', |
|
|
|
actualCost: '', |
|
|
|
actualCostCurrency: '', |
|
|
|
remark: '', |
|
|
|
costRemark: '', |
|
|
|
createBy: '', |
|
|
|
createDate: '', |
|
|
|
updateBy: '', |
|
|
|
@ -195,13 +225,14 @@ export default { |
|
|
|
originalData: {}, |
|
|
|
// ======== 数据列表 ======== |
|
|
|
dataList: [], |
|
|
|
costHistoryList: [], |
|
|
|
// 展示列集 |
|
|
|
columnList: [ |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 6010011, |
|
|
|
serialNumber: '6010011Table2BuDesc', |
|
|
|
tableId: '6010011Table2', |
|
|
|
serialNumber: '6010011Table1BuDesc', |
|
|
|
tableId: '6010011Table1', |
|
|
|
tableName: '物料成本表', |
|
|
|
columnProp: 'buDesc', |
|
|
|
headerAlign: 'center', |
|
|
|
@ -434,10 +465,10 @@ export default { |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 6010011, |
|
|
|
serialNumber: '6010011Table1Remark', |
|
|
|
serialNumber: '6010011Table1CostRemark', |
|
|
|
tableId: '6010011Table1', |
|
|
|
tableName: '物料成本表', |
|
|
|
columnProp: 'remark', |
|
|
|
columnProp: 'costRemark', |
|
|
|
headerAlign: 'center', |
|
|
|
align: 'left', |
|
|
|
columnLabel: '备注', |
|
|
|
@ -522,6 +553,134 @@ export default { |
|
|
|
columnWidth: 80 |
|
|
|
} |
|
|
|
], |
|
|
|
columnCostHistoryList: [ |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 6010011, |
|
|
|
serialNumber: '6010011Table2FieldCaption', |
|
|
|
tableId: '6010011Table2', |
|
|
|
tableName: '物料成本表', |
|
|
|
columnProp: 'fieldcaption', |
|
|
|
headerAlign: 'center', |
|
|
|
align: 'center', |
|
|
|
columnLabel: '名称', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 100 |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 6010011, |
|
|
|
serialNumber: '6010011Table2FieldName', |
|
|
|
tableId: '6010011Table2', |
|
|
|
tableName: '物料成本表', |
|
|
|
columnProp: 'fieldname', |
|
|
|
headerAlign: 'center', |
|
|
|
align: 'center', |
|
|
|
columnLabel: '字段', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 100 |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 6010011, |
|
|
|
serialNumber: '6010011Table2OldValue', |
|
|
|
tableId: '6010011Table2', |
|
|
|
tableName: '物料成本表', |
|
|
|
columnProp: 'oldvalue', |
|
|
|
headerAlign: 'center', |
|
|
|
align: 'center', |
|
|
|
columnLabel: 'Old Value', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 100 |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 6010011, |
|
|
|
serialNumber: '6010011Table2NewValue', |
|
|
|
tableId: '6010011Table2', |
|
|
|
tableName: '物料成本表', |
|
|
|
columnProp: 'newvalue', |
|
|
|
headerAlign: 'center', |
|
|
|
align: 'center', |
|
|
|
columnLabel: 'New Value', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 100 |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 6010011, |
|
|
|
serialNumber: '6010011Table2Recordtype', |
|
|
|
tableId: '6010011Table2', |
|
|
|
tableName: '物料成本表', |
|
|
|
columnProp: 'recordtype', |
|
|
|
headerAlign: 'center', |
|
|
|
align: 'center', |
|
|
|
columnLabel: '变更类型', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 100 |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 6010011, |
|
|
|
serialNumber: '6010011Table2UserId', |
|
|
|
tableId: '6010011Table2', |
|
|
|
tableName: '物料成本表', |
|
|
|
columnProp: 'userid', |
|
|
|
headerAlign: 'center', |
|
|
|
align: 'center', |
|
|
|
columnLabel: '更新人', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 100 |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 6010011, |
|
|
|
serialNumber: '6010011Table2CreateDate', |
|
|
|
tableId: '6010011Table2', |
|
|
|
tableName: '物料成本表', |
|
|
|
columnProp: 'createdate', |
|
|
|
headerAlign: 'center', |
|
|
|
align: 'center', |
|
|
|
columnLabel: '更新时间', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 100 |
|
|
|
} |
|
|
|
], |
|
|
|
// ======== 模态框开关控制 ======== |
|
|
|
authSearch: false, |
|
|
|
authSave: false, |
|
|
|
@ -529,6 +688,7 @@ export default { |
|
|
|
authDelete: false, |
|
|
|
modalFlag: false, |
|
|
|
modalDisableFlag: false, |
|
|
|
costHistoryFlag: false, |
|
|
|
menuId: this.$route.meta.menuId, |
|
|
|
tagNo:undefined, |
|
|
|
} |
|
|
|
@ -546,7 +706,7 @@ export default { |
|
|
|
// 获取用户的 site 和 bu |
|
|
|
this.getSiteAndBuByUserName() |
|
|
|
// 动态列 |
|
|
|
// this.getTableUserColumn(this.$route.meta.menuId+'table1',1) |
|
|
|
this.getTableUserColumn(this.$route.meta.menuId+'table1',1) |
|
|
|
if (!this.authSearch) { |
|
|
|
// 获取数据列表 |
|
|
|
this.getDataList() |
|
|
|
@ -632,7 +792,7 @@ export default { |
|
|
|
this.searchData.limit = this.pageSize |
|
|
|
this.searchData.page = this.pageIndex |
|
|
|
this.searchData.buNo = this.searchData.bu.split('_')[1] |
|
|
|
partCostInformationSearch(this.searchData).then(({data}) => { |
|
|
|
partInformationSearch(this.searchData).then(({data}) => { |
|
|
|
if (data.code === 0) { |
|
|
|
this.dataList = data.page.list |
|
|
|
this.pageIndex = data.page.currPage |
|
|
|
@ -667,7 +827,7 @@ export default { |
|
|
|
standardCostCurrency: row.standardCostCurrency, |
|
|
|
actualCost: row.actualCost, |
|
|
|
actualCostCurrency: row.actualCostCurrency, |
|
|
|
remark: row.remark, |
|
|
|
costRemark: row.costRemark, |
|
|
|
createBy: row.createBy, |
|
|
|
createDate: row.createDate, |
|
|
|
} |
|
|
|
@ -700,7 +860,7 @@ export default { |
|
|
|
standardCostCurrency: this.modalData.standardCostCurrency, |
|
|
|
actualCost: this.modalData.actualCost, |
|
|
|
actualCostCurrency: this.modalData.actualCostCurrency, |
|
|
|
remark: this.modalData.remark, |
|
|
|
costRemark: this.modalData.costRemark, |
|
|
|
updateBy: this.$store.state.user.name, |
|
|
|
updateDate:'' |
|
|
|
} |
|
|
|
@ -748,7 +908,7 @@ export default { |
|
|
|
standardCostCurrency: '', |
|
|
|
actualCost: '', |
|
|
|
actualCostCurrency: '', |
|
|
|
remark: '', |
|
|
|
costRemark: '', |
|
|
|
} |
|
|
|
this.modalFlag = false |
|
|
|
}, |
|
|
|
@ -757,7 +917,67 @@ export default { |
|
|
|
if (this.modalData.actualCost === '' || this.modalData.actualCost === null){ |
|
|
|
this.modalData.actualCost = this.modalData.standardCost |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
costHistorySearch(row) { |
|
|
|
let inData = { |
|
|
|
site: row.site, |
|
|
|
partno: row.partNo |
|
|
|
} |
|
|
|
costHistorySearch(inData).then(({data}) => { |
|
|
|
if (data.code === 0) { |
|
|
|
this.costHistoryList = data.rows |
|
|
|
this.costHistoryFlag = true |
|
|
|
} else { |
|
|
|
this.$message.error(data.msg) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
closeCostHistoryDialog () { |
|
|
|
this.costHistoryFlag = false |
|
|
|
this.costHistoryList = [] |
|
|
|
}, |
|
|
|
|
|
|
|
// 动态列开始 获取 用户保存的 格式列 |
|
|
|
async getTableUserColumn(tableId, columnId) { |
|
|
|
let queryTableUser = { |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: this.$route.meta.menuId, |
|
|
|
tableId: tableId, |
|
|
|
status: true, |
|
|
|
languageCode: this.$i18n.locale |
|
|
|
} |
|
|
|
await getTableUserListLanguage(queryTableUser).then(({data}) => { |
|
|
|
if (data.rows.length > 0) { |
|
|
|
switch (columnId) { |
|
|
|
case 1: |
|
|
|
this.columnList = data.rows |
|
|
|
break; |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.getColumnList(tableId, columnId) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 获取 tableDefault 列 |
|
|
|
async getColumnList (tableId, columnId) { |
|
|
|
let queryTable= { |
|
|
|
functionId: this.$route.meta.menuId, |
|
|
|
tableId: tableId, |
|
|
|
languageCode: this.$i18n.locale |
|
|
|
} |
|
|
|
await getTableDefaultListLanguage(queryTable).then(({data}) => { |
|
|
|
if (!data.rows.length === 0) { |
|
|
|
switch (columnId) { |
|
|
|
case 1: |
|
|
|
this.columnList = data.rows |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|