|
@@ -251,7 +251,7 @@
|
|
|
type="link"
|
|
|
class="button-warning"
|
|
|
v-if="record.billStatus=='FINISH'"
|
|
|
- @click="handleToExpense(record)"
|
|
|
+ @click="handleExpense(record)"
|
|
|
>转费用报销单</a-button>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -295,7 +295,7 @@ import commonModal from '@/views/common/commonModal.vue'
|
|
|
import chooseCustomModal from './chooseCustomModal.vue'
|
|
|
import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
|
|
|
import reportModal from '@/views/common/reportModal.vue'
|
|
|
-import { salesList, salesDel,salesCancle, salesCount } from '@/api/salesNew'
|
|
|
+import { salesList, salesDel,salesCancle, salesCount, queryCreateBySalesBillSn, expenseAccountSave } from '@/api/salesNew'
|
|
|
import { hdExportExcel } from '@/libs/exportExcel'
|
|
|
import chooseWarehouse from '@/views/common/chooseWarehouse'
|
|
|
import { findBySalesBillSn, dispatchBatchPrintStatus, queryBySalesBillSn } from '@/api/dispatch'
|
|
@@ -509,37 +509,49 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
// 转费用单
|
|
|
- handleToExpense(){
|
|
|
+ async handleExpense(row){
|
|
|
const _this = this
|
|
|
- this.$confirm({
|
|
|
- title: '转费用报销单?',
|
|
|
- centered: true,
|
|
|
- class:'confirm-center',
|
|
|
- content: <div>
|
|
|
- <div style="padding:10px 0;text-align:center;">请选择费用报销单类型</div>
|
|
|
- <div style="padding:0 0 10px 0;text-align:center;">
|
|
|
- <aRadioGroup onChange={_this.changeDaOpt}>
|
|
|
- <aRadio style="height: '30px';lineHeight: '30px';padding:5px 0;" value="1">
|
|
|
- 采购额结余
|
|
|
- </aRadio>
|
|
|
- <aRadio style="height: '30px';lineHeight: '30px';padding:5px 0;" value="2">
|
|
|
- 采购额超出
|
|
|
- </aRadio>
|
|
|
- </aRadioGroup>
|
|
|
- </div>
|
|
|
- </div>,
|
|
|
- onOk() {
|
|
|
- if(_this.expenseOption){
|
|
|
+ const hasExpense = await queryCreateBySalesBillSn({salesBillSn: row.salesBillSn}).then(res => res.data||[])
|
|
|
+ console.log(hasExpense)
|
|
|
+ // 有2个以上采购额时
|
|
|
+ if(hasExpense && hasExpense.length > 1){
|
|
|
+ _this.$confirm({
|
|
|
+ title: '转费用报销单?',
|
|
|
+ centered: true,
|
|
|
+ class:'confirm-center',
|
|
|
+ content: <div>
|
|
|
+ <div style="padding:10px 0;text-align:center;">请选择费用报销单类型</div>
|
|
|
+ <div style="padding:0 0 10px 0;text-align:center;">
|
|
|
+ <aRadioGroup onChange={_this.changeDaOpt}>
|
|
|
+ <aRadio style="height: '30px';lineHeight: '30px';padding:5px 0;" value="1">
|
|
|
+ 采购额结余
|
|
|
+ </aRadio>
|
|
|
+ <aRadio style="height: '30px';lineHeight: '30px';padding:5px 0;" value="2">
|
|
|
+ 采购额超出
|
|
|
+ </aRadio>
|
|
|
+ </aRadioGroup>
|
|
|
+ </div>
|
|
|
+ </div>,
|
|
|
+ onOk() {
|
|
|
+ if(_this.expenseOption){
|
|
|
+ _this.expenseOption = null
|
|
|
+ _this.expenseSave(hasExpense,_this.expenseOption)
|
|
|
+ }else{
|
|
|
+ _this.$message.info("请选择费用报销单类型!")
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onCancel() {
|
|
|
_this.expenseOption = null
|
|
|
- }else{
|
|
|
- _this.$message.info("请选择费用报销单类型!")
|
|
|
- return true
|
|
|
- }
|
|
|
- },
|
|
|
- onCancel() {
|
|
|
- _this.expenseOption = null
|
|
|
- },
|
|
|
- });
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ // 直接转费用单
|
|
|
+ _this.expenseSave(hasExpense,_this.expenseOption)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 转费用单
|
|
|
+ expenseSave(data){
|
|
|
+
|
|
|
},
|
|
|
changeDaOpt(e){
|
|
|
this.expenseOption = e.target.value
|