Browse Source

2024-03-28 测试修改

master
zelian_wu 2 years ago
parent
commit
0226ccc760
  1. 5
      src/api/test/testProperties.js
  2. 2
      src/views/modules/base/propertiesItem/propertiesItem.vue
  3. 71
      src/views/modules/base/propertiesItem/propertiesModel.vue
  4. 16
      src/views/modules/quotation/sellForQuotation/quotationDetail/billOfMateriel.vue
  5. 39
      src/views/modules/quotation/sellForQuotation/quotationDetail/costPrice.vue
  6. 216
      src/views/modules/quotation/sellForQuotation/quotationDetail/quoteRouting.vue
  7. 9
      src/views/modules/quotation/sellForQuotation/quoteDetail.vue
  8. 39
      src/views/modules/test/requestForTest.vue
  9. 321
      src/views/modules/test/testAttribute/testProperties.vue

5
src/api/test/testProperties.js

@ -0,0 +1,5 @@
import {createAPI} from "../../utils/httpRequest";
export const getTestPropertiesList = (data)=>createAPI(`/test/properties/list`,'post',data)
export const updateTestPropertiesList = (data)=>createAPI(`/test/properties/update`,'post',data)
export const searchTestPropertiesList = (data)=>createAPI(`/test/properties/search`,'post',data)

2
src/views/modules/base/propertiesItem/propertiesItem.vue

@ -15,6 +15,7 @@
<el-option label="MP" value="MP"></el-option>
<el-option label="BM" value="BM"></el-option>
<el-option label="ECN" value="ECN"></el-option>
<el-option label="TEST" value="TEST"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="' '">
@ -118,6 +119,7 @@
<el-option label="MP" value="MP"></el-option>
<el-option label="BM" value="BM"></el-option>
<el-option label="ECN" value="ECN"></el-option>
<el-option label="TEST" value="TEST"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="'是否值可选'" prop="valueChooseFlag" :rules="rules.valueChooseFlagType">

71
src/views/modules/base/propertiesItem/propertiesModel.vue

@ -15,14 +15,16 @@
<el-option label="MP" value="MP"></el-option>
<el-option label="BM" value="BM"></el-option>
<el-option label="ECN" value="ECN"></el-option>
<el-option label="TEST" value="TEST"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="'在用'">
<el-select filterable v-model="searchData.active" style="width: 130px">
<el-option label="全部" value=""></el-option>
<el-option label="是" value="Y"></el-option>
<el-option label="否" value="N"></el-option>
</el-select>
<el-form-item :label="'状态'">
<!-- <el-select filterable v-model="searchData.active" style="width: 130px">-->
<!-- <el-option label="全部" value=""></el-option>-->
<!-- <el-option label="是" value="Y"></el-option>-->
<!-- <el-option label="否" value="N"></el-option>-->
<!-- </el-select>-->
<dict-data-select v-model="searchData.active" clearable dict-type="sys_status" :use-default-value="false"></dict-data-select>
</el-form-item>
<el-form-item :label="' '">
<el-button @click="getDataList()">查询</el-button>
@ -65,7 +67,7 @@
<!-- prop="active"-->
<!-- header-align="center"-->
<!-- align="center"-->
<!-- label="在用">-->
<!-- label="状态">-->
<!-- <template slot-scope="scope">-->
<!-- <div v-if="scope.row.active === 'Y'">-->
<!-- -->
@ -85,9 +87,12 @@
: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 slot-scope="{row,$index}">
<div v-if="item.columnProp !== 'active'">
<span v-if="!item.columnHidden">{{row[item.columnProp]}}</span>
<span v-if="item.columnImage"><img :src="row[item.columnProp]" style="width: 100px; height: 80px"/></span>
</div>
<span v-else :style="{color:row.active === 'Y'?'#67C23A':'red'}">{{row.active === 'Y'?'启用':'停用'}}</span>
</template>
</el-table-column>
<el-table-column
@ -96,10 +101,12 @@
align="center"
width="160"
label="操作">
<template slot-scope="scope">
<a type="text" size="small" @click="updateModal(scope.row)">修改</a>
<a type="text" size="small" @click="detailModal(scope.row)">属性项目</a>
<a type="text" size="small" @click="deletePropertiesModel(scope.row)">删除</a>
<template slot-scope="{row,$index}">
<el-link style="cursor:pointer;" type="primary" v-if="row.isSystem !== 'Y'" @click="updateModal(row)">修改</el-link>
<span style="cursor:no-drop;color: #aaa" v-else>修改</span>
<el-link style="cursor:pointer;" type="primary" size="small" @click="detailModal(row)">属性项目</el-link>
<el-link style="cursor:pointer;" type="primary" v-if="row.isSystem !== 'Y'" @click="deletePropertiesModel(row)">删除</el-link>
<span style="cursor:no-drop;color: #aaa" v-else>删除</span>
</template>
</el-table-column>
</el-table>
@ -112,30 +119,26 @@
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<el-dialog title="属性模板" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="300px">
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
<el-form-item label="属性模板编码:" prop="codeNo" :rules="rules.codeNoType">
<el-input v-model="modalData.codeNo" :disabled="modalDisableFlag" style="width: 120px"></el-input>
<el-dialog title="属性模板" :close-on-click-modal="false" @close="()=>{this.$refs.modeForm.resetFields()}" v-drag :visible.sync="modalFlag" width="30vw">
<el-form ref="modeForm" label-position="top" :model="modalData" :rules="rules">
<el-form-item label="属性模板编码:" prop="codeNo">
<el-input v-model="modalData.codeNo" :disabled="modalDisableFlag"></el-input>
</el-form-item>
<el-form-item label="属性模板名称:" prop="codeDesc" :rules="rules.codeDescType">
<el-input v-model="modalData.codeDesc" style="width: 120px"></el-input>
<el-form-item label="属性模板名称:" prop="codeDesc">
<el-input v-model="modalData.codeDesc"></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
<el-form-item :label="'属性模板类型'" >
<el-select filterable v-model="modalData.functionType" :disabled="modalDisableFlag" style="width: 120px">
<el-select filterable v-model="modalData.functionType" :disabled="modalDisableFlag">
<el-option label="A" value="A"></el-option>
<el-option label="IP" value="IP"></el-option>
<el-option label="MP" value="MP"></el-option>
<el-option label="BM" value="BM"></el-option>
<el-option label="ECN" value="ECN"></el-option>
<el-option label="TEST" value="TEST"></el-option>
</el-select>
</el-form-item>
<el-form-item label="是否在用:" prop="active" :rules="rules.activeType">
<el-select filterable v-model="modalData.active" style="width: 120px">
<el-option label="是" value="Y"></el-option>
<el-option label="否" value="N"></el-option>
</el-select>
<el-form-item label="状态:" prop="active">
<dict-data-select v-model="modalData.active" style="width: 140px" clearable dict-type="sys_status" :use-default-value="false"></dict-data-select>
</el-form-item>
</el-form>
<el-footer style="height:40px;margin-top: 10px;text-align:center">
@ -373,8 +376,10 @@
} from "@/api/base/properties.js"
import Chooselist from '@/views/modules/common/Chooselist'
import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
import DictDataSelect from "../../sys/dict-data-select.vue";
export default {
components: {
DictDataSelect,
Chooselist
},
watch: {
@ -514,7 +519,7 @@
columnProp: 'active',
headerAlign: "center",
align: "center",
columnLabel: '在用',
columnLabel: '状态',
columnHidden: false,
columnImage: false,
columnSortable: false,
@ -747,21 +752,21 @@
itemSelections1: [],
itemSelections2: [],
rules:{
codeNoType:[
codeNo:[
{
required: true,
message: ' ',
trigger: 'change'
}
],
codeDescType:[
codeDesc:[
{
required: true,
message: ' ',
trigger: 'change'
}
],
activeType:[
active:[
{
required: true,
message: ' ',
@ -926,7 +931,7 @@
return false
}
if (this.modalData.active == '' || this.modalData.active == null) {
this.$alert('选择是否在用!', '错误', {
this.$alert('选择状态!', '错误', {
confirmButtonText: '确定'
})
return false

16
src/views/modules/quotation/sellForQuotation/quotationDetail/billOfMateriel.vue

@ -275,11 +275,11 @@ export default {
this.$message.warning(data.msg)
}
this.treeLoading = false;
this.$emit("update:loadingStatus",this.treeLoading)
// this.$emit("update:loadingStatus",this.treeLoading)
}).catch((error)=>{
this.$message.error(error)
this.treeLoading = false;
this.$emit("update:loadingStatus",this.treeLoading)
// this.$emit("update:loadingStatus",this.treeLoading)
})
},
changeSelect(val){
@ -351,10 +351,10 @@ export default {
this.$message.warning(data.msg)
}
this.dataListLoading = false;
this.$emit("update:loadingStatus",this.dataListLoading)
// this.$emit("update:loadingStatus",this.dataListLoading)
}).catch((error)=>{
this.dataListLoading = false;
this.$emit("update:loadingStatus",this.dataListLoading)
// this.$emit("update:loadingStatus",this.dataListLoading)
this.$message.error(error)
})
}else {
@ -367,11 +367,11 @@ export default {
this.$message.warning(data.msg)
}
this.dataListLoading = false;
this.$emit("update:loadingStatus",this.dataListLoading)
// this.$emit("update:loadingStatus",this.dataListLoading)
}).catch((error)=>{
this.$message.error(error)
this.dataListLoading = false;
this.$emit("update:loadingStatus",this.dataListLoading)
// this.$emit("update:loadingStatus",this.dataListLoading)
})
}
},
@ -390,10 +390,10 @@ export default {
//
let num = new Decimal(this.detail.quotationDetailQuantity)
let needNum = componentScrap.div(num).add(qtyPerAssembly.mul(new Decimal(100).sub(shrinkageFactor)).div(new Decimal(100)))
bomDetail.quoteUnitCost = new Decimal(needNum.mul(unitCost).toFixed(16,Decimal.ROUND_HALF_UP)).toSignificantDigits().toNumber()
bomDetail.quoteUnitCost = new Decimal(needNum.mul(unitCost).toFixed(6,Decimal.ROUND_HALF_UP)).toSignificantDigits().toNumber()
}
this.$emit("update:totalCost",this.getQuoteBomCost())
this.$emit("update:loadingStatus",false)
// this.$emit("update:loadingStatus",false)
},
getQuoteBomCost(){
// this.searchQuoteBomList();

39
src/views/modules/quotation/sellForQuotation/quotationDetail/costPrice.vue

@ -32,14 +32,21 @@ export default {
type:Number,
default:0,
},
machineCost:{
type:Number,
default:0,
},
laborCost:{
type:Number,
default:0,
},
manufacturingCost:{
type:Number,
default:0,
}
},
data() {
return {
machineCost:0,
fabricateCost:0,
labourCost:0,
packCost:0,
shippingCost:0,
rules: {
detailProfitRate: [{required: true, pattern:/^[1-9]\d{0,14}(\.\d{1,16})?$|^0(\.\d{1,16})?$/, message: ' ', trigger: ['change','blur']}],
adjustPartCost: [{required: true, pattern:/^[1-9]\d{0,14}(\.\d{1,16})?$|^0(\.\d{1,16})?$/, message: ' ', trigger: ['change','blur']}],
@ -113,23 +120,27 @@ export default {
this.copyDetail.computePartCost = new Decimal(this.bomCost).mul(new Decimal(this.detail.quotationDetailQuantity))
this.copyDetail.adjustPartCost = new Decimal(this.bomCost).mul(new Decimal(this.detail.quotationDetailQuantity))
//
this.copyDetail.computeMachineCost = this.machineCost
this.copyDetail.adjustMachineCost = this.machineCost
this.copyDetail.computeMachineCost = new Decimal(this.machineCost).mul(new Decimal(this.detail.quotationDetailQuantity))
this.copyDetail.adjustMachineCost = new Decimal(this.machineCost).mul(new Decimal(this.detail.quotationDetailQuantity))
//
this.copyDetail.computedFabricateCost = this.fabricateCost
this.copyDetail.adjustFabricateCost = this.fabricateCost
this.copyDetail.computedFabricateCost = new Decimal(this.manufacturingCost).mul(new Decimal(this.detail.quotationDetailQuantity))
this.copyDetail.adjustFabricateCost = new Decimal(this.manufacturingCost).mul(new Decimal(this.detail.quotationDetailQuantity))
//
this.copyDetail.computeLabourCost = this.labourCost
this.copyDetail.adjustLabourCost = this.labourCost
this.copyDetail.computeLabourCost = new Decimal(this.laborCost).mul(new Decimal(this.detail.quotationDetailQuantity))
this.copyDetail.adjustLabourCost = new Decimal(this.laborCost).mul(new Decimal(this.detail.quotationDetailQuantity))
//
this.copyDetail.computeToolCost = new Decimal(this.toolCost).mul(new Decimal(this.detail.quotationDetailQuantity))
this.copyDetail.adjustToolCost = new Decimal(this.toolCost).mul(new Decimal(this.detail.quotationDetailQuantity))
//
this.copyDetail.detailOtherCost = new Decimal(this.shippingCost).add(new Decimal(this.packCost)).mul(new Decimal(this.detail.quotationDetailQuantity)).toSignificantDigits().toNumber()
this.copyDetail.detailOtherCost = new Decimal(new Decimal(new Decimal(this.shippingCost).add(new Decimal(this.packCost)).mul(new Decimal(this.detail.quotationDetailQuantity))).toFixed(6,Decimal.ROUND_HALF_UP)).toSignificantDigits().toNumber()
//
this.copyDetail.detailManageCost = 0;
if (!this.copyDetail.detailManageCost){
this.copyDetail.detailManageCost = 0;
}
//
this.copyDetail.detailProfitRate = 0;
if (!this.copyDetail.detailProfitRate){
this.copyDetail.detailProfitRate = 0;
}
this.computeAllCost();
},
computeAllCost(){

216
src/views/modules/quotation/sellForQuotation/quotationDetail/quoteRouting.vue

@ -30,6 +30,18 @@ export default {
type:Boolean,
default:false,
},
machineCost:{
type:Number,
default:0,
},
laborCost:{
type:Number,
default:0,
},
manufacturingCost:{
type:Number,
default:0,
}
},
computed:{
RoutingAllSearchFlag:{
@ -210,6 +222,23 @@ export default {
status: true,
fixed: '',
columnWidth: 200,
},{
userId: this.$store.state.user.name,
functionId: 102003,
serialNumber: '102003Table5WorkCenterCost',
tableId: "102003Table5",
tableName: "报价工艺信息",
columnProp: 'workCenterCost',
headerAlign: "center",
align: "left",
columnLabel: '加工中心成本',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80,
},{
userId: this.$store.state.user.name,
functionId: 102003,
@ -354,7 +383,7 @@ export default {
tableName: "报价工艺信息",
columnProp: 'laborClassNo',
headerAlign: "center",
align: "right",
align: "left",
columnLabel: '人员等级',
columnHidden: false,
columnImage: false,
@ -371,7 +400,7 @@ export default {
tableName: "报价工艺信息",
columnProp: 'setupLaborClassNo',
headerAlign: "center",
align: "right",
align: "left",
columnLabel: '调机人员等级',
columnHidden: false,
columnImage: false,
@ -380,6 +409,74 @@ export default {
status: true,
fixed: '',
columnWidth: 100,
},{
userId: this.$store.state.user.name,
functionId: 102003,
serialNumber: '102003Table5LaborClassCost',
tableId: "102003Table5",
tableName: "报价工艺信息",
columnProp: 'LaborClassCost',
headerAlign: "center",
align: "left",
columnLabel: '人员等级成本',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100,
},{
userId: this.$store.state.user.name,
functionId: 102003,
serialNumber: '102003Table5SetupLaborClassCost',
tableId: "102003Table5",
tableName: "报价工艺信息",
columnProp: 'setupLaborClassCost',
headerAlign: "center",
align: "left",
columnLabel: '调机人员等级成本',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100,
},{
userId: this.$store.state.user.name,
functionId: 102003,
serialNumber: '102003Table5MachineCost',
tableId: "102003Table5",
tableName: "报价工艺信息",
columnProp: 'machineCost',
headerAlign: "center",
align: "right",
columnLabel: '单位机器成本',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 140,
},{
userId: this.$store.state.user.name,
functionId: 102003,
serialNumber: '102003Table5LaborCosts',
tableId: "102003Table5",
tableName: "报价工艺信息",
columnProp: 'laborCosts',
headerAlign: "center",
align: "right",
columnLabel: '单位人工成本',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 140,
},{
userId: this.$store.state.user.name,
functionId: 102003,
@ -395,8 +492,8 @@ export default {
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100,
fixed: 'right',
columnWidth: 140,
},
],
versionData:{},
@ -435,44 +532,6 @@ export default {
this.$emit("update:loadingStatus",this.treeLoading)
})
},
changeSelect(){
if (this.selectRouting.length === 0){
this.updateQuoteRoutingList();
return
}
this.$confirm('此操作将更换工艺信息, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.updateQuoteRoutingList();
}).catch(() => {
this.selectRouting = JSON.parse(JSON.stringify(this.copyRouting))
this.$nextTick(()=>{
this.$refs.tree.setCurrentKey(`${this.selectRouting[0]}-${this.selectRouting[1]}-${this.selectRouting[2]}-${this.selectRouting[3]}-${this.selectRouting[4]}-${this.selectRouting[5]}`)
})
});
},
updateQuoteRoutingList(){
let params = {
site:this.$store.state.user.site,
testPartNo: this.detail.productNo,
version:this.selectRouting[0],
routingType:this.selectRouting[1],
alternativeNo:this.selectRouting[2],
quoteDetailId:this.detail.quotationDetailId
}
updateQuoteRoutingList(params).then(({data})=>{
if (data && data.code === 0){
this.$message.success(data.msg)
this.searchQuoteRoutingList();
}else {
this.$message.warning(data.msg)
}
}).catch((error)=>{
this.$message.error(error)
})
},
setSelectRouting(val){
if (val.length === 0){
this.getRoutingTreeStructure();
@ -514,6 +573,7 @@ export default {
if (data && data.code === 0){
this.routingDetailList = data.rows
this.computedQuoteRoutingCost();
this.computedTotalCost();
}else {
this.$message.warning(data.msg)
}
@ -525,14 +585,82 @@ export default {
})
}
},
computedTotalCost(){
let machineCost = 0;
let laborCost = 0;
for (let i = 0; i < this.routingDetailList.length; i++) {
let detail = this.routingDetailList[i];
machineCost += new Decimal(detail.machineCost).toNumber();
laborCost += new Decimal(detail.laborCosts).toNumber();
}
this.$emit("update:machineCost",machineCost)
this.$emit("update:laborCost",laborCost)
},
computedQuoteRoutingCost(){
for (let i = 0; i < this.routingDetailList.length; i++) {
this.setRunTimeDesc(i);
let detail = this.routingDetailList[i];
// detail.machineCost
this.routingDetailList[i].machineCost = new Decimal(new Decimal(this.getMachineCost(detail)).toFixed(6,Decimal.ROUND_HALF_UP)).toSignificantDigits().toNumber();
// detail.manufacturingCosts
// detail.laborCosts
detail.laborCosts = new Decimal(detail.laborClassCost)
this.routingDetailList[i].laborCosts = new Decimal(new Decimal(this.getLaborCost(detail)).toFixed(6,Decimal.ROUND_HALF_UP)).toSignificantDigits().toNumber();
// detail.laborCosts = new Decimal(detail.laborClassCost)
this.routingDetailList[i].quoteUnitCost = new Decimal(new Decimal(this.routingDetailList[i].machineCost).add(this.routingDetailList[i].laborCosts).toFixed(6,Decimal.ROUND_HALF_UP)).toSignificantDigits().toNumber()
}
},
getLaborCost(row){
let unitTime = 0;//
switch (row.runTimeDesc){
case "小时":
unitTime = row.laborRunFactor;
break
case "小时/单位":
unitTime = row.laborRunFactor;
break
case "单位/小时":
if (row.laborRunFactor !== 0){
unitTime = new Decimal(1).div(new Decimal(row.laborRunFactor)).toNumber();
}
break
default:{
unitTime = 0;
}
}
let laborNeedTime = new Decimal(unitTime).mul(new Decimal(row.efficiencyFactor).div(new Decimal(100))).toNumber();
return new Decimal(new Decimal(row.laborSetupTime)
.mul(new Decimal(row.setupLaborClassCost)
.mul(new Decimal(row.setupCrewSize).div(this.detail.quotationDetailQuantity))))
.add(new Decimal(laborNeedTime)
.mul(new Decimal(row.laborClassCost)
.mul(row.crewSize))).toNumber()
},
getManufacturingCosts(row){
let unitTime = 0;
},
getMachineCost(row){
// detail.machineCost machRunFactor
//
let unitTime = 0;
switch (row.runTimeDesc){
case "小时":
unitTime = row.machRunFactor;
break
case "小时/单位":
unitTime = row.machRunFactor;
break
case "单位/小时":
if (row.machRunFactor !== 0){
unitTime = new Decimal(1).div(new Decimal(row.machRunFactor)).toNumber();
}
break
default:{
unitTime = 0;
}
}
//
let workNeedTime = new Decimal(unitTime).mul(new Decimal(row.efficiencyFactor).div(new Decimal(100))).toNumber();
//
return new Decimal(row.workCenterCost).mul(new Decimal(row.machSetupTime)).add(new Decimal(row.workCenterCost).mul(workNeedTime)).toNumber();
},
setRunTimeDesc(i){
switch (this.routingDetailList[i].runTimeCode){

9
src/views/modules/quotation/sellForQuotation/quoteDetail.vue

@ -61,6 +61,9 @@ export default {
allSearchFlagRouting:false,
BOMCost:0,
ToolCost:0,
machineCost:0,
laborCost:0,
manufacturingCost:0,
packInfoCost:0,
shippingInfoCost:0,
loadingStatus:false,
@ -1090,7 +1093,7 @@ export default {
<bill-of-materiel ref="bom" :all-search-flag.sync="allSearchFlagBom" :total-cost.sync="BOMCost" :loading-status.sync="loadingStatus" :updateTree.sync="update" v-if="quotationDetailFlag" :height="fullscreen?655:415" :detail="quotationDetail"></bill-of-materiel>
</el-tab-pane>
<el-tab-pane name="routing" label="工艺">
<quote-routing ref="routing" :all-search-flag.sync="allSearchFlagRouting" v-if="quotationDetailFlag" :loading-status.sync="loadingStatus" :height="fullscreen?655:415" :detail="quotationDetail"></quote-routing>
<quote-routing ref="routing" :machine-cost.sync="machineCost" :labor-cost.sync="laborCost" :manufacturing-cost.sync="manufacturingCost" :all-search-flag.sync="allSearchFlagRouting" v-if="quotationDetailFlag" :loading-status.sync="loadingStatus" :height="fullscreen?655:415" :detail="quotationDetail"></quote-routing>
</el-tab-pane>
<el-tab-pane name="tool" label="工具">
<tool-quotation ref="tool" :total-cost.sync="ToolCost" v-if="quotationDetailFlag" :height="fullscreen?660:420" :detail="quotationDetail"></tool-quotation>
@ -1100,7 +1103,9 @@ export default {
</el-tab-pane>
<el-tab-pane name="cost" label="成本&价格">
<cost-price ref="cost" :tool-cost.sync="ToolCost"
:bom-cost.sync="BOMCost"
:bom-cost.sync="BOMCost" :machine-cost.sync="machineCost"
:manufacturing-cost.sync="manufacturingCost"
:labor-cost.sync="laborCost"
:pack-cost.sync="packInfoCost" :shipping-cost.sync="shippingInfoCost"
:loading-status.sync="loadingStatus"
v-if="quotationDetailFlag"

39
src/views/modules/test/requestForTest.vue

@ -259,7 +259,7 @@
</el-row>
</el-form>
<div class="rq">
<el-tabs v-model="activeTab">
<el-tabs v-model="activeTab" @tab-click="dialogTabClick">
<el-tab-pane label="物料信息" name="part">
<el-form label-position="top" :model="projectPartData">
<el-row :gutter="20">
@ -329,9 +329,12 @@
<el-tab-pane label="工艺路线" :disabled="!activeTabList.includes('process')" name="process">
<test-routing-table v-if="clickTestRow" ref="dialogSoRouting" v-model:data-list="testSoRoutingList" :test-no="modalData.testNo"></test-routing-table>
</el-tab-pane>
<el-tab-pane label="物料属性" :disabled="!activeTabList.includes('attribute')" name="attribute">
<el-tab-pane label="物料属性" :disabled="!activeTabList.includes('partAttribute')" name="partAttribute">
<test-attribute v-if="modalFlag" :attribute-list="attributeList" ref="dialogAttribute" :test-no="modalData.testNo"></test-attribute>
</el-tab-pane>
<el-tab-pane label="属性" :disabled="!activeTabList.includes('attribute')" name="attribute">
<test-properties v-if="modalFlag" v-model:data-list="testPropertiesList" ref="dialogTestAttribute" :test-no="modalData.testNo"></test-properties>
</el-tab-pane>
</el-tabs>
</div>
<el-footer style="height:30px;text-align:center;margin-top: 8px">
@ -614,6 +617,9 @@
<el-tab-pane label="物料属性" name="test_attribute" style="padding: 5px">
<test-attribute ref="tabAttribute" :attribute-list="attributeList" :test-no="testCurrentRow.testNo" :height="500"></test-attribute>
</el-tab-pane>
<el-tab-pane label="属性" name="attribute">
<test-properties ref="tabProperties" v-model:data-list="testPropertiesList" :test-no="testCurrentRow.testNo" :height="500"></test-properties>
</el-tab-pane>
<!-- 项目信息页签 -->
<el-tab-pane label="项目信息" name="project_information">
<el-form label-position="top" :model="projectInformationData" style="margin-left: 10px;margin-top: 5px;margin-right: 10px">
@ -994,9 +1000,12 @@
import {selectTestSoRoutingList} from "../../../api/test/testSoRouting";
import TestAttribute from "./testSoAttribute/testAttribute.vue";
import {partPropertiesList} from "../../../api/base/properties";
import TestProperties from "./testAttribute/testProperties.vue";
import {getTestPropertiesList} from "../../../api/test/testProperties";
export default {
name:"test",
components: {
TestProperties,
TestAttribute,
TestRoutingTable,
TestTable,
@ -1026,6 +1035,7 @@
attributeList:[],
testSoRoutingList:[],
testSoBomList:[],
testPropertiesList:[],
activeTab:'part',
activeTabList:['part'],
clickTestRow:false,
@ -2029,6 +2039,11 @@
//
this.refreshCurrentTabTable()
},
dialogTabClick(){
// if (this.activeTab === 'attribute') {
// this.getTestProperties();
// }
},
/**
* 当前值发生变化的时候修改
* @param row
@ -2193,7 +2208,7 @@
nextToDo: row.nextToDo,
updateBy: this.$store.state.user.name
}
this.activeTabList = ['part','product','process','attribute']
this.activeTabList = ['part','product','process','attribute','partAttribute']
this.$nextTick(()=>{
this.$refs.dialogSoBom.clearTable();
})
@ -2328,7 +2343,7 @@
testInformationSave(this.modalData).then(({data}) => {
if (data && data.code === 0) {
this.getDataList();
this.activeTabList = ['part','product','process','attribute']
this.activeTabList = ['part','product','process','attribute','partAttribute']
this.activeTab = 'product'
this.modalData.testNo = data.row
// this.modalFlag = false
@ -2410,6 +2425,7 @@
this.selectTestSoBom()
this.selectTestSoRoutingList()
this.getPartPropertiesList();
this.getTestProperties();
}
},
/**
@ -2949,6 +2965,21 @@
}
})
},
getTestProperties(){
let params = {
site:this.$store.state.user.site,
testNo: this.testCurrentRow.testNo
}
getTestPropertiesList(params).then(({data})=>{
if (data && data.code === 0){
this.testPropertiesList = data.rows;
}else {
this.$message.warning(data.msg)
}
}).catch((error)=>{
this.$message.error(error)
})
},
getPartPropertiesList(){
let params = {
site:this.$store.state.user.site,

321
src/views/modules/test/testAttribute/testProperties.vue

@ -0,0 +1,321 @@
<script>
import {searchItemAvailable, searchModalDetails} from "../../../../api/base/properties";
import {
getTestPropertiesList,
searchTestPropertiesList,
updateTestPropertiesList
} from "../../../../api/test/testProperties";
export default {
name: "testProperties",
props:{
dataList:{
type: Array,
default: ()=>[],
},
testNo:{
type:String,
},
testNumber:{
type:[String,Number],
},
columnList:{
type: Array,
default: ()=>[],
},
height:{
type:Number,
default:300
},
},
model:{
prop:"dataList",
event:"change"
},
data(){
return{
loading:false,
attributeDialog:false,
copyAttributeList:[],
productColumnList: [
{
userId: this.$store.state.user.name,
functionId: 100002001,
serialNumber: '100002001TableItemNo',
tableId: "100002001Table",
tableName: "属性表",
columnProp: 'itemNo',
headerAlign: "center",
align: "left",
columnLabel: '属性编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
},{
userId: this.$store.state.user.name,
functionId: 100002001,
serialNumber: '100002001TableItemDesc',
tableId: "100002001Table",
tableName: "属性表",
columnProp: 'itemDesc',
headerAlign: "center",
align: "left",
columnLabel: '属性名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
},
{
userId: this.$store.state.user.name,
functionId: 100002001,
serialNumber: '100002001TableValueType',
tableId: "100002001Table",
tableName: "属性表",
columnProp: 'valueType',
headerAlign: "center",
align: "center",
columnLabel: '值类型',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth:80,
},{
userId: this.$store.state.user.name,
functionId: 100002001,
serialNumber: '100002001TableMinValue',
tableId: "100002001Table",
tableName: "属性表",
columnProp: 'minValue',
headerAlign: "center",
align: "center",
columnLabel: '最小值',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth:80,
},{
userId: this.$store.state.user.name,
functionId: 100002001,
serialNumber: '100002001TableMaxValue',
tableId: "100002001Table",
tableName: "属性表",
columnProp: 'maxValue',
headerAlign: "center",
align: "center",
columnLabel: '最大值',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth:80,
},
{
userId: this.$store.state.user.name,
functionId: 100002001,
serialNumber: '100002001TableMaxValue',
tableId: "100002001Table",
tableName: "属性表",
columnProp: 'textValue',
headerAlign: "center",
align: "right",
columnLabel: '文本值',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth:120,
},
{
userId: this.$store.state.user.name,
functionId: 100002001,
serialNumber: '100002001TableMinValue',
tableId: "100002001Table",
tableName: "属性表",
columnProp: 'numValue',
headerAlign: "center",
align: "right",
columnLabel: '数字值',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth:120,
},
{
userId: this.$store.state.user.name,
functionId: 100002001,
serialNumber: '100002001TableDefaultValue',
tableId: "100002001Table",
tableName: "属性表",
columnProp: 'defaultValue',
headerAlign: "center",
align: "right",
columnLabel: '参照值',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
},
],
}
},
methods:{
openTestProperties(){
this.copyAttributeList = JSON.parse(JSON.stringify(this.dataList))
},
getTestProperties(){
let params = {
site:this.$store.state.user.site,
testNo: this.testNo
}
getTestPropertiesList(params).then(({data})=>{
if (data && data.code === 0){
this.$emit("change",data.rows)
}else {
this.$message.warning(data.msg)
}
}).catch((error)=>{
this.$message.error(error)
})
},
updateTestPropertiesList(){
updateTestPropertiesList(this.copyAttributeList).then(({data})=>{
if (data && data.code === 0){
this.$message.success(data.msg);
this.getTestProperties();
this.attributeDialog = false;
}else {
this.$message.warning(data.msg);
}
}).catch((error)=>{
this.$message.error(error)
})
},
searchTestPropertiesList(){
let params = {
site:this.$store.state.user.site,
testNo: this.testNo
}
this.loading = true
searchTestPropertiesList(params).then(({data})=>{
if (data && data.code === 0){
this.getTestProperties();
}else {
this.$message.warning(data.msg)
}
this.loading = false
}).catch((error)=>{
this.loading = false
this.$message.error(error)
})
}
},
}
</script>
<template>
<div>
<div style="margin-top: 5px">
<el-button type="primary" :loading="loading" @click="searchTestPropertiesList">刷新属性</el-button>
<el-button type="primary" @click="attributeDialog = true">编辑</el-button>
</div>
<el-table
:height="height"
:data="dataList"
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">
<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>
<el-dialog title="测试单属性" :visible.sync="attributeDialog" @open="openTestProperties" append-to-body v-drag>
<div class="rq ">
<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'">
<div v-if="item.columnProp !== 'textValue'">
<el-input-number v-model="scope.row.numValue" style="margin-top: -6px;padding: 0;width: 100%" v-if="scope.row.valueType === '数字'" :min="scope.row.minValue !== null?scope.row.minValue:Number.MIN_VALUE" :max="scope.row.maxValue !== null?scope.row.maxValue:Number.MAX_VALUE" :controls="false"></el-input-number>
<el-input v-model="scope.row.numValue" :disabled="scope.row.valueType !== '数字'" v-else></el-input>
</div>
<div>
<el-input v-model="scope.row.textValue" :disabled="scope.row.valueType === '数字'" v-if="item.columnProp !== 'numValue'"></el-input>
</div>
</div>
<div v-else>
<el-select style="width: 100%;" :disabled="scope.row.valueType !== '文本'" v-if="item.columnProp === 'textValue'" v-model="scope.row.textValue">
<el-option :value="i.availableValue" :label="i.availableValue" v-for="(i,key) in scope.row.list" :key="key"></el-option>
</el-select>
<el-select style="width: 100%;" :disabled="scope.row.valueType === '文本'" v-else v-model="scope.row.numValue">
<el-option :value="i.availableValue" :label="i.availableValue" v-for="(i,key) in scope.row.list" :key="key"></el-option>
</el-select>
</div>
</div>
</template>
</el-table-column>
</el-table>
</div>
<el-footer style="height:30px;text-align:center;margin-top: 8px">
<el-button type="primary" @click="updateTestPropertiesList">保存</el-button>
<el-button type="primary" @click="attributeDialog = false">关闭</el-button>
</el-footer>
</el-dialog>
</div>
</template>
<style scoped>
.el-input-number /deep/ .el-input__inner {
text-align: right;
padding-right: 5px !important;
}
</style>
Loading…
Cancel
Save