|
@@ -3,7 +3,6 @@
|
|
|
<avue-crud :option="option"
|
|
|
:table-loading="loading"
|
|
|
:data="tableData"
|
|
|
- v-model="form"
|
|
|
id="out-table"
|
|
|
:header-cell-class-name="headerClassName"
|
|
|
ref="crud"
|
|
@@ -23,16 +22,98 @@
|
|
|
@click="oneclickEditingfun">一键编辑
|
|
|
</el-button>
|
|
|
</template>
|
|
|
+ <template slot="sortHeader" slot-scope="scope">
|
|
|
+ <el-button v-if="roleName.indexOf('admin') != -1 || roleName.indexOf('应付修改') != -1"
|
|
|
+ type="primary" size="small" icon="el-icon-plus" circle
|
|
|
+ @click="addCfun">
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ <template slot="destinationCountryCnName" slot-scope="{ row }">
|
|
|
+ <search-query v-if="row.edit"
|
|
|
+ :datalist="destinationCountryData"
|
|
|
+ :selectValue="row.destinationCountryCnName"
|
|
|
+ :filterable="true"
|
|
|
+ :clearable="true"
|
|
|
+ :remote="true"
|
|
|
+ :buttonIf="false"
|
|
|
+ :forParameter="{key:'id',label:'cnName',value:'cnName'}"
|
|
|
+ @remoteMethod="destinationCountrybcountrysListfun"
|
|
|
+ @corpChange="corpChange($event,'destinationCountryCnName',row)"
|
|
|
+ @corpFocus="destinationCountrybcountrysListfun">
|
|
|
+ </search-query>
|
|
|
+ <span v-else >{{row.destinationCountryCnName}}}</span>
|
|
|
+ </template>
|
|
|
+ <template slot="transactionUnit" slot-scope="{ row }">
|
|
|
+ <search-query v-if="row.edit"
|
|
|
+ :datalist="transactionUnitData"
|
|
|
+ :selectValue="row.transactionUnit"
|
|
|
+ :filterable="true"
|
|
|
+ :clearable="true"
|
|
|
+ :remote="true"
|
|
|
+ :buttonIf="false"
|
|
|
+ :forParameter="{key:'id',label:'cnName',value:'cnName'}"
|
|
|
+ @remoteMethod="transactionUnitBunitsListfun"
|
|
|
+ @corpChange="corpChange($event,'transactionUnit',row)"
|
|
|
+ @corpFocus="transactionUnitBunitsListfun">
|
|
|
+ </search-query>
|
|
|
+ <span v-else >{{row.transactionUnit}}}</span>
|
|
|
+ </template>
|
|
|
+ <template slot="transactionVolume" slot-scope="{ row }">
|
|
|
+ <el-input v-if="row.edit" v-model="row.transactionVolume" size="small"
|
|
|
+ :controls="false" :precision="0"
|
|
|
+ placeholder="请输入" @blur="transactionVolumeBlur(row)"></el-input>
|
|
|
+ <span v-else>{{row.transactionVolume}}</span>
|
|
|
+ </template>
|
|
|
+ <template slot="transactionPrice" slot-scope="{ row }">
|
|
|
+ <el-input v-if="row.edit" v-model="row.transactionPrice" size="small"
|
|
|
+ :controls="false" :precision="0"
|
|
|
+ placeholder="请输入" @blur="transactionPriceBlur(row)"></el-input>
|
|
|
+ <span v-else>{{row.transactionPrice}}</span>
|
|
|
+ </template>
|
|
|
+ <template slot="totalPrice" slot-scope="{ row }">
|
|
|
+ <el-input v-if="row.edit" v-model="row.totalPrice" size="small"
|
|
|
+ :controls="false" :precision="0"
|
|
|
+ placeholder="请输入" @blur="totalPriceBlur(row)"></el-input>
|
|
|
+ <span v-else>{{row.totalPrice}}</span>
|
|
|
+ </template>
|
|
|
+ <template slot="currency" slot-scope="{ row }">
|
|
|
+ <search-query v-if="row.edit"
|
|
|
+ :datalist="currencyData"
|
|
|
+ :selectValue="row.currency"
|
|
|
+ :clearable="true"
|
|
|
+ :buttonIf="false"
|
|
|
+ :forParameter="{key:'id',label:'code',value:'code'}"
|
|
|
+ @corpChange="corpChange($event,'currency',row)"
|
|
|
+ @corpFocus="currencyRateListfun" >
|
|
|
+ </search-query>
|
|
|
+ <span v-else>{{row.currency}}</span>
|
|
|
+ </template>
|
|
|
+
|
|
|
+
|
|
|
</avue-crud>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
|
|
|
+ import {bcountrysList} from "@/api/iosBasicData/bcountrys";
|
|
|
+ import {getBunitsList} from "@/api/iosBasicData/bunits";
|
|
|
+ import {getRateList} from "@/api/iosBasicData/rateManagement";
|
|
|
+
|
|
|
export default {
|
|
|
+ components: {SearchQuery},
|
|
|
props:{
|
|
|
disabled:{
|
|
|
type:Boolean,
|
|
|
default:false,
|
|
|
+ },
|
|
|
+ tableData:{
|
|
|
+ type:Array,
|
|
|
+ default: []
|
|
|
+ },
|
|
|
+ roleName:{
|
|
|
+ type:Array,
|
|
|
+ default:[]
|
|
|
}
|
|
|
},
|
|
|
data(){
|
|
@@ -88,7 +169,7 @@
|
|
|
},
|
|
|
{
|
|
|
label: "目的国",
|
|
|
- prop: "destinationCountryEnName",
|
|
|
+ prop: "destinationCountryCnName",
|
|
|
overHidden:true,
|
|
|
},
|
|
|
{
|
|
@@ -155,18 +236,95 @@
|
|
|
},
|
|
|
loading:false,
|
|
|
tableData:[],
|
|
|
- form:{}
|
|
|
+ destinationCountryData:[], // 目的国
|
|
|
+ transactionUnitData:[], // 成交单位
|
|
|
+ currencyData:[], // 币种数据
|
|
|
|
|
|
}
|
|
|
},
|
|
|
async created() {
|
|
|
this.option = await this.getColumnData(this.getColumnName(326.1), this.optionBack);
|
|
|
},
|
|
|
- methods:{
|
|
|
+ methods: {
|
|
|
+ // 添加
|
|
|
+ addCfun(){
|
|
|
+ this.tableData.push({
|
|
|
+ edit:true
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 一键删除
|
|
|
+ batchDelete(dc){
|
|
|
+ this.$confirm("确定将选择数据删除?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(()=>{
|
|
|
+ let multiList = this.handleSelectionData
|
|
|
+ let arr = this.tableData
|
|
|
+ // 获取有id 的数据
|
|
|
+ const itemsWithId = multiList.filter(item => item.hasOwnProperty('id'));
|
|
|
+ let arrIds = itemsWithId.map(item=>item.id) // 获取id 数据
|
|
|
+ // 把选中的删除掉
|
|
|
+ multiList.forEach((item)=>{
|
|
|
+ for (let index in arr) {
|
|
|
+ if (JSON.stringify(item) == JSON.stringify(arr[index])) {
|
|
|
+ arr.splice(Number(index),1)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // 有id 的处理
|
|
|
+ if(itemsWithId.length != 0) {
|
|
|
+ console.log('掉接口删除')
|
|
|
+ // feecenterRemove(arrIds.join(',')).then(res=>{
|
|
|
+ // this.$message.success('操作成功')
|
|
|
+ // // this.$emit('billsDetailfun')
|
|
|
+ // })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 下拉回调
|
|
|
+ corpChange(value,name,row){
|
|
|
+ // 目的国
|
|
|
+ if (name == 'destinationCountryCnName') {
|
|
|
+ for (let item of this.destinationCountryData) {
|
|
|
+ if (item.cnName == value) {
|
|
|
+ this.$set(row,'destinationCountryId',item.id)
|
|
|
+ this.$set(row,'destinationCountryCnName',item.cnName)
|
|
|
+ this.$set(row,'destinationCountryEnName',item.cnName)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ this.$set(row,name,value)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 数量失焦
|
|
|
+ transactionVolumeBlur(row){
|
|
|
+ console.log(row,276)
|
|
|
+ },
|
|
|
+
|
|
|
+ // 接口调用 😓😓😓😓😓😓😓😓😓😓😓😓😓😓
|
|
|
+ // 目的国
|
|
|
+ destinationCountrybcountrysListfun(cnName){
|
|
|
+ bcountrysList(1,10,{cnName}).then(res=>{
|
|
|
+ this.destinationCountryData = res.data.data.records
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 成交单位
|
|
|
+ transactionUnitBunitsListfun(cnName){
|
|
|
+ getBunitsList(1,10,{cnName}).then(res=>{
|
|
|
+ this.transactionUnitData = res.data.data.records
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 币种
|
|
|
+ currencyRateListfun(){
|
|
|
+ getRateList().then(res=>{
|
|
|
+ this.currencyData = res.data.data.records
|
|
|
+ })
|
|
|
+ },
|
|
|
// 多选选择的数据
|
|
|
handleSelectionChange(arr){
|
|
|
- this.$emit('handleSelectionChange',arr)
|
|
|
- // this.handleSelectionData = arr
|
|
|
+ // this.$emit('handleSelectionChange',arr)
|
|
|
+ this.handleSelectionData = arr
|
|
|
},
|
|
|
//自定义列保存
|
|
|
async saveColumnTwo(ref, option, optionBack, code) {
|