Browse Source

Merge remote-tracking branch 'origin/master'

master
常熟吴彦祖 3 months ago
parent
commit
93b4612b09
  1. 0
      src/api/part/partInfo.js
  2. 8
      src/api/part/partProperties.js
  3. 10
      src/api/part/partSupplierRelation.js
  4. 3
      src/views/modules/srmPart/com_part_Attachments.vue
  5. 2
      src/views/modules/srmPart/com_part_BasicInfo.vue
  6. 528
      src/views/modules/srmPart/com_part_SpecParams.vue
  7. 260
      src/views/modules/srmPart/com_part_SpecParams_old.vue
  8. 404
      src/views/modules/srmPart/com_part_Suppliers.vue
  9. 20
      src/views/modules/srmPart/partInfoList.vue

0
src/api/srm/srmPart.js → src/api/part/partInfo.js

8
src/api/part/partProperties.js

@ -0,0 +1,8 @@
import { createAPI } from "@/utils/httpRequest.js";
export const refreshPropertiesModal= (data) => createAPI(`/properties/refreshPropertiesModal`,'post',data)
export const updatePropertiesList= (data) => createAPI(`/properties/updatePropertiesList`,'post',data)
export const getPropertiesListByPartAndCodeNo = (data) => createAPI(`/properties/getPropertiesListByPartAndCodeNo`,'post',data)
export const searchPropertiesItemList= data => createAPI(`/properties/searchPropertiesItemList`,'post',data)
export const saveSubPropertiesValueForAlone= data => createAPI(`/properties/saveSubPropertiesValueForAlone`,'post',data)
export const deleteSubPropertiesValueForAlone= data => createAPI(`/properties/deleteSubPropertiesValueForAlone`,'post',data)

10
src/api/part/partSupplierRelation.js

@ -0,0 +1,10 @@
import { createAPI } from '@/utils/httpRequest.js'
export const searchPartSupplierRelationList = data => createAPI('/partSupplierRelation/list', 'POST', data)
export const createPartSupplierRelation = data => createAPI('/partSupplierRelation/save', 'POST', data)
export const updatePartSupplierRelation = data => createAPI('/partSupplierRelation/save', 'POST', data)
export const getPartSupplierRelation = data => createAPI('partSupplierRelation/getPart','POST', data)
export const deletePartSupplierRelation = id => createAPI('/partSupplierRelation/delete', 'POST', { id: id })
export const searchMaterialFamilySupplierData= (data) => createAPI(`/srmSupplierShare/searchMaterialFamilySupplierData`,'post',data)

3
src/views/modules/srmPart/com_part_Attachments.vue

@ -89,8 +89,7 @@ import { removeOssFile } from "../../../api/srm/srmSupplier";
import { downLoadObjectFile } from "../../../api/supplierStock/supplierStockRequest";
import {
ossUploadNoSaveOSSForYJY,
queryOssFilePlus,
previewOssFileById} from "../../../api/oss/oss";
queryOssFilePlus} from "../../../api/oss/oss";
export default {
data() {

2
src/views/modules/srmPart/com_part_BasicInfo.vue

@ -97,7 +97,7 @@
</div>
</template>
<script>
import { searchPartInfo } from '@/api/srm/srmPart.js'
import { searchPartInfo } from '@/api/part/partInfo.js'
export default {
data() {

528
src/views/modules/srmPart/com_part_SpecParams.vue

@ -1,304 +1,414 @@
<template>
<div class="customer-css">
<el-form label-position="top" style="margin-top: 1px; margin-left: 0px;">
<el-form :inline="true" label-position="top" style="margin-top: 0px">
<el-form-item label="Period:">
<el-input v-model="searchData.periodMohu" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item label="Period Date:">
<el-date-picker
style="width: 120px"
v-model="searchData.startDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="Start">
</el-date-picker>
</el-form-item>
<el-form-item label="to:">
<el-date-picker
style="width: 120px"
v-model="searchData.endDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="End">
</el-date-picker>
</el-form-item>
<el-form-item label=" ">
<el-button type="primary" @click="searchTable()">Query</el-button>
<!-- <el-button type="primary" @click="addModal()">新增</el-button>-->
</el-form-item>
</el-form>
</el-form>
<div>
<div style="margin-top: 5px">
<el-button type="primary" @click="clickSave">{{ attributeDialog?'编辑':'保存' }}</el-button>
<el-button type="primary" @click="refreshPropertiesModal" :disabled="disabled" v-if="attributeDialog">刷新属性模板</el-button>
</div>
<div class="rq " v-if="attributeDialog">
<el-table
:height="height"
:data="dataList"
:height=searchData.height
border
v-loading="dataListLoading"
style="width: 100%; ">
style="width: 100%;margin-top: 5px">
<el-table-column
v-for="(item,index) in columnList" :key="index"
v-for="(item,index) in productColumnList" :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"
:fixed="item.fixed===''?false:item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<div v-if="item.columnProp !== 'textValue' && item.columnProp !== 'numValue'">
<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>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
</div>
<div v-else>
{{scope.row.valueTypeDb==='T'?scope.row.textValue:scope.row.numValue}}
</div>
</template>
</el-table-column>
</el-table>
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
</div>
<div class="rq " v-else>
<el-table
:height="height"
:data="copyAttributeList"
border
style="width: 100%;margin-top: 5px">
<el-table-column
v-for="(item,index) in productColumnList" :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">
<div v-if="item.columnProp !== 'textValue' && item.columnProp !== 'numValue'">
<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>
</div>
<div v-else>
<div v-if="scope.row.valueChooseFlag !== 'Y'">
<el-input-number v-model="scope.row.numValue" style="padding: 0;width: 100%" v-if="scope.row.valueType === '数字'" :controls="false"
></el-input-number>
<el-input v-model="scope.row.textValue" v-else></el-input>
</div>
<div v-else>
<el-select style="width: 100%;" v-if="scope.row.valueType === '文本'" v-model="scope.row.textValue">
<el-option :value="i.availableValue" :label="i.availableValue" v-for="(i,key) in scope.row.availableValueList" :key="key"></el-option>
</el-select>
<el-select style="width: 100%;" v-else v-model="scope.row.numValue">
<el-option :value="i.availableValue" :label="i.availableValue" v-for="(i,key) in scope.row.availableValueList" :key="key"></el-option>
</el-select>
</div>
</div>
</template>
</el-table-column>
</el-table>
</div>
<el-dialog title="属性项目" v-drag :visible.sync="attributeSaveDialog" append-to-body>
<transfer-table v-if="attributeSaveDialog"
v-model="dataList2"
:data-list="searchDataList"> </transfer-table>
<el-footer style="height:40px;margin-top: 20px;text-align:center">
<el-button type="primary" @click="attributeSaveDialog = false">关闭</el-button>
</el-footer>
</el-dialog>
</div>
</template>
<script>
import Chooselist from '@/views/modules/common/Chooselist_eam'
<script>
import {
deleteSrmMaterialFamilySupplier, deleteSrmMaterialFamilySupplierShareList,
saveSrmMaterialFamilySupplierShare,
searchMaterialFamilySupplierData,
searchSrmMaterialFamilySupplierShare
} from '../../../api/srm/srmSupplier'
refreshPropertiesModal,
updatePropertiesList,
getPropertiesListByPartAndCodeNo,
searchPropertiesItemList,
saveSubPropertiesValueForAlone,
deleteSubPropertiesValueForAlone
} from "@/api/part/partProperties.js";
import TransferTable from "@/views/modules/common/transferTable.vue";
export default {
components: {
Chooselist
name: "orderAttribute",
components: {TransferTable},
props:{
site:{
type:String,
},
data() {
return {
dataList: [],
searchData: {
site: '',
username: '',
periodMohu: '',
startDate: '',
supplierNo: '',
endDate: '',
materialFamilyNo: '',
materialFamilyDesc: '',
height:'300',
page: 1,
limit: 1000
partNo:{
type:String,
},
dataListLoading: false,
currentRow:'',
columnList: [
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '811001Table8Period',
tableId: "811001Table8",
tableName: "供应商份额",
columnProp: "period",
headerAlign: "center",
align: "left",
columnLabel: "Period",
columnWidth: '100',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
codeNo:{
type:String,
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '811001Table1PeriodStartDate',
tableId: "811001Table8",
tableName: "供应商份额",
columnProp: "periodStartDate",
headerAlign: "center",
align: "center",
columnLabel: "Period Start Date",
columnWidth: '100',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
functionType:{
type:String,
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '811001Table1PeriodEndDate',
tableId: "811001Table8",
tableName: "供应商份额",
columnProp: "periodEndDate",
headerAlign: "center",
align: "center",
columnLabel: "Period End Date",
columnWidth: '100',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
disabled:{
type:Boolean,
default:false,
}
},
data(){
return{
height:320,
loading:false,
attributeDialog:true,
copyAttributeList:[],
attributeSaveDialog:false,
productColumnList: [
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '811001Table1MaterialFamilyNo',
tableId: "811001Table8",
tableName: "供应商份额",
columnProp: "materialFamilyNo",
functionId: 100002001,
serialNumber: '100002001TablePropertiesItemNo',
tableId: "100002001Table",
tableName: "属性表",
columnProp: 'propertiesItemNo',
headerAlign: "center",
align: "left",
columnLabel: "Material Family No",
columnWidth: '100',
columnLabel: '属性编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
fixed: '',
},{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '811001Table1MaterialFamilyDesc',
tableId: "811001Table8",
tableName: "供应商份额",
columnProp: "materialFamilyDesc",
functionId: 100002001,
serialNumber: '100002001TableItemDesc',
tableId: "100002001Table",
tableName: "属性表",
columnProp: 'itemDesc',
headerAlign: "center",
align: "left",
columnLabel: "Material Family Desc",
columnWidth: '200',
columnLabel: '属性名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
fixed: '',
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '811001Table1EstimateShare',
tableId: "811001Table8",
tableName: "供应商份额",
columnProp: "estimateShare",
functionId: 100002001,
serialNumber: '100002001TableValueType',
tableId: "100002001Table",
tableName: "属性表",
columnProp: 'valueType',
headerAlign: "center",
align: "right",
columnLabel: "Estimate Share",
columnWidth: '80',
align: "center",
columnLabel: '值类型',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
fixed: '',
columnWidth:80,
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '811001Table1ActualShare',
tableId: "811001Table8",
tableName: "供应商份额",
columnProp: "actualShare",
functionId: 100002001,
serialNumber: '100002001TableMaxValue',
tableId: "100002001Table",
tableName: "属性表",
columnProp: 'textValue',
headerAlign: "center",
align: "right",
columnLabel: "Actual Share",
columnWidth: '80',
align: "left",
columnLabel: '属性值',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
fixed: '',
columnWidth:120,
},
],
modelList:[],
searchDataList:[],
dataList:[],
dataList2:[],
}
},
methods: {
// S
getBaseList (val, type) {
this.tagNo = val
this.tagNo1 = type
this.$nextTick(() => {
let strVal = ''
// if (val === 1013) {
// if(type==1) {
// strVal = this.dataForm.partType
// }
// }
this.$refs.baseList.init(val, strVal)
})
watch:{
partNo(newValue,oldValue){
if (newValue){
this.getProperties();
}
},
/* 列表方法的回调 */
getBaseData (val) {
// if (this.tagNo === 1013) {
// if(this.tagNo1==1) {
// this.dataForm.partType = val.Base_id
// this.dataForm.partTypeDesc = val.Base_desc
// }
// }
},
methods:{
//
init(inData) {
//
this.searchData = JSON.parse(JSON.stringify(inData));
//
this.searchTable();
this.getProperties();
},
searchTable(){
searchSrmMaterialFamilySupplierShare(this.searchData).then(({data}) => {
//
if (data && data.code == 0) {
this.dataList = data.rows
console.log(this.dataList)
refreshPropertiesModal(){
this.$confirm(`是否刷新至最新模板界面,已填数据会更新到新模板中,若旧属性在新模板中被删除,该条数据会消失。`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let params = {
site: this.searchData.site,
partNo: this.searchData.partNo,
codeNo: this.searchData.codeNo,
recordType: this.searchData.functionType,
}
refreshPropertiesModal(params).then(({data}) => {
if (data && data.code === 0) {
this.$message.success(data.msg);
this.getProperties();
this.attributeDialog = true;
} else {
this.dataList = [];
this.$message.warning(data.msg);
}
});
this.loading = false
}).catch((error) => {
this.$message.error(error)
this.loading = false
})
})
},
addModal(){
this.modelSearchData={
getProperties(){
let params = {
site: this.searchData.site,
materialFamilyNo:this.searchData.materialFamilyNo,
materialFamilyDesc:this.searchData.materialFamilyDesc,
period:'',
flag:0,
periodStartDate:'',
periodEndDate:'',
detailList:[],
partNo: this.searchData.partNo,
codeNo: this.searchData.codeNo,
recordType: this.searchData.functionType,
}
console.log("当前参数:",params)
getPropertiesListByPartAndCodeNo(params).then(({data})=>{
if (data && data.code === 0){
this.dataList = data.rows;
this.dataList2 = JSON.parse(JSON.stringify(data.rows));
for (let i = 0; i <this.dataList2.length ; i++) {
this.dataList2[i].itemNo= this.dataList2[i].propertiesItemNo
}
this.searchAttributeList({})
}else {
this.$message.warning(data.msg)
}
}).catch((error)=>{
this.$message.error(error)
})
},
clickSave(){
console.log("点击保存/编辑按钮,当前模式:", this.attributeDialog)
console.log("数据条数:", this.dataList.length)
console.log(0)
if(this.dataList.length===0) {
console.log("属性数据为空!")
return false
}
if(this.dataList.length===0){
return false
}
if (!this.attributeDialog){
this.updateTestPropertiesList();
}else {
//null
for (let i = 0; i < this.dataList.length; i++){
if (this.dataList[i].numValue == null){
this.dataList[i].numValue = undefined;
}
}
this.copyAttributeList = JSON.parse(JSON.stringify(this.dataList))
this.attributeDialog = false;
}
},
updateTestPropertiesList(){
this.loading = true
updatePropertiesList(this.copyAttributeList).then(({data})=>{
if (data && data.code === 0){
this.$message.success(data.msg);
this.getProperties();
this.attributeDialog = true;
}else {
this.$message.warning(data.msg);
}
this.loading = false
}).catch((error)=>{
this.$message.error(error)
this.loading = false
})
},
clickSaveBtn(){
if (!this.attributeDialog) {
this.$message.warning('请保存更改!')
return
}
this.searchMaterialFamilySupplier();
this.modelFlag=true;
//
this.searchAttributeList({})
this.attributeSaveDialog = true;
},
searchMaterialFamilySupplier(){
searchMaterialFamilySupplierData(this.modelSearchData).then(({data}) => {
//
if (data && data.code == 0) {
this.modelList = data.rows
saveTestPropertiesItem(params){
let i = 0;
let arr = params.searchTableList.map(item=>{
item.partNo = this.searchData.partNo;
item.site = this.searchData.site;
item.codeNo = this.searchData.codeNo;
item.recordType = this.searchData.functionType;
return item
})
for (let j = 0; j <arr.length ; j++) {
arr[j].propertiesItemNo= arr[j].itemNo
arr[j].itemNo=999
}
saveSubPropertiesValueForAlone(arr).then(({data})=>{
if (data && data.code === 0){
this.$message.success(data.msg);
this.getProperties(params)
}else {
this.modelList = [];
this.$message.warning(data.msg);
}
});
}).catch((error)=>{
this.$message.error(error)
})
},
removeTestPropertiesItem(params){
for (let i = 0; i <params.dataTableList.length ; i++) {
params.dataTableList[i].propertiesItemNo= params.dataTableList[i].itemNo
params.dataTableList[i].itemNo=999
}
deleteSubPropertiesValueForAlone(params.dataTableList).then(({data})=>{
if (data && data.code === 0){
this.$message.success(data.msg);
this.getProperties(params)
}else {
this.$message.warning(data.msg);
}
}).catch((error)=>{
this.$message.error(error)
})
},
searchAttributeList(data){
let params= JSON.parse(JSON.stringify(data))
params.site=this.$store.state.user.site;
params.list = this.dataList;
if (!this.attributeSaveDialog){
this.searchDataList = [];
}
</script>
let inData={
site: this.searchData.site,
partNo: this.searchData.partNo,
codeNo: this.searchData.codeNo,
functionType: this.searchData.functionType
}
searchPropertiesItemList(inData).then(({data}) => {
if (data && data.code === 0){
this.searchDataList = data.rows;
}else {
this.$message.warning(data.msg)
}
}).catch((error)=>{
this.$message.error(error)
})
<style scoped lang="scss">
},
.rq .auto /deep/ .el-form-item__content{
height: auto;
line-height: 1.5;
},
created() {
// this.getProperties();
},
}
/deep/ .el-table__fixed-right-patch {
display: none !important;
</script>
<style scoped>
.el-input-number /deep/ .el-input__inner {
text-align: right;
padding-right: 5px !important;
}
/deep/ .el-input .el-input--medium{
line-height: 20px;
}
/deep/ .el-input-number .el-input--medium{
line-height: 20px;
}
</style>

260
src/views/modules/srmPart/com_part_SpecParams_old.vue

@ -0,0 +1,260 @@
<template>
<div class="customer-css">
<el-form label-position="top" style="margin-top: 1px; margin-left: 0px;">
<el-form :inline="true" label-position="top" style="margin-top: 0px">
<el-form-item label="参数编码:">
<el-input v-model="searchData.propertiesItemNo" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item label="参数名称:">
<el-input v-model="searchData.subCodeDesc" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item label=" ">
<el-button type="primary" @click="searchTable()">Query</el-button>
<!-- <el-button type="primary" @click="addModal()">新增</el-button>-->
</el-form-item>
</el-form>
</el-form>
<el-table
:data="dataList"
:height=searchData.height
border
v-loading="dataListLoading"
style="width: 100%; ">
<el-table-column
v-for="(item,index) in columnList" :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>
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
</div>
</template>
<script>
import Chooselist from '@/views/modules/common/Chooselist_eam'
import {
deleteSrmMaterialFamilySupplier, deleteSrmMaterialFamilySupplierShareList,
saveSrmMaterialFamilySupplierShare,
searchMaterialFamilySupplierData,
searchSrmMaterialFamilySupplierShare
} from '../../../api/srm/srmSupplier'
import {
searchPropertiesItemList
} from "@/api/part/partProperties.js"
export default {
components: {
Chooselist
},
data() {
return {
dataList: [],
searchData: {
site: '',
username: '',
subCodeSeqNo: '',
subCodeDesc: '',
propertiesItemNo: '',
recordType:'',
itemNo:'',
textValue:'',
numValue:'',
valueTypeDb:'',
height:'300',
page: 1,
limit: 1000
},
dataListLoading: false,
currentRow:'',
columnList: [
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '811001Table8Period',
tableId: "811001Table8",
tableName: "规格参数",
columnProp: "subCodeSeqNo",
headerAlign: "center",
align: "left",
columnLabel: "序号",
columnWidth: '100',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '811001Table1MaterialFamilyNo',
tableId: "811001Table8",
tableName: "规格参数",
columnProp: "propertiesItemNo",
headerAlign: "center",
align: "left",
columnLabel: "参数编码",
columnWidth: '100',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '811001Table1MaterialFamilyDesc',
tableId: "811001Table8",
tableName: "规格参数",
columnProp: "subCodeDesc",
headerAlign: "center",
align: "left",
columnLabel: "参数名称",
columnWidth: '200',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '811001Table1EstimateShare',
tableId: "811001Table8",
tableName: "规格参数",
columnProp: "textValue",
headerAlign: "center",
align: "right",
columnLabel: "参数值",
columnWidth: '80',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '811001Table1ActualShare',
tableId: "811001Table8",
tableName: "规格参数",
columnProp: "unit",
headerAlign: "center",
align: "right",
columnLabel: "单位",
columnWidth: '80',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
},
],
modelList:[],
}
},
methods: {
// S
getBaseList (val, type) {
this.tagNo = val
this.tagNo1 = type
this.$nextTick(() => {
let strVal = ''
// if (val === 1013) {
// if(type==1) {
// strVal = this.dataForm.partType
// }
// }
this.$refs.baseList.init(val, strVal)
})
},
/* 列表方法的回调 */
getBaseData (val) {
// if (this.tagNo === 1013) {
// if(this.tagNo1==1) {
// this.dataForm.partType = val.Base_id
// this.dataForm.partTypeDesc = val.Base_desc
// }
// }
},
//
init(inData) {
//
this.searchData = JSON.parse(JSON.stringify(inData));
//
this.searchTable();
},
searchTable(){
searchPropertiesItemList(this.searchData).then(({data}) => {
//
if (data && data.code == 0) {
this.dataList = data.rows
console.log(this.dataList)
} else {
this.dataList = [];
}
});
},
addModal(){
this.modelSearchData={
site:this.searchData.site,
materialFamilyNo:this.searchData.materialFamilyNo,
materialFamilyDesc:this.searchData.materialFamilyDesc,
period:'',
flag:0,
periodStartDate:'',
periodEndDate:'',
detailList:[],
}
this.searchMaterialFamilySupplier();
this.modelFlag=true;
},
searchMaterialFamilySupplier(){
searchMaterialFamilySupplierData(this.modelSearchData).then(({data}) => {
//
if (data && data.code == 0) {
this.modelList = data.rows
} else {
this.modelList = [];
}
});
},
},
}
</script>
<style scoped lang="scss">
.rq .auto /deep/ .el-form-item__content{
height: auto;
line-height: 1.5;
}
/deep/ .el-table__fixed-right-patch {
display: none !important;
}
</style>

404
src/views/modules/srmPart/com_part_Suppliers.vue

@ -1,34 +1,16 @@
<template>
<div class="customer-css">
<el-form label-position="top" style="margin-top: 1px; margin-left: 0px;">
<el-form :inline="true" label-position="top" style="margin-top: 0px">
<el-form-item label="Period:">
<el-input v-model="searchData.periodMohu" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item label="Period Date:">
<el-date-picker
style="width: 120px"
v-model="searchData.startDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="Start">
</el-date-picker>
</el-form-item>
<el-form-item label="to:">
<el-date-picker
style="width: 120px"
v-model="searchData.endDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="End">
</el-date-picker>
<el-form :inline="true" label-position="top" :model="searchData">
<el-form-item label="供应商编码">
<el-input v-model="searchData.addressType" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item label=" ">
<el-button type="primary" @click="searchTable()">Query</el-button>
<!-- <el-button type="primary" @click="addModal()">新增</el-button>-->
<el-button type="primary" @click="searchTable()">查询</el-button>
<el-button type="primary" @click="addModal()">新增</el-button>
</el-form-item>
</el-form>
</el-form>
<el-table
:data="dataList"
:height=searchData.height
@ -51,21 +33,90 @@
style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
<el-table-column
header-align="center"
align="center"
width="180"
fixed="right"
label="Actions">
<template slot-scope="scope">
<a type="text" size="small" v-if="scope.row.needRenew=='Y'" @click="renewModew(scope.row)">Renew |</a>
<a type="text" size="small" @click="editModel(scope.row)">Edit |</a>
<a type="text" size="small" @click="deleteData(scope.row)"> Delete</a>
</template>
</el-table-column>
</el-table>
<el-dialog title="part Suppliers" :close-on-click-modal="false" v-drag :visible.sync="contractModelFlag" width="600px">
<div class="dialog-content">
<el-form label-position="top" style="margin-top: -5px;">
<el-row :gutter="20">
<el-col :span="6">
<el-form-item :label="'供应商编码'" >
<el-input v-model="partSuppliersData.supplierCode" ></el-input>
</el-form-item>
</el-col>
<!-- <el-col :span="6">
<el-form-item :label="'供应商名称'" >
<el-input v-model="partSuppliersData.supplierName" disabled ></el-input>
</el-form-item>
</el-col> -->
<el-col :span="6">
<el-form-item :label="'含税价格'" >
<el-input v-model="partSuppliersData.priceWithTax" type="number" ></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="是否为主供应商">
<el-select v-model="partSuppliersData.isMainSupplier" placeholder="请选择" >
<el-option label="是" value="N"></el-option>
<el-option label="否" value="Y"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="'交期'" >
<el-input v-model="partSuppliersData.deliveryTime" ></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="'二级供应商编码'" >
<el-input v-model="partSuppliersData.secondarySupplierCode" ></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item :label="'二级供应商名称'" >
<el-input v-model="partSuppliersData.secondarySupplierName" ></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item :label="'备注'">
<el-input type="textarea" :rows="3" v-model="partSuppliersData.remark" style=""></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<div slot="footer" class="dialog-footer" style="margin-top: 50px">
<el-button type="primary" @click="submitData()">保存</el-button>
<el-button @click="contractModelFlag = false">取消</el-button>
</div>
</el-dialog>
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
</div>
</template>
<script>
import Chooselist from '@/views/modules/common/Chooselist_eam'
import {
deleteSrmMaterialFamilySupplier, deleteSrmMaterialFamilySupplierShareList,
saveSrmMaterialFamilySupplierShare,
searchMaterialFamilySupplierData,
searchSrmMaterialFamilySupplierShare
} from '../../../api/srm/srmSupplier'
createPartSupplierRelation,
searchPartSupplierRelationList,
deletePartSupplierRelation
} from '../../../api/part/partSupplierRelation'
export default {
components: {
@ -76,148 +127,184 @@ export default {
dataList: [],
searchData: {
site: '',
username: '',
periodMohu: '',
startDate: '',
supplierNo: '',
endDate: '',
materialFamilyNo: '',
materialFamilyDesc: '',
username: this.$store.state.user.name,
supplierCode:'',
height:'300',
page: 1,
limit: 1000
},
partSuppliersData:{
id:'',
site:"",
supplierCode:'',
supplierName:'',
priceWithTax:'',
deliveryTime:'',
secondarySupplierCode:'',
secondarySupplierName:'',
remark:'',
createdBy:'',
isMainSupplier:'N',
},
contractModelFlag:false,
visible:false,
dataListLoading: false,
currentRow:'',
columnList: [
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '811001Table8Period',
tableId: "811001Table8",
tableName: "供应商份额",
columnProp: "period",
headerAlign: "center",
align: "left",
columnLabel: "Period",
columnWidth: '100',
functionId: 811001,
serialNumber: '811001Table5SupplierCode',
tableId: '811001Table5',
tableName: '供应商合同',
columnProp: 'supplierCode',
headerAlign: 'center',
align: 'left',
columnLabel: '供应商编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '811001Table1PeriodStartDate',
tableId: "811001Table8",
tableName: "供应商份额",
columnProp: "periodStartDate",
headerAlign: "center",
align: "center",
columnLabel: "Period Start Date",
columnWidth: '100',
functionId: 811001,
serialNumber: '811001Table5SupplierName',
tableId: '811001Table5',
tableName: '供应商合同',
columnProp: 'supplierName',
headerAlign: 'center',
align: 'left',
columnLabel: '供应商名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '811001Table1PeriodEndDate',
tableId: "811001Table8",
tableName: "供应商份额",
columnProp: "periodEndDate",
headerAlign: "center",
align: "center",
columnLabel: "Period End Date",
columnWidth: '100',
functionId: 811001,
serialNumber: '811001Table5IsMainSupplier',
tableId: '811001Table5',
tableName: '供应商合同',
columnProp: 'isMainSupplier',
headerAlign: 'center',
align: 'center',
columnLabel: '是否为主供应商',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '811001Table1MaterialFamilyNo',
tableId: "811001Table8",
tableName: "供应商份额",
columnProp: "materialFamilyNo",
headerAlign: "center",
align: "left",
columnLabel: "Material Family No",
columnWidth: '100',
functionId: 811001,
serialNumber: '811001Table5PriceWithTax',
tableId: '811001Table5',
tableName: '供应商合同',
columnProp: 'priceWithTax',
headerAlign: 'center',
align: 'right',
columnLabel: '含税价格',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '811001Table1MaterialFamilyDesc',
tableId: "811001Table8",
tableName: "供应商份额",
columnProp: "materialFamilyDesc",
headerAlign: "center",
align: "left",
columnLabel: "Material Family Desc",
columnWidth: '200',
functionId: 811001,
serialNumber: '811001Table5DeliveryTime',
tableId: '811001Table5',
tableName: '供应商合同',
columnProp: 'deliveryTime',
headerAlign: 'center',
align: 'center',
columnLabel: '交期',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '811001Table1EstimateShare',
tableId: "811001Table8",
tableName: "供应商份额",
columnProp: "estimateShare",
headerAlign: "center",
align: "right",
columnLabel: "Estimate Share",
columnWidth: '80',
functionId: 811001,
serialNumber: '811001Table5SecondarySupplierCode',
tableId: '811001Table5',
tableName: '供应商合同',
columnProp: 'secondarySupplierCode',
headerAlign: 'center',
align: 'left',
columnLabel: '二级供应商编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
fixed: '',
columnWidth: 150
},
{
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '811001Table1ActualShare',
tableId: "811001Table8",
tableName: "供应商份额",
columnProp: "actualShare",
headerAlign: "center",
align: "right",
columnLabel: "Actual Share",
columnWidth: '80',
functionId: 811001,
serialNumber: '811001Table5SecondarySupplierName',
tableId: '811001Table5',
tableName: '供应商合同',
columnProp: 'secondarySupplierName',
headerAlign: 'center',
align: 'left',
columnLabel: '二级供应商名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: false
fixed: '',
columnWidth: 150
},
{
userId: this.$store.state.user.name,
functionId: 811001,
serialNumber: '811001Table5Remark',
tableId: '811001Table5',
tableName: '供应商合同',
columnProp: 'remark',
headerAlign: 'center',
align: 'left',
columnLabel: '备注',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 200
},
],
modelList:[],
tagNo:'',
tagNo1:'',
fileList: [],
fileList2:[],
ossVisible:false,
ossForm:{
remark:'',
},
uploadLoading:false,
}
},
methods: {
@ -253,7 +340,7 @@ export default {
},
searchTable(){
searchSrmMaterialFamilySupplierShare(this.searchData).then(({data}) => {
searchPartSupplierRelationList(this.searchData).then(({data}) => {
//
if (data && data.code == 0) {
this.dataList = data.rows
@ -264,29 +351,66 @@ export default {
});
},
addModal(){
this.modelSearchData={
site:this.searchData.site,
materialFamilyNo:this.searchData.materialFamilyNo,
materialFamilyDesc:this.searchData.materialFamilyDesc,
period:'',
flag:0,
periodStartDate:'',
periodEndDate:'',
detailList:[],
this.partSuppliersData={
site:this.$store.state.user.site,
partNo:this.searchData.partNo,
supplierCode:'',
supplierName:'',
priceWithTax:'',
deliveryTime:'',
secondarySupplierCode:'',
secondarySupplierName:'',
remark:'',
isMainSupplier:'',
createBy:this.$store.state.user.name,
}
this.searchMaterialFamilySupplier();
this.modelFlag=true;
this.contractModelFlag=true;
},
searchMaterialFamilySupplier(){
searchMaterialFamilySupplierData(this.modelSearchData).then(({data}) => {
//
if (data && data.code == 0) {
this.modelList = data.rows
submitData(){
if(this.partSuppliersData.supplierCode==''||this.partSuppliersData.supplierCode==null){
this.$message.warning('未输入supplierCode!')
return false
}
createPartSupplierRelation( this.partSuppliersData).then(({data})=>{
if (data && data.code === 0){
this.$message.success(data.msg);
this.searchTable();
this.contractModelFlag=false
}else {
this.modelList = [];
this.$message.warning(data.msg);
}
});
}).catch((error)=>{
this.$message.error(error);
})
},
editModel(row){
this.partSuppliersData=JSON.parse(JSON.stringify(row));
this.contractModelFlag=true;
},
deleteData(row){
this.$confirm(`Confirm deletion?`, 'Prompt', {
confirmButtonText: 'Confirm',
cancelButtonText: 'Cancel',
type: 'warning'
}).then(()=>{
deletePartSupplierRelation(row.id).then(({data})=>{
if (data.code===0){
this.searchTable()
this.$message.success("删除成功")
}
}).catch()
})
}
},
}
</script>
@ -297,8 +421,26 @@ export default {
height: auto;
line-height: 1.5;
}
/deep/ .el-table__fixed-right-patch {
display: none !important;
.dialog-content {
width: 100%;
}
/* 对话框底部按钮居中 */
.dialog-footer-center {
text-align: center;
padding: 15px 0 5px 0;
border-top: 1px solid #E4E7ED;
margin-top: 15px;
}
.dialog-footer-center .el-button {
margin: 0 10px;
min-width: 90px;
height: 36px;
padding: 0 20px;
font-size: 14px;
}
</style>

20
src/views/modules/srmPart/partInfoList.vue

@ -198,7 +198,7 @@ import {
createPart,
updatePart,
deletePart
} from '@/api/srm/srmPart.js'
} from '@/api/part/partInfo.js'
import excel from '@/utils/excel-util.js'
import Chooselist from '@/views/modules/common/Chooselist_eam'
import basicInfo from './com_part_BasicInfo'
@ -487,7 +487,15 @@ export default {
],
partDesc: [
{ required: true, message: ' ', trigger: 'blur' }
],
npc: [
{ required: true, message: ' ', trigger: 'blur' }
],
partSpec: [
{ required: true, message: ' ', trigger: 'blur' }
]
}
}
},
@ -538,7 +546,7 @@ export default {
strVal = this.currentpart.codeNo
}
this.$refs.baseList.init(val, strVal)
this.$refs.baseList.init(val, strVal?strVal:'')
})
},
@ -548,11 +556,11 @@ export default {
this.searchData.partNo = val.part_no
}
if (this.tagNo === 526) {
this.currentpart.category = val.category_name
this.currentpart.category = val.family_id
}
if (this.tagNo === 525) {
this.currentpart.unit = val.unit_code
this.currentpart.unit = val.UMID
}
if (this.tagNo === 522) {
this.currentpart.buyerName = val.buyer_name
@ -562,7 +570,7 @@ export default {
}
if (this.tagNo === 527) {
this.currentpart.codeNo = val.template_code
this.currentpart.codeNo = val.code_no
}
},
@ -660,6 +668,8 @@ export default {
let inData = {
site: this.currentRow.site,
partNo: this.currentRow.partNo,
codeNo: this.currentRow.codeNo,
functionType:"P",
height: Number(this.height) - 20
}
this.$refs.specParams.init(inData)

Loading…
Cancel
Save