Browse Source

2023-12-08 plm报价

master
zelian_wu 2 years ago
parent
commit
ed11ce5e7b
  1. 2
      src/api/base/properties.js
  2. 36
      src/api/quotation/quotationHeader.js
  3. 13
      src/views/modules/quotation/sellForQuotation.vue
  4. 676
      src/views/modules/quotation/sellForQuotation/quotationDetail.vue
  5. 4
      src/views/modules/quotation/toBeQuoted.vue

2
src/api/base/properties.js

@ -1,6 +1,8 @@
import { createAPI } from "@/utils/httpRequest.js";
export const propertiesItemSearch = data => createAPI(`/properties/propertiesItemSearch`,'post',data)
export const propertiesItemList = data => createAPI(`/properties/propertiesItemList`,'get',data)
export const propertiesAvailableList = data => createAPI(`/properties/propertiesAvailableList`,'get',data)
export const propertiesItemSave = data => createAPI(`/properties/propertiesItemSave`,'post',data)
export const propertiesItemEdit = data => createAPI(`/properties/propertiesItemEdit`,'post',data)
export const propertiesItemDelete = data => createAPI(`/properties/propertiesItemDelete`,'post',data)

36
src/api/quotation/quotationHeader.js

@ -166,3 +166,39 @@ export const deleteQuotationPart = (data) => createAPI('/plm/quotationPart/delet
* @returns {*}
*/
export const batchDeleteQuotationPart = (data) => createAPI('/plm/quotationPart/batchDeleteQuotationPart','post',data);
/**
* 查询 成品属性
* @param data
* @returns {*}
*/
export const searchQuotationPropertiesItem = (data) => createAPI('/plm/quotationPropertiesItem/list','get',data);
/**
* 新增成品属性
* @param data
* @returns {*}
*/
export const saveQuotationPropertiesItem = (data) => createAPI('/plm/quotationPropertiesItem/save','post',data);
/**
* 删除成品属性
* @param data
* @returns {*}
*/
export const deleteQuotationPropertiesItem = (data) => createAPI('/plm/quotationPropertiesItem/delete','post',data);
/**
* 查询 可选值
* @param data
* @returns {*}
*/
export const searchQuotationPropertiesItemAvailable = (data) => createAPI('/plm/quotationPropertiesItemAvailable/list','get',data);
/**
* 保存可选值
* @param data
* @returns {*}
*/
export const saveQuotationPropertiesItemAvailable = (data) => createAPI('/plm/quotationPropertiesItemAvailable/save','post',data);
/**
* 删除可选值
* @param data
* @returns {*}
*/
export const deleteQuotationPropertiesItemAvailable = (data) => createAPI('/plm/quotationPropertiesItemAvailable/delete','post',data);

13
src/views/modules/quotation/sellForQuotation.vue

@ -65,7 +65,7 @@
<el-date-picker
:picker-options="{
disabledDate : time => {
return new Date(searchData.endDate).getTime() < time.getTime()
return searchData.endDate?new Date(searchData.endDate).getTime() < time.getTime():false
}
}"
value-format="yyyy-MM-dd"
@ -86,7 +86,7 @@
<el-date-picker
:picker-options="{
disabledDate : time => {
return time.getTime() < new Date(searchData.startDate).getTime()
return searchData.startDate?time.getTime() < new Date(searchData.startDate).getTime():false
}
}"
value-format="yyyy-MM-dd"
@ -285,7 +285,7 @@
<el-row>
<el-col :span="8">
<el-form-item label="货币" prop="currency">
<el-input v-model="insertData.currency" :disabled="insertData.internalInquiryNo !=''" placeholder="请输入内容" size="large" clearable />
<el-input v-model="insertData.currency" :disabled="insertData.internalInquiryNo !=''" placeholder="请输入内容" clearable />
</el-form-item>
</el-col>
<el-col :span="12" :offset="2">
@ -314,7 +314,7 @@
<el-form-item label="跟单员">
<!-- <el-form-item prop="tracker" label="跟单员">-->
<span slot="label" style="" v-if="insertData.internalInquiryNo ==''" @click="getBaseList(103,1)"><a herf="#">跟单员</a></span>
<el-input v-model="insertData.trackerName" :disabled="insertData.internalInquiryNo !=''" @clear="clearTracker" placeholder="请输入内容" size="large" clearable />
<el-input v-model="insertData.trackerName" :disabled="insertData.internalInquiryNo !=''" @clear="clearTracker" placeholder="请输入内容" clearable />
</el-form-item>
</el-col>
</el-row>
@ -327,8 +327,8 @@
</el-row>
</el-form>
<el-footer style="height:30px;margin-top: 20px;text-align:center">
<el-button @click="insertDiaLogFlag = false">关闭</el-button>
<el-button type="primary" :loading="insertQuotationHeaderBtn" @click="saveQuotationHeader">确定</el-button>
<el-button @click="insertDiaLogFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
@ -809,9 +809,6 @@ export default {
/deep/ .el-range-editor.el-input__inner{
padding: 0px 10px;
}
/deep/ .el-date-editor .el-range-separator{
width: auto;
}
/deep/ .el-input--mini .el-input__icon{
line-height: 20px;
}

676
src/views/modules/quotation/sellForQuotation/quotationDetail.vue

@ -209,8 +209,8 @@
</el-row>
</el-form>
<div slot="footer" class="dialog-footer" style="margin-top: 20px">
<el-button @click="quotationLeadIntoDetailFlag = false"> </el-button>
<el-button type="primary" :loading="insertQuotationDetailLoading" @click="insertQuotationDetailBtn"> </el-button>
<el-button @click="quotationLeadIntoDetailFlag = false"> </el-button>
</div>
</el-dialog>
@ -358,7 +358,41 @@
</el-form>
</el-tab-pane>
<el-tab-pane label="成品属性">
<el-button type="primary" @click="saveQuotationProductFlag = true"> </el-button>
<el-table
:height="400"
:data="quotationPropertiesItemList"
v-loading="quotationProductLoading" element-loading-text = "数据正在加载中"
element-loading-spinner = "el-icon-loading"
border stripe
style="width: 100%;">
<el-table-column
header-align="center"
align="center"
width="160"
label="操作">
<template slot-scope="{row,$index}">
<el-link type="text" style="cursor: pointer" size="small" @click="updateQuotationProductBtn(row)">修改</el-link>
<el-link type="text" style="cursor: pointer" size="small" @click="chooseModalBtn(row)" v-if="row.valueChooseFlag==='Y'" >可选值</el-link>
<el-link type="text" style="cursor: pointer" size="small" @click="deleteQuotationProductBtn(row)">删除</el-link>
</template>
</el-table-column>
<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-tab-pane>
<el-tab-pane label="成本&价格">
<el-button type="primary" @click="adjustCost"> </el-button>
@ -549,8 +583,8 @@
</el-tab-pane>
</el-tabs>
<span slot="footer" class="dialog-footer" style="margin-top: 20px">
<el-button @click=" quotationDetailFlag= false"> </el-button>
<el-button type="primary" :loading="editQuotationDetailLoading" @click="saveQuotationDetail"> </el-button>
<el-button @click=" quotationDetailFlag= false"> </el-button>
</span>
</el-dialog>
@ -602,8 +636,8 @@
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer" style="margin-top: 5px">
<el-button @click="saveQuotationToolFlag= false"> </el-button>
<el-button type="primary" :loading="saveQuotationToolLoading" @click="saveQuotationTool"> </el-button>
<el-button @click="saveQuotationToolFlag= false"> </el-button>
</span>
</el-dialog>
@ -770,8 +804,8 @@
</el-form>
<span slot="footer" class="dialog-footer" style="margin-top: 5px">
<el-button @click="quotationRoutingDialogFlag= false"> </el-button>
<el-button type="primary" :loading="saveQuotationRoutingLoading" @click="saveQuotationRoutingBtn"> </el-button>
<el-button @click="quotationRoutingDialogFlag= false"> </el-button>
</span>
</el-dialog>
@ -847,8 +881,8 @@
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="quotationPartDialogFlag = false"> </el-button>
<el-button type="primary" :loading="saveQuotationPartLoading" @click="saveQuotationPartBtn"> </el-button>
<el-button @click="quotationPartDialogFlag = false"> </el-button>
</span>
</el-dialog>
@ -1042,8 +1076,8 @@
<el-table-column label="预计使用寿命" prop="expectedServiceLife" show-overflow-tooltip/>
</el-table>
<span slot="footer" class="dialog-footer" style="margin-top: 5px">
<el-button @click="otherQuotationDetailDialogFlag= false"> </el-button>
<el-button type="primary" :loading="saveBatchLoading" @click="saveOtherQuotationDetailBtn"> </el-button>
<el-button @click="otherQuotationDetailDialogFlag= false"> </el-button>
</span>
</el-dialog>
@ -1083,6 +1117,189 @@
</el-table-column>
</el-table>
</el-dialog>
<el-dialog title="成品属性" :visible.sync="saveQuotationProductFlag" width="40%"
top="15vh" :close-on-click-modal="false" @close="closeQuotationProductDialog">
<el-form label-position="top" ref="quotationProductForm" :model="modalData" :rules="quotationProductRule" style="height: 260px">
<el-row>
<el-col :span="8">
<el-form-item label="属性编码" prop="itemNo">
<span slot="label" @click="propertiesItemDialogFlag = true" style="cursor: pointer"><a>属性编码</a></span>
<el-input v-model="modalData.itemNo" :disabled="quotationProductFlag"/>
</el-form-item>
</el-col>
<el-col :span="12" :offset="2">
<el-form-item label="属性名称" prop="itemDesc">
<el-input v-model="modalData.itemDesc"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="值类型" prop="valueTypeDb">
<el-select filterable v-model="modalData.valueTypeDb" style="width: 100%">
<el-option label="文本" value="T"></el-option>
<el-option label="数字" value="N"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" :offset="2">
<el-form-item label="参照值" v-if="modalData.valueTypeDb === 'N'" prop="defaultValue">
<el-input v-model="modalData.defaultValue" type="number" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))"/>
</el-form-item>
<el-form-item label="参照值" v-else>
<el-input v-model="modalData.defaultValue"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="最大值" prop="maxValue">
<el-input v-model="modalData.maxValue" type="number" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))"/>
</el-form-item>
</el-col>
<el-col :span="12" :offset="2">
<el-form-item label="最小值" prop="minValue">
<el-input v-model="modalData.minValue" type="number" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="属性类型" prop="itemType">
<el-select filterable v-model="modalData.itemType" :disabled="quotationProductFlag" style="width: 100%">
<el-option label="A" value="A"></el-option>
<el-option label="B" value="B"></el-option>
<el-option label="BM" value="BM"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" :offset="2">
<el-form-item label="是否值可选" prop="valueChooseFlag">
<el-select v-model="modalData.valueChooseFlag" style="width: 100%">
<el-option label="是" value="Y"></el-option>
<el-option label="否" value="N"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer" style="margin-top: 5px">
<el-button type="primary" :loading="saveQuotationProductBtnFlag" @click="saveQuotationProductBtn"> </el-button>
<el-button @click="saveQuotationProductFlag= false"> </el-button>
</span>
</el-dialog>
<el-dialog title="可选值" @close="closeChooseModalData" :close-on-click-modal="false" v-drag :visible.sync="chooseModalFlag" width="35%">
<el-form :inline="true" label-position="top" :model="chooseModalData">
<el-form-item label="属性名称:">
<el-input v-model="chooseModalData.itemDesc" disabled style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'值类型'">
<el-select filterable v-model="chooseModalData.valueTypeDb" disabled style="width: 120px">
<el-option label="文本" value="T"></el-option>
<el-option label="数字" value="N"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="' '">
<el-button type="primary" @click="addChooseModal">新增</el-button>
</el-form-item>
</el-form>
<el-table
:height="280"
:data="chooseTableData"
border
stripe
style="width: 100%;margin-top: 10px;margin-bottom: 10px;padding-bottom: 10px">
<el-table-column
v-if="chooseModalData.valueTypeDb === 'N'"
prop="availableValue"
header-align="center"
align="left"
min-width="200"
label="属性值">
</el-table-column>
<el-table-column
v-else
prop="availableValue"
header-align="center"
align="right"
min-width="200"
label="属性值">
</el-table-column>
<el-table-column
prop=""
header-align="center"
align="center"
min-width="100"
label="操作">
<template slot-scope="scope">
<el-link type="text" style="cursor: pointer" size="small" @click="updateChooseModal(scope.row)">修改</el-link>
<el-link type="text" style="cursor: pointer" @click="deleteItemAvailable(scope.row)">删除</el-link>
</template>
</el-table-column>
</el-table>
</el-dialog>
<el-dialog title="可选值维护" @close="closeItemData" :close-on-click-modal="false" v-drag :visible.sync="itemModalFlag" width="30%" >
<el-form ref="itemDataForm" :model="itemData" label-position="top" :rules="itemDataRule" style="height: 80px;width: 80%">
<el-form-item label="可选值" prop="availableValue">
<el-input v-model="itemData.availableValue" v-if="chooseModalData.valueTypeDb === 'T'"></el-input>
<el-input v-model="itemData.availableValue" v-else type="number" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))"></el-input>
</el-form-item>
</el-form>
<el-footer style="height:40px;margin-top: 20px;text-align:center">
<el-button type="primary" @click="saveItemAvailable">保存</el-button>
<el-button type="primary" @click="itemModalFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<!--成品选择-->
<el-dialog title="成品属性列表" @close="closePropertiesItemDialog" @open="openPropertiesItemDialog" :visible.sync="propertiesItemDialogFlag" width="40%">
<el-form :inline="true" label-position="top" ref="searchPropertiesDataForm" :model="searchPropertiesData" @keyup.enter.native="getDataList()">
<el-form-item label="属性编码">
<el-input v-model="searchPropertiesData.itemNo" style="width: 120px"></el-input>
</el-form-item>
<el-form-item label="属性名称">
<el-input v-model="searchPropertiesData.itemDesc" style="width: 120px"></el-input>
</el-form-item>
<el-form-item label="属性类型" >
<el-select filterable v-model="searchPropertiesData.itemType" style="width: 120px">
<el-option label="全部" value=""></el-option>
<el-option label="A" value="A"></el-option>
<el-option label="B" value="B"></el-option>
<el-option label="BM" value="BM"></el-option>
</el-select>
</el-form-item>
<el-form-item label=" " >
<el-button type="primary" @click="openPropertiesItemDialog"> </el-button>
</el-form-item>
</el-form>
<el-table
height="400"
:data="propertiesDataList"
border @row-dblclick="dblclickPropertiesTable"
style="width: 100%;margin-top: 10px">
<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-footer style="margin-top: 20px;text-align:center">
<!-- <el-button type="primary" @click="propertiesItemDialogFlag = false">关闭</el-button>-->
</el-footer>
</el-dialog>
</div>
</template>
<script>
@ -1109,22 +1326,26 @@ import {
searchQuotationTool,
updateQuotationDetail,
quotationDetailList,
searchQuotationPropertiesItem,
saveQuotationPropertiesItem,
deleteQuotationPropertiesItem,
deleteQuotationPropertiesItemAvailable,
searchQuotationPropertiesItemAvailable,
saveQuotationPropertiesItemAvailable
} from '@/api/quotation/quotationHeader.js';
import {searchUmInformationList,} from '@/api/part/umInformation.js';
import {searchToolHeader,searchTool} from '@/api/part/toolHeader.js';
import {searchWorkCenter,} from '@/api/part/workCenter.js';
import {searchPartList,searchPart} from '@/api/part/partInformation.js';
import {getProjectPartList,getProjectPart} from '@/api/project/project.js';
import {
queryOperationList, //
} from '@/api/part/routingManagement.js'
import {queryOperationList,} from '@/api/part/routingManagement.js'
import {propertiesItemList,propertiesAvailableList} from "@/api/base/properties.js"
import {Decimal} from "decimal.js";
export default {
props: ['quotationHeader'],
name: "quotationDetail",
data() {
//
//
const validateProductNo = (rule, value, callback) =>{
if (value === '' || value === null || value === undefined){
@ -1226,6 +1447,9 @@ export default {
selectionProjectPartList:[],//
projectPartTable:[],//
operationList: [],//
quotationPropertiesItemList:[],//
chooseTableData:[],//
propertiesDataList:[],
// =========================================================================================
no: 1,//
size: 20,//
@ -1241,6 +1465,11 @@ export default {
otherQuotationDetailDialogFlag:false,//
projectPartDialogFlag:false,//
componentPartModelFlag:false,//
saveQuotationProductFlag:false,//
quotationProductFlag:false,//
chooseModalFlag:false,//
itemModalFlag:false,
propertiesItemDialogFlag:false,
options:0,//
//
insertQuotationDetailLoading : false,//
@ -1249,11 +1478,13 @@ export default {
saveQuotationRoutingLoading:false,//
saveQuotationPartLoading:false,//
saveBatchLoading:false,//
saveQuotationProductBtnFlag:false,//
//
initQuotationDetailLoading:false,//
initQuotationRoutingLoading:false,//
initQuotationToolLoading:false,//
initQuotationPartLoading:false,//
quotationProductLoading:false,//
// =======================================================================================
//
insertQuotationDetailData: {
@ -1269,6 +1500,44 @@ export default {
operationId: '',
operationName: '',
},
searchPropertiesData:{
site: this.$store.state.user.site,
itemNo: '',
itemDesc: '',
itemType:'',
},
itemData:{
site: this.$store.state.user.site,
itemNo:'',
valueNo:'',
availableValue:'',
itemType:'',
createdBy: this.$store.state.user.name
},
//
modalData:{
site: this.$store.state.user.site,
flag: '',
itemNo: '',
itemDesc: '',
valueTypeDb: 'T',
defaultValue: '',
valueChooseFlag: 'N',
createdBy: this.$store.state.user.name,
maxValue: '',
minValue: '',
itemType: 'A',
updateBy: this.$store.state.user.name,
quotationDetailId:undefined,
QuotationPropertiesItemAvailable:[],
},
chooseModalData:{
site: this.$store.state.user.site,
itemNo: '',
itemDesc: '',
itemType:'',
valueTypeDb:'',
},
//
quotationPart:{
quotationPartId:undefined,//
@ -1415,7 +1684,149 @@ export default {
fixed: '',
}
],
productColumnList: [
{
userId: this.$store.state.user.name,
functionId: 100002001,
serialNumber: '100002001TableValueType',
tableId: "100002001Table",
tableName: "属性表",
columnProp: 'itemType',
headerAlign: "center",
align: "center",
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: 'itemNo',
headerAlign: "center",
align: "center",
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: 'itemDesc',
headerAlign: "center",
align: "center",
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: '',
},
{
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: '',
},
{
userId: this.$store.state.user.name,
functionId: 100002001,
serialNumber: '100002001TableMaxValue',
tableId: "100002001Table",
tableName: "属性表",
columnProp: 'maxValue',
headerAlign: "center",
align: "right",
columnLabel: '最大值',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
},
{
userId: this.$store.state.user.name,
functionId: 100002001,
serialNumber: '100002001TableMinValue',
tableId: "100002001Table",
tableName: "属性表",
columnProp: 'minValue',
headerAlign: "center",
align: "right",
columnLabel: '最小值',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
},
{
userId: this.$store.state.user.name,
functionId: 100002001,
serialNumber: '100002001TableValueChooseFlag',
tableId: "100002001Table",
tableName: "属性表",
columnProp: 'valueChooseFlag',
headerAlign: "center",
align: "center",
columnLabel: '是否值可选',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
},
],
// ======================================================================================
//
itemDataRule:{
availableValue:[{required: true, message: ' ', trigger: 'change'},{required: true, message: ' ', trigger: 'blur'},]
},
//
quotationDetailRules: {
productNo: [
@ -1597,7 +2008,27 @@ export default {
{required: true, pattern: /^[0-9]+(.[0-9]{1,2})?$/, message: ' ', trigger: 'blur'},
],
},
quotationProductRule:{
itemNo:[{required: true,message: ' ',trigger: 'change'},{required: true,message: ' ',trigger: 'blur'}],
itemDesc:[{required: true,message: ' ',trigger: 'change'},{required: true,message: ' ',trigger: 'blur'}],
valueTypeDb:[{required: true,message: ' ',trigger: 'change'},{required: true,message: ' ',trigger: 'blur'}],
defaultValue:[{type: 'number',message:' ', trigger: 'change',transform: (value) => Number(value)},{type: 'number',message:' ', trigger: 'blur',transform: (value) => Number(value)}],
maxValue:[{type: 'number',message:' ', trigger: 'change',transform: (value) => Number(value)},{type: 'number',message:' ', trigger: 'blur',transform: (value) => Number(value)}],
minValue:[{type: 'number',message:' ',trigger: 'change',transform: (value) => Number(value)},{type: 'number',message:' ', trigger: 'blur',transform: (value) => Number(value)}],
itemType:[{required: true,message: ' ',trigger: 'change'},{required: true,message: ' ',trigger: 'blur'}],
valueChooseFlag:[{required: true,message: ' ',trigger: 'change'},{required: true,message: ' ',trigger: 'blur'}],
},
// ==========================================================================
quotationProductColumns:[
{label:"itemNo",value:"属性编码"},
{label:"itemDesc",value:"属性名称"},
{label:"valueTypeDb",value:"值类型"},
{label:"defaultValue",value:"defaultValue"},
{label:"maxValue",value:"最大值"},
{label:"minValue",value:"最小值"},
{label:"itemType",value:"属性类型"},
{label:"valueChooseFlag",value:"valueChooseFlag"},
],
//
quotationDetailColumns: [
{label: "productDesc", value: "产品名称"},
@ -1797,6 +2228,43 @@ export default {
},
methods: {
// ===============================================================================================
saveItemAvailable(){
this.$refs.itemDataForm.validate((validate)=>{
if (!validate){
this.$message.warning("可选值不能为空!")
}else {
saveQuotationPropertiesItemAvailable(this.itemData).then(({data})=>{
if (data.code === 200){
this.searchQuotationPropertiesItemAvailable();
this.$message.success(data.msg);
this.itemModalFlag = false;
}else {
this.$message.warning(data.msg);
}
}).catch((error)=>{
this.$message.error("网络异常!")
})
}
})
},
//
saveQuotationPropertiesItem(){
//
this.modalData.quotationDetailId = this.quotationDetailData.quotationDetailId;
saveQuotationPropertiesItem(this.modalData).then(({data})=>{
if (data.code === 200){
this.$message.success(data.msg);
this.searchQuotationPropertiesItem();
this.saveQuotationProductFlag= false
}else {
this.$message.warning(data.msg);
}
this.saveQuotationProductBtnFlag = false;
}).catch((error)=>{
this.$message.error("网络异常!");
this.saveQuotationProductBtnFlag = false;
})
},
//
insertQuotationDetailBtn() {
this.$refs['insertQuotationDetailForm'].validate((validate, objects) => {
@ -1815,6 +2283,7 @@ export default {
this.$message.success(data.msg);
} else {
this.$message.error(data.msg);
// this.$set
}
}).catch((error)=>{
this.insertQuotationDetailLoading = false;
@ -1889,6 +2358,43 @@ export default {
})
})
},
//
deleteItemAvailable(row){
this.$confirm(`是否删除这个可选值?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteQuotationPropertiesItemAvailable(row).then(({data}) => {
if (data.code === 200) {
this.searchQuotationPropertiesItemAvailable();
this.$message.success(data.msg)
}else {
this.$message.warning(data.msg)
}
}).catch((error) => {
this.$message.error("网络异常")
})
})
},
deleteQuotationProductBtn(row){
this.$confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteQuotationPropertiesItem(row).then(({data})=>{
if (data.code === 200){
this.searchQuotationPropertiesItem();
this.$message.success(data.msg);
}else {
this.$message.error(data.msg);
}
}).catch((error)=>{
this.$message.error("网络异常!");
})
})
},
//
deleteSelectionQuotationTool(){
if (this.selectionQuotationToolList.length === 0) {
@ -2150,6 +2656,18 @@ export default {
}
})
},
//
saveQuotationProductBtn(){
this.$refs.quotationProductForm.validate((validate,objects)=>{
if (!validate) {
this.rulesValidateLabel(objects, this.quotationProductColumns);
}else {
//
this.saveQuotationProductBtnFlag = true;
this.saveQuotationPropertiesItem();
}
})
},
//
batchInsertQuotationPartData(quotationPrtList){
batchInsertQuotationPart(quotationPrtList).then(({data})=>{
@ -2266,6 +2784,29 @@ export default {
this.quotationDetailFlag = true;
},
// ==============================================================================================
//
searchQuotationPropertiesItem(){
//
let params = {
quotationDetailId: this.quotationDetailData.quotationDetailId,
site:this.$store.state.user.site,
}
//
this.quotationPropertiesItemList = []
//
this.quotationProductLoading = true;
searchQuotationPropertiesItem(params).then(({data})=>{
if (data.code === 200){
//
this.quotationPropertiesItemList = data.data;
}
//
this.quotationProductLoading = false;
}).catch((error)=>{
//
this.quotationProductLoading = false;
})
},
//
initData() {
let params = {
@ -2296,6 +2837,20 @@ export default {
}
})
},
//
searchQuotationPropertiesItemAvailable(){
this.chooseTableData = [];
searchQuotationPropertiesItemAvailable(this.chooseModalData).then(({data})=>{
if (data.code === 200){
this.chooseTableData = data.data
this.chooseModalFlag=true;
}else {
this.$message.error("参数有误!")
}
}).catch((error)=>{
this.$message.error("网络异常")
})
},
//
initToolHeader(){
searchToolHeader(this.toolHeader).then(({data})=>{
@ -2469,7 +3024,32 @@ export default {
},
// ===============================================dialog==================================================
//
chooseModalBtn(row){
this.chooseModalData.itemNo=row.itemNo;
this.chooseModalData.itemDesc=row.itemDesc;
this.chooseModalData.valueTypeDb=row.valueTypeDb;
this.chooseModalData.itemType=row.itemType;
this.searchQuotationPropertiesItemAvailable();
},
//
updateChooseModal(row){
this.itemData = JSON.parse(JSON.stringify(row));
this.itemModalFlag = true;
},
// << >>
openPropertiesItemDialog(){
this.propertiesDataList = [];
propertiesItemList(this.searchPropertiesData).then(({data})=>{
if (data.code === 200){
this.propertiesDataList = data.data;
}else {
this.$message.warning(data.msg)
}
}).catch((error)=>{
this.$message.error("网络异常")
})
},
openQuotationDetailData() {
//
if (this.insertQuotationDetailData.flag){
@ -2499,6 +3079,7 @@ export default {
this.initQuotationRoutingData();
this.initQuotationPart();
this.initOtherQuotationDetail();
this.searchQuotationPropertiesItem();
},
//
openInsertQuotationDetail() {
@ -2521,9 +3102,25 @@ export default {
this.$refs.quotationPartForm.resetFields();
}
},
addChooseModal(){
this.itemData = {
site: this.$store.state.user.site,
itemNo:this.chooseModalData.itemNo,
valueNo:0,
availableValue:'',
itemType:this.chooseModalData.itemType,
createdBy: this.$store.state.user.name
}
this.itemModalFlag = true;
},
openProjectPartDialog(){
this.getProjectPartList();
},
updateQuotationProductBtn(row){
this.modalData = JSON.parse(JSON.stringify(row));
this.saveQuotationProductFlag = true;
this.quotationProductFlag = true
},
//
clickOtherQuotationDetailsBtn(i){
this.initOtherQuotationDetail();
@ -2695,6 +3292,59 @@ export default {
}
this.otherQuotationDetailList = [];
},
closePropertiesItemDialog(){
this.$refs.searchPropertiesDataForm.resetFields();
this.searchPropertiesData = {
site: this.$store.state.user.site,
itemNo: '',
itemDesc: '',
itemType:'',
}
},
closeQuotationProductDialog(){
//
this.$refs.quotationProductForm.resetFields();
//
this.modalData={
site: this.$store.state.user.site,
flag: '',
itemNo: '',
itemDesc: '',
valueTypeDb: 'T',
defaultValue: '',
valueChooseFlag: 'N',
createdBy: this.$store.state.user.name,
maxValue: '',
minValue: '',
itemType: 'A',
updateBy: this.$store.state.user.name,
quotationDetailId:undefined,
QuotationPropertiesItemAvailable:[]
}
this.quotationProductFlag = false;
},
//
closeChooseModalData(){
this.chooseModalData = {
site: this.$store.state.user.site,
itemNo: '',
itemDesc: '',
itemType:'',
valueTypeDb:'',
}
},
//
closeItemData(){
this.$refs.itemDataForm.resetFields();
this.itemData={
site: this.$store.state.user.site,
itemNo:'',
valueNo:'',
availableValue:'',
itemType:'',
createdBy: this.$store.state.user.name
}
},
// ===============================================================================================
//
handleSelectionChangeQuotationToolTable(selection){
@ -2725,6 +3375,10 @@ export default {
toggleRowSelectionTable(row,refName){
this.$refs[refName].toggleRowSelection(row);
},
dblclickPropertiesTable(row){
this.modalData = JSON.parse(JSON.stringify(row));
this.propertiesItemDialogFlag = false
},
dblClickPartTable(row){
row = JSON.parse(JSON.stringify(row));
this.quotationPart.quotationPartNo = row.partNo;

4
src/views/modules/quotation/toBeQuoted.vue

@ -34,7 +34,7 @@
<el-date-picker
:picker-options="{
disabledDate : time => {
return new Date(searchData.endDate).getTime() < time.getTime()
return searchData.endDate?new Date(searchData.endDate).getTime() < time.getTime():false
}
}"
value-format="yyyy-MM-dd"
@ -55,7 +55,7 @@
<el-date-picker
:picker-options="{
disabledDate : time => {
return time.getTime() < new Date(searchData.startDate).getTime()
return searchData.startDate?time.getTime() < new Date(searchData.startDate).getTime():false
}
}"
value-format="yyyy-MM-dd"

Loading…
Cancel
Save