|
|
@@ -135,6 +135,17 @@
|
|
|
v-hasPermi="['store:financeOrder:edit']"
|
|
|
>转未回款</el-button>
|
|
|
</el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="danger"
|
|
|
+ icon="el-icon-refresh-left"
|
|
|
+ size="mini"
|
|
|
+ :disabled="total === 0"
|
|
|
+ :loading="batchReturnAllLoading"
|
|
|
+ @click="handleBatchReturnUnpaidAll"
|
|
|
+ v-hasPermi="['store:financeOrder:edit']"
|
|
|
+ >一键转未回款</el-button>
|
|
|
+ </el-col>
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
</el-row>
|
|
|
|
|
|
@@ -310,7 +321,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { listFinanceOrder, editFinanceOrder, exportFinanceOrder, downloadFinanceImportTemplate, importFinanceOrder, previewImportFinanceOrder, batchReturnUnpaidFinanceOrder } from '@/api/store/financeOrder'
|
|
|
+import { listFinanceOrder, editFinanceOrder, exportFinanceOrder, downloadFinanceImportTemplate, importFinanceOrder, previewImportFinanceOrder, batchReturnUnpaidFinanceOrder, batchReturnUnpaidAllFinanceOrder } from '@/api/store/financeOrder'
|
|
|
import { treeselect } from '@/api/company/companyDept'
|
|
|
import Treeselect from '@riophae/vue-treeselect'
|
|
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
|
|
@@ -388,6 +399,7 @@ export default {
|
|
|
// 批量转未回款
|
|
|
selectedRows: [],
|
|
|
batchReturnLoading: false,
|
|
|
+ batchReturnAllLoading: false,
|
|
|
columnFilters: {
|
|
|
orderCode: [], externalCreateTime: [], returnTime: [], returnUser: [],
|
|
|
userName: [], deliveryName: [], deliverySn: [], totalPrice: [],
|
|
|
@@ -747,6 +759,38 @@ export default {
|
|
|
}).catch(() => {
|
|
|
this.batchReturnLoading = false
|
|
|
})
|
|
|
+ },
|
|
|
+ /** 一键转未回款:将当前筛选条件下的所有订单置为「未回款」状态 */
|
|
|
+ handleBatchReturnUnpaidAll() {
|
|
|
+ if (this.total === 0) {
|
|
|
+ this.msgError('当前筛选条件下没有订单')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const params = { ...this.queryParams }
|
|
|
+ delete params.pageNum
|
|
|
+ delete params.pageSize
|
|
|
+ if (params.totalPrice === 0) params.totalPrice = null
|
|
|
+ if (params.collectionPrice === 0) params.collectionPrice = null
|
|
|
+ if (params.returnStatus === '' || params.returnStatus === null || params.returnStatus === undefined) delete params.returnStatus
|
|
|
+ this.$confirm('确认将当前筛选条件下的所有订单置为「未回款」状态?\n(仅修改回款状态,不修改回款金额)', '警告', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ this.batchReturnAllLoading = true
|
|
|
+ return batchReturnUnpaidAllFinanceOrder(params)
|
|
|
+ }).then(response => {
|
|
|
+ this.batchReturnAllLoading = false
|
|
|
+ if (response.code === 200) {
|
|
|
+ this.msgSuccess(response.msg)
|
|
|
+ this.$refs.orderTable && this.$refs.orderTable.clearSelection()
|
|
|
+ this.getList()
|
|
|
+ } else {
|
|
|
+ this.msgError(response.msg)
|
|
|
+ }
|
|
|
+ }).catch(() => {
|
|
|
+ this.batchReturnAllLoading = false
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|