|
@@ -2,13 +2,42 @@
|
|
<!--2019年5月30日 20:25:16 by jlx-->
|
|
<!--2019年5月30日 20:25:16 by jlx-->
|
|
<template>
|
|
<template>
|
|
<div>
|
|
<div>
|
|
- <!-- 弹出页面-审核通过 -->
|
|
|
|
- <BaseContentModalScrap
|
|
|
|
- v-model="dialogApproveFormVisible"
|
|
|
|
- :title="$t('common.opinion')"
|
|
|
|
- :isRules="false"
|
|
|
|
- @confirm="approve"
|
|
|
|
- />
|
|
|
|
|
|
+ <el-table :data="tableData" style="width: 100%">
|
|
|
|
+ <el-table-column type="index" />
|
|
|
|
+ <el-table-column prop="date" label="合同编号" width="80">
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="name" label="货名" width="80"> </el-table-column>
|
|
|
|
+ <el-table-column prop="address" label="品级"> </el-table-column>
|
|
|
|
+ <el-table-column prop="address" label="重量(吨)"> </el-table-column>
|
|
|
|
+ <el-table-column prop="address" label="合同单价(元)"> </el-table-column>
|
|
|
|
+ <el-table-column prop="address" label="包装方式"> </el-table-column>
|
|
|
|
+ <el-table-column prop="address" label="买方"> </el-table-column>
|
|
|
|
+ <el-table-column prop="address" label="卖方"> </el-table-column>
|
|
|
|
+ <el-table-column prop="address" label="已完成(吨)"> </el-table-column>
|
|
|
|
+ <el-table-column prop="address" label="状态"> </el-table-column>
|
|
|
|
+ <el-table-column prop="address" label="签订日期"> </el-table-column>
|
|
|
|
+ <el-table-column prop="address" label="已付款(元)"> </el-table-column>
|
|
|
|
+ <el-table-column prop="address" label="附件"> </el-table-column>
|
|
|
|
+ <el-table-column prop="address" label="操作" width="300">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-button
|
|
|
|
+ type="success"
|
|
|
|
+ size="small"
|
|
|
|
+ @click="handleExamine(scope.row)"
|
|
|
|
+ >查看</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ size="small"
|
|
|
|
+ @click="handleUpdate(scope.row)"
|
|
|
|
+ >编辑</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button type="danger" size="small" @click="handleDelete(scope.row)"
|
|
|
|
+ >删除</el-button
|
|
|
|
+ >
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
@@ -39,7 +68,7 @@ export default {
|
|
year: '',
|
|
year: '',
|
|
// 提交类型
|
|
// 提交类型
|
|
submitType: true,
|
|
submitType: true,
|
|
- tableData: [],
|
|
|
|
|
|
+ tableData: [{ date: 1111, name: 'qqqq', address: 'errrtt' }],
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
@@ -49,126 +78,9 @@ export default {
|
|
this.showType = this.isShow
|
|
this.showType = this.isShow
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- // 获得船舶对象
|
|
|
|
- getVesselData() {
|
|
|
|
- getVesselOne({
|
|
|
|
- vesselId: this.vesselId,
|
|
|
|
- })
|
|
|
|
- .toPromise()
|
|
|
|
- .then((succ) => {
|
|
|
|
- this.monetaryKey = succ.manageTypeKey
|
|
|
|
- if (!this.monetaryKey) {
|
|
|
|
- // this.monetaryKey = "1";
|
|
|
|
- this.showType = false
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- .catch((error) => {
|
|
|
|
- console.log(error)
|
|
|
|
- })
|
|
|
|
|
|
+ handleExamine(row) {
|
|
|
|
+ this.$router.push({ path: 'purchaseContractExamine' })
|
|
},
|
|
},
|
|
- // 行文字颜色控制
|
|
|
|
- tableRowClassName(row) {
|
|
|
|
- if (this.monetaryKey == 4) {
|
|
|
|
- if (row.row.remainingAmountAterPurchase < 0) {
|
|
|
|
- this.submitType = false
|
|
|
|
- return 'error-row'
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- if (row.row.localCurrency > row.row.remainBudgetMoney) {
|
|
|
|
- this.submitType = false
|
|
|
|
- return 'error-row'
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- // 显示弹出框前准备
|
|
|
|
- showDialog() {
|
|
|
|
- this.$emit('viewSpareMoneyGetDate')
|
|
|
|
- },
|
|
|
|
- // 数据处理
|
|
|
|
- viewSpareMoneyGetDate: async function (subData, showType) {
|
|
|
|
- if (this.monetaryKey == 4) {
|
|
|
|
- //备用金
|
|
|
|
-
|
|
|
|
- let originalCoin = 0
|
|
|
|
- let localCurrency = 0
|
|
|
|
- // 数据整合
|
|
|
|
- for (let i = 0; i < subData.length; i++) {
|
|
|
|
- originalCoin += subData[i].originalCoin
|
|
|
|
- localCurrency += subData[i].localCurrency
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- let moneydata = await this.getdate()
|
|
|
|
- this.tableDate = [
|
|
|
|
- {
|
|
|
|
- originalCoin: originalCoin,
|
|
|
|
- localCurrency: localCurrency,
|
|
|
|
- imprestBalance: 0,
|
|
|
|
- warningThreshold: 0,
|
|
|
|
- },
|
|
|
|
- ]
|
|
|
|
- if (moneydata) {
|
|
|
|
- this.tableDate[0].imprestBalance = parseFloat(
|
|
|
|
- this.tableDate[0].imprestBalance *
|
|
|
|
- (this.tableDate[0].warningThreshold / 100)
|
|
|
|
- ).toFixed(2)
|
|
|
|
-
|
|
|
|
- this.tableDate[0].warningThreshold = moneydata.warningThreshold
|
|
|
|
- }
|
|
|
|
- this.tableDate[0].remainingAmountAterPurchase = parseFloat(
|
|
|
|
- this.tableDate[0].imprestBalance - this.tableDate[0].localCurrency
|
|
|
|
- ).toFixed(2)
|
|
|
|
-
|
|
|
|
- if (this.tableDate[0].remainingAmountAterPurchase < 0) {
|
|
|
|
- this.submitType = false
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- //余额
|
|
|
|
- if (this.budgetYear) {
|
|
|
|
- // let myDate = new Date()
|
|
|
|
- // this.year = myDate.getFullYear()
|
|
|
|
- this.year = dayjs().format('YYYY')
|
|
|
|
- } else {
|
|
|
|
- this.year = this.budgetYear.substr(0, 4)
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- for (let i = 0; i < subData.length; i++) {
|
|
|
|
- let moneydata = await this.getdate(subData[i].subjectId)
|
|
|
|
- subData[i].budgetMoney = parseFloat(moneydata.budgetMoney).toFixed(2)
|
|
|
|
- subData[i].remainBudgetMoney = parseFloat(
|
|
|
|
- moneydata.remainBudgetMoney
|
|
|
|
- ).toFixed(2)
|
|
|
|
-
|
|
|
|
- subData[i].remainingAmountAterPurchase = parseFloat(
|
|
|
|
- subData[i].remainBudgetMoney - subData[i].localCurrency
|
|
|
|
- ).toFixed(2)
|
|
|
|
-
|
|
|
|
- if (
|
|
|
|
- subData[i].budgetMoney <= 0 ||
|
|
|
|
- subData[i].remainingAmountAterPurchase <= 0
|
|
|
|
- ) {
|
|
|
|
- subData[i].remainingAmount = 0
|
|
|
|
- } else {
|
|
|
|
- subData[i].remainingAmount =
|
|
|
|
- subData[i].remainingAmountAterPurchase / subData[i].budgetMoney
|
|
|
|
- }
|
|
|
|
- if (subData[i].remainingAmount <= 0) {
|
|
|
|
- subData[i].remainingAmount = 0
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (subData[i].localCurrency > subData[i].remainBudgetMoney) {
|
|
|
|
- this.submitType = false
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- this.tableDate = subData
|
|
|
|
- }
|
|
|
|
- if (showType != false) {
|
|
|
|
- this.dialogViewSpareMoney = true
|
|
|
|
- }
|
|
|
|
- return Promise.resolve(this.submitType)
|
|
|
|
- },
|
|
|
|
- // 数据获取
|
|
|
|
- getdate: async function (subId) {},
|
|
|
|
-
|
|
|
|
// 关闭 dialog时 处理文件url 初始化upload组件
|
|
// 关闭 dialog时 处理文件url 初始化upload组件
|
|
handleClose() {
|
|
handleClose() {
|
|
this.dialogViewSpareMoney = false
|
|
this.dialogViewSpareMoney = false
|