|
@@ -93,6 +93,7 @@
|
|
|
<el-button v-if="scope.row.status=='已完成'" @click="closeaccount(scope.row)" type="primary">结算</el-button>
|
|
|
<el-button @click="inventory(scope.row)" type="primary">库存</el-button>
|
|
|
<el-button @click="cost(scope.row)" type="primary">费用</el-button>
|
|
|
+ <el-button @click="exportText(scope.row)" type="primary" v-if="scope.row.status == '已结算'">导出</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -134,10 +135,7 @@
|
|
|
<td class="col">{{tableData.seller}}</td>
|
|
|
</tr>
|
|
|
<tr class="row">
|
|
|
- <td class="col col-bgc">
|
|
|
- <span v-if="tableData.agreementType == '采购合同'">采购</span>
|
|
|
- <span v-if="tableData.agreementType == '收购合同'">收购</span>
|
|
|
- <span v-if="tableData.agreementType == '销售合同'">销售</span>结算单价(元/吨)</td>
|
|
|
+ <td class="col col-bgc">结算单价(元/吨)</td>
|
|
|
<td class="col">{{tableData.settlementPrice}}</td>
|
|
|
<td class="col col-bgc">合计利润(元)</td>
|
|
|
<td class="col">{{tableData.profit}}</td>
|
|
@@ -149,11 +147,7 @@
|
|
|
<td class="col col-bgc">利润(元)</td>
|
|
|
</tr>
|
|
|
<tr v-for="item in tableData.contractList" class="row">
|
|
|
- <td class="col">{{item.contractNo}}
|
|
|
- <span v-if="item.agreementType == '采购合同'">(采购)</span>
|
|
|
- <span v-if="item.agreementType == '收购合同'">(收购)</span>
|
|
|
- <span v-if="item.agreementType == '销售合同'">(销售)</span>
|
|
|
- </td>
|
|
|
+ <td class="col">{{item.contractNo}}</td>
|
|
|
<td class="col">{{item.settlementPrice}}</td>
|
|
|
<td class="col">{{item.weight}}</td>
|
|
|
<td class="col">{{item.profit}}</td>
|
|
@@ -161,6 +155,20 @@
|
|
|
</table>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+<el-dialog title="导出" :visible.sync="exportShow" width="500px" :before-close="exportClose" :show-close="true">
|
|
|
+ <div class="check">
|
|
|
+ <el-checkbox-group v-model="checkList" @change="checkChange">
|
|
|
+ <el-checkbox label="合同附件" :disabled="contract"></el-checkbox>
|
|
|
+ <el-checkbox label="发运记录"></el-checkbox>
|
|
|
+ <el-checkbox label="费用记录"></el-checkbox>
|
|
|
+ <el-checkbox label="结算单"></el-checkbox>
|
|
|
+ </el-checkbox-group>
|
|
|
+ </div>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="exportClose">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="exportSubmit">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
@@ -168,7 +176,9 @@
|
|
|
getcontractdetails,
|
|
|
getrelationcontract,
|
|
|
editcontract,
|
|
|
- judgesettlement
|
|
|
+ judgesettlement,
|
|
|
+ exportText,
|
|
|
+ getAnnex
|
|
|
} from '@/model/profitable/index'
|
|
|
export default {
|
|
|
components: {},
|
|
@@ -195,6 +205,10 @@
|
|
|
tableData:{},
|
|
|
datalist:{},
|
|
|
compId:localStorage.getItem('ws-pf_compId'),
|
|
|
+ exportShow: false,//导出
|
|
|
+ checkList: [],
|
|
|
+ exportObj: {},
|
|
|
+ contract: false,
|
|
|
}
|
|
|
},
|
|
|
activated() {
|
|
@@ -206,6 +220,66 @@
|
|
|
this.getPassYearFormatDate()
|
|
|
},
|
|
|
methods: {
|
|
|
+ async exportSubmit() {
|
|
|
+ const {
|
|
|
+ data
|
|
|
+ } = await exportText(
|
|
|
+ this.exportObj, {}, {
|
|
|
+ responseType: 'blob',
|
|
|
+ }
|
|
|
+ ).toPromise()
|
|
|
+ downloadFile({
|
|
|
+ res: data,
|
|
|
+ fileName: this.exportObj.contractNo + `结算详情`,
|
|
|
+ type: 'doc',
|
|
|
+ })
|
|
|
+ this.exportShow = false
|
|
|
+ this.checkList = []
|
|
|
+ this.exportObj = {}
|
|
|
+ },
|
|
|
+ exportText(row) {//导出
|
|
|
+ this.exportObj.contractNo = row.contractNo
|
|
|
+ if (row.addressUrl) {//查看附件后返回后端
|
|
|
+ getAnnex({
|
|
|
+ appendixIds: row.addressUrl,
|
|
|
+ }).toPromise().then(res => {
|
|
|
+ let arr = []
|
|
|
+ if (res.length > 0) {
|
|
|
+ for (let i = 0; i < res.length; i++) {
|
|
|
+ arr.push(res[i].appendixPath)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (arr.length > 0) {
|
|
|
+ this.exportObj.addressUrl = arr.toString()
|
|
|
+ } else {//合同附件为空不让勾选
|
|
|
+ this.contract = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.exportShow = true
|
|
|
+ },
|
|
|
+ checkChange(e) {
|
|
|
+ for (let i = 0; i < this.checkList.length; i++) {
|
|
|
+ switch (this.checkList[i]) {
|
|
|
+ case '合同附件':
|
|
|
+ this.exportObj.needContractUrl = 1
|
|
|
+ break
|
|
|
+ case '发运记录':
|
|
|
+ this.exportObj.shippingRecord = 1
|
|
|
+ break
|
|
|
+ case '费用记录':
|
|
|
+ this.exportObj.expenseRecord = 1
|
|
|
+ break
|
|
|
+ case '结算单':
|
|
|
+ this.exportObj.needSettlementUrl = 1
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ exportClose() {
|
|
|
+ this.checkList = []
|
|
|
+ this.exportShow = false
|
|
|
+ },
|
|
|
handleClose(){
|
|
|
this.correlationshow=false
|
|
|
},
|
|
@@ -493,4 +567,7 @@
|
|
|
.el-icon-connection{
|
|
|
color:#409eff;
|
|
|
}
|
|
|
+ .check {
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
</style>
|