|
|
@@ -2,7 +2,7 @@
|
|
|
<div>
|
|
|
<div>
|
|
|
<div class="flex-align-center" style="margin-bottom:10px">
|
|
|
- <el-input size="small" style="width:200px;margin-right:10px" v-model="params.content.where.condition" placeholder="输入搜索内容" @clear="listData(params.content.pageNumber = 1)" @keyup.native.enter="listData(params.content.pageNumber = 1)" clearable></el-input>
|
|
|
+ <el-input size="small" style="width:200px;margin-right:10px" v-model="params.content.where.condition" placeholder="输入搜索111内容" @clear="listData(params.content.pageNumber = 1)" @keyup.native.enter="listData(params.content.pageNumber = 1)" clearable></el-input>
|
|
|
<slot name="addProduct"/>
|
|
|
<uploadAllData
|
|
|
v-if="tool.checkAuth($route.name,'productBillManage') && data.status === '新建' && isLeader"
|
|
|
@@ -14,13 +14,22 @@
|
|
|
type="del"
|
|
|
></uploadAllData>
|
|
|
<el-button class="inline-16" v-if="tool.checkAuth($route.name,'productBillManage') && data.status === '新建' && isLeader" size="small" :type="delProductData.length === 0?'':'primary'" @click="onDelProduct" :disabled="delProductData.length === 0">删 除</el-button>
|
|
|
- <addProductContract class="inline-16" title="添 加" :tablecolsAdd="tablecolsAdd" :tradefield="data.tradefield" :data="data" @closeDrawer="closeDrawer"
|
|
|
+ <addProductContract class="inline-16" title="自报价单添加" :tablecolsAdd="tablecolsAdd" :tradefield="data.tradefield" :data="data" @closeDrawer="closeDrawer"
|
|
|
@addSuccess="queryProuctAdds" @addAll="addAll" ref="addProduct" @addProduct="queryProuctAdd" @uploadData="queryUploadData" v-if="tool.checkAuth($route.name,'productBillManage') && data.status === '新建' && isLeader"
|
|
|
>
|
|
|
</addProductContract>
|
|
|
+ <addProduct v-if="tool.checkAuth($route.name,'productBillManage') && data.status === '新建' && isLeader"
|
|
|
+ class="inline-16" @productAdd="queryProuctAdd" :params="paramProductAdd" :tablecolsAdd="tablecolsProductAdd" title="自产品档案添加"
|
|
|
+ @addSuccess="queryProuctAdds" @addProduct="queryProuctAdd" @uploadData="queryUploadData" @closeDrawer="closeDrawer"
|
|
|
+ :tradefield="data.tradefield" ref="addArchivesProduct"
|
|
|
+ >
|
|
|
+ <!--阀门选型-->
|
|
|
+ <selectOption position="报价单" slot="optionSystem" style="margin-left: 10px" @handleParam="handleOptionParam" v-if="tool.checkAuth($route.name,'optionSystem')"></selectOption>
|
|
|
+ </addProduct>
|
|
|
<exportFile v-if="tool.checkAuth($route.name,'export')" :param="params" :columns="tablecols" fileName="产品明细折扣"></exportFile>
|
|
|
<slot name="cooperate"></slot>
|
|
|
</div>
|
|
|
+ <SetOrder ref="setOrder"></SetOrder>
|
|
|
<tableLayout checkbox="true" :layout="tablecols" :data="list" :width="true" :opwidth="200" height="calc(100vh - 380px)" :custom="true" fixedName="operation countPrice" @selectionChange="selectionChange">
|
|
|
<template v-slot:customcol="scope">
|
|
|
<div v-if="scope.column.columnname == 'qty'">
|
|
|
@@ -55,6 +64,14 @@
|
|
|
<div v-else-if="scope.column.columnname == 'brand'">
|
|
|
{{scope.column.data[scope.column.columnname][0] && scope.column.data[scope.column.columnname][0].brandname}}
|
|
|
</div>
|
|
|
+ <div v-else-if="scope.column.columnname == 'itemname'">
|
|
|
+ <div v-if="scope.column.data.sa_lectotypecfgid">
|
|
|
+ <el-tooltip class="item" effect="dark" content="点击查看选型配置单" placement="top-start">
|
|
|
+ <el-button size="small" type="text" @click="$refs.setOrder.onShow(scope.column.data.sa_lectotypecfgid)">{{ scope.column.data.itemname }}</el-button>
|
|
|
+ </el-tooltip>
|
|
|
+ </div>
|
|
|
+ <div v-else>{{ scope.column.data.itemname }}</div>
|
|
|
+ </div>
|
|
|
<p v-else>{{scope.column.data[scope.column.columnname]}}</p>
|
|
|
<p v-if="!scope.column.data[scope.column.columnname] && scope.column.data[[scope.column.columnname]] !== 0 && scope.column.columnname != 'operation' && scope.column.columnname != 'countPrice'">--</p>
|
|
|
</template>
|
|
|
@@ -96,13 +113,16 @@
|
|
|
<script>
|
|
|
// import edit from './editProduct'
|
|
|
import tableLayout from '@/components/dynamic-table/index2'
|
|
|
-import addProduct from './addProduct'
|
|
|
+// import addProduct from './addProduct'
|
|
|
import previewImage from '@/components/previewImage/index'
|
|
|
import addProductContract from '@/template/addProductContract/index'
|
|
|
import uploadAllData from '@/components/uploadAllData/index'
|
|
|
import exportFile from '@/components/export_file/index1'
|
|
|
+import addProduct from '@/template/addProduct'
|
|
|
+import SelectOption from '@/optionSystem/selectOption/add.vue'
|
|
|
+import SetOrder from '@/optionSystem/selectOption/components/setOrder.vue'
|
|
|
export default {
|
|
|
- components: {addProduct,previewImage,addProductContract,uploadAllData,tableLayout,exportFile},
|
|
|
+ components: {addProduct,previewImage,addProductContract,uploadAllData,tableLayout,exportFile,SelectOption,SetOrder},
|
|
|
name: '',
|
|
|
props:["data","isLeader"],
|
|
|
data() {
|
|
|
@@ -127,9 +147,22 @@ export default {
|
|
|
},
|
|
|
tablecols:[],
|
|
|
tablecolsAdd:[],
|
|
|
+ tablecolsProductAdd:[],
|
|
|
total:0,
|
|
|
editIndex:'',
|
|
|
- totalPrice:0
|
|
|
+ totalPrice:0,
|
|
|
+ paramProductAdd:{
|
|
|
+ "id": 20221124093602,
|
|
|
+ "content": {
|
|
|
+ "sa_contractid": this.$route.query.id,
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageSize": 100,
|
|
|
+ "where": {
|
|
|
+ "condition": "",
|
|
|
+ "istool": 0
|
|
|
+ }
|
|
|
+ },
|
|
|
+ }
|
|
|
};
|
|
|
},
|
|
|
computed:{
|
|
|
@@ -145,11 +178,18 @@ export default {
|
|
|
if (this.$route.query.id) this.listData()
|
|
|
this.tablecols = this.tool.tabelCol(this.$route.name).productBillnoTable.tablecols
|
|
|
this.tablecolsAdd = this.tool.tabelCol(this.$route.name).addProuctProject.tablecols
|
|
|
+ this.tablecolsProductAdd = this.tool.tabelCol(this.$route.name).productArchivesTable.tablecols
|
|
|
},
|
|
|
mounted() {
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
+ handleOptionParam (param) {
|
|
|
+ param.content.enterprisename = this.data.enterprisename
|
|
|
+ param.content.projectname = this.data.projectname
|
|
|
+ param.content.sourcetable = 'sa_contract'
|
|
|
+ param.content.source = `项目合同:${this.data.billno}`
|
|
|
+ },
|
|
|
async listData(){
|
|
|
this.totalPrice = 0
|
|
|
this.params.content.sa_contractid = this.$route.query.id
|
|
|
@@ -276,10 +316,10 @@ export default {
|
|
|
"items": data.map(e=>{
|
|
|
return {
|
|
|
"itemid": e.itemid,
|
|
|
- "price": e.price,
|
|
|
- "qty": e.qty,
|
|
|
+ "price": e.price || (e.marketprice * 1).toFixed(4),
|
|
|
+ "qty": e.qty || e.orderminqty,
|
|
|
"marketprice":e.marketprice,
|
|
|
- "discountrate":e.discountrate,
|
|
|
+ "discountrate":e.discountrate || 1,
|
|
|
"type":'指定单价'
|
|
|
}
|
|
|
})
|
|
|
@@ -293,10 +333,10 @@ export default {
|
|
|
let item = data.map(item => {
|
|
|
return {
|
|
|
"itemid": item.itemid,
|
|
|
- "price": item.price,
|
|
|
- "qty": item.qty,
|
|
|
+ "price": item.price || (item.marketprice * 1).toFixed(4),
|
|
|
+ "qty": item.qty || item.orderminqty,
|
|
|
"marketprice":item.marketprice,
|
|
|
- "discountrate":item.discountrate,
|
|
|
+ "discountrate":item.discountrate || 1,
|
|
|
"type":'指定单价'
|
|
|
}
|
|
|
})
|
|
|
@@ -347,6 +387,7 @@ export default {
|
|
|
this.$emit('onSuccess')
|
|
|
this.listData()
|
|
|
this.$refs.addProduct.listData()
|
|
|
+ this.$refs.addArchivesProduct.listData()
|
|
|
})
|
|
|
},
|
|
|
/*单个商品添加校验*/
|
|
|
@@ -381,6 +422,10 @@ export default {
|
|
|
},
|
|
|
/*单个添加商品*/
|
|
|
async addProduct (data) {
|
|
|
+ let price = 0
|
|
|
+ if (!data.price){
|
|
|
+ price = (data.marketprice * 1).toFixed(4)
|
|
|
+ }
|
|
|
let res = await this.$api.requested({
|
|
|
"id": 20221123164402,
|
|
|
"content": {
|
|
|
@@ -388,10 +433,10 @@ export default {
|
|
|
"items": [
|
|
|
{
|
|
|
"itemid": data.itemid,
|
|
|
- "price": data.price,
|
|
|
- "qty": data.qty,
|
|
|
+ "price": data.price || price,
|
|
|
+ "qty": data.qty || data.orderminqty,
|
|
|
"marketprice":data.marketprice,
|
|
|
- "discountrate":data.discountrate,
|
|
|
+ "discountrate":data.discountrate || 1,
|
|
|
"type":'指定单价'
|
|
|
}
|
|
|
]
|
|
|
@@ -399,6 +444,7 @@ export default {
|
|
|
})
|
|
|
this.tool.showMessage(res,() => {
|
|
|
this.$refs.addProduct.listData()
|
|
|
+ this.$refs.addArchivesProduct.listData()
|
|
|
this.listData()
|
|
|
this.$emit('onSuccess')
|
|
|
})
|