|
|
@@ -9,8 +9,12 @@
|
|
|
<BaseIndexButton ref="search" name="search"></BaseIndexButton>
|
|
|
<!-- 清空条件 -->
|
|
|
<BaseIndexButton ref="clear" name="clear"></BaseIndexButton>
|
|
|
+ <!-- 导出 -->
|
|
|
+ <BaseIndexButton ref="export" name="export" @click="exportList"></BaseIndexButton>
|
|
|
<!-- 开具发票 -->
|
|
|
- <BaseIndexButton ref="invoicing" name="invoicing"></BaseIndexButton>
|
|
|
+ <BaseIndexButton ref="invoicing" name="invoicing" :isMustChooseFlag="false"></BaseIndexButton>
|
|
|
+ <!-- 取消开票 -->
|
|
|
+ <BaseIndexButton ref="unInvoicing" name="unInvoicing" :isMustChooseFlag="false"></BaseIndexButton>
|
|
|
</template>
|
|
|
</BaseIndexButtonGroup>
|
|
|
|
|
|
@@ -21,11 +25,16 @@
|
|
|
<SearchCond ref="searchCond" v-model="searchCond"
|
|
|
@collapse-change="collapseChange" :setFlag="false"
|
|
|
:search-content="searchContent"></SearchCond>
|
|
|
+
|
|
|
+
|
|
|
+ <div style="color: #e00808;font-size: 20px;margin-right: 20px;text-align: right;">
|
|
|
+ <div>交易金额:{{ tradeAmount }}</div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
|
|
|
<!-- 表格部分 -->
|
|
|
<DkTable
|
|
|
- ref="checkTable"
|
|
|
+ ref="receiptTable"
|
|
|
:data="formData"
|
|
|
:height="tableHeight"
|
|
|
:page-flag="false"
|
|
|
@@ -33,7 +42,9 @@
|
|
|
:show-setting-flag="false"
|
|
|
show-footer
|
|
|
primaryKey="tradeId"
|
|
|
+ @select-change="selectChange"
|
|
|
:freeze="false">
|
|
|
+ <DkTableColumn field="receiptStatusName" :title="$t('invoiceStatue')"/>
|
|
|
<DkTableColumn field="tradeNo"></DkTableColumn>
|
|
|
<DkTableColumn field="cpName"></DkTableColumn>
|
|
|
<DkTableColumn field="tradeAmount" width="220"></DkTableColumn>
|
|
|
@@ -42,7 +53,6 @@
|
|
|
<DkTableColumn field="receiptDate" width="auto"></DkTableColumn>
|
|
|
<DkTableColumn field="tradeTypeName" :title="$t('tradeType')"></DkTableColumn>
|
|
|
<DkTableColumn field="tradeStatusName" :title="$t('tradeStatus')" width="auto"></DkTableColumn>
|
|
|
- <DkTableColumn field="receiptStatusName" :title="$t('invoiceStatue')"/>
|
|
|
<DkTableColumn field="receiptTypeName" :title="$t('invoiceType')"></DkTableColumn>
|
|
|
<DkTableColumn field="taxNo" width="auto"></DkTableColumn>
|
|
|
<DkTableColumn field="cpEmail" width="auto"></DkTableColumn>
|
|
|
@@ -56,6 +66,7 @@
|
|
|
|
|
|
<script>
|
|
|
import {indexMixin} from "@/mixins";
|
|
|
+import qs from 'qs'
|
|
|
|
|
|
export default {
|
|
|
name: "receipt",
|
|
|
@@ -63,6 +74,7 @@ export default {
|
|
|
data() {
|
|
|
let self = this
|
|
|
return {
|
|
|
+ tradeAmount:0,
|
|
|
// 查询条件
|
|
|
searchContent: [
|
|
|
{
|
|
|
@@ -85,21 +97,101 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
/**
|
|
|
+ * @desc : 导出
|
|
|
+ * @author : 常皓宁
|
|
|
+ * @date : 2024/8/13 13:43
|
|
|
+ */
|
|
|
+ exportList () {
|
|
|
+ let param = Object.assign({}, {...this.searchList})
|
|
|
+ window.location.href = this.$config.serviceUrl + '/mdm-server/mst/cpTrade/export_list?'+qs.stringify(param)
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @desc : 勾选事件
|
|
|
+ * @author : 常皓宁
|
|
|
+ * @date : 2024/8/14 11:29
|
|
|
+ */
|
|
|
+ selectChange(row){
|
|
|
+ let amount = Number(this.tradeAmount)
|
|
|
+ let tradeAmount = row.row.tradeAmount.toFixed(2)
|
|
|
+ if(row.checked){
|
|
|
+ amount += Number(tradeAmount)
|
|
|
+ }else {
|
|
|
+ amount -= Number(tradeAmount)
|
|
|
+ }
|
|
|
+ this.tradeAmount = (Number(amount)).toFixed(2)
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @desc : 校验
|
|
|
+ * @author : 常皓宁
|
|
|
+ * @date : 2024/8/13 16:35
|
|
|
+ */
|
|
|
+ openValidData(btnName, rows) {
|
|
|
+ let changeTable = {}
|
|
|
+ changeTable = this.$refs['receiptTable'].getCheckRows();
|
|
|
+ if(changeTable.size()<=0){
|
|
|
+ this.$Message.warning(this.$t('W_007', {'param': this.$t('W_013')}));
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if(btnName === 'invoicing'){
|
|
|
+ for(let it of changeTable){
|
|
|
+ if(it.receiptStatus != '开票状态-开票中'){
|
|
|
+ this.$Message.warning(this.$t('W_007', {'param': this.$t('选择数据中存在未开票或已开票数据')}));
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(btnName === 'unInvoicing'){
|
|
|
+ for(let it of changeTable){
|
|
|
+ if(it.receiptStatus != '开票状态-已开票'){
|
|
|
+ this.$Message.warning(this.$t('W_007', {'param': this.$t('选择数据中存在未开票或开票中数据')}));
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
* @desc : 开具发票
|
|
|
* @author : 常皓宁
|
|
|
* @date : 2024/4/17 13:25
|
|
|
*/
|
|
|
invoicing(){
|
|
|
- let changeTable = this.$refs['checkTable'].getCheckRows();
|
|
|
- console.log('changeTable',changeTable)
|
|
|
- this.$IBMessage({content: this.$t('Q_002', {'param': this.$v('入库成本核对')}), title: this.$t('systemQuestion')},
|
|
|
+ let changeTable = this.$refs['receiptTable'].getCheckRows();
|
|
|
+ this.$IBMessage({content: this.$t('Q_002', {'param': this.$v('开具发票')}), title: this.$t('systemQuestion')},
|
|
|
+ {
|
|
|
+ ok: () => {
|
|
|
+ this.loading = true
|
|
|
+ let params = changeTable
|
|
|
+ this.excute(this.$service.cpTradeService, this.$service.cpTradeService.invoicing, params, false).then(res => {
|
|
|
+ if (res.code === this.$config.SUCCESS_CODE) {
|
|
|
+ this.$Message.success(this.$t('I_001', {'param': this.$t('开具发票')}))
|
|
|
+ this.searchData()
|
|
|
+ } else {
|
|
|
+ this.$Message.warning(res.message)
|
|
|
+ }
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 取消开票
|
|
|
+ * @author : 常皓宁
|
|
|
+ * @date : 2024/8/13 16:12
|
|
|
+ */
|
|
|
+ unInvoicing(){
|
|
|
+ let changeTable = this.$refs['receiptTable'].getCheckRows();
|
|
|
+ this.$IBMessage({content: this.$t('Q_002', {'param': this.$v('取消开票')}), title: this.$t('systemQuestion')},
|
|
|
{
|
|
|
ok: () => {
|
|
|
this.loading = true
|
|
|
let params = changeTable
|
|
|
- this.excute(this.$service.costCheckService, this.$service.costCheckService.costCheckOk, params, false).then(res => {
|
|
|
+ this.excute(this.$service.cpTradeService, this.$service.cpTradeService.unInvoicing, params, false).then(res => {
|
|
|
if (res.code === this.$config.SUCCESS_CODE) {
|
|
|
- this.$Message.success(this.$t('I_001', {'param': this.$t('入库成本核对')}))
|
|
|
+ this.$Message.success(this.$t('I_001', {'param': this.$t('取消开票')}))
|
|
|
this.searchData()
|
|
|
} else {
|
|
|
this.$Message.warning(res.message)
|
|
|
@@ -120,13 +212,7 @@ export default {
|
|
|
|
|
|
this.excute(this.$service.cpTradeService, this.$service.cpTradeService.selectReceipt, params).then(res =>{
|
|
|
if (res.code === this.$config.SUCCESS_CODE) {
|
|
|
- let data = []
|
|
|
- res.data.list.forEach(it =>{
|
|
|
- it.oldCostPrice = it.costPrice
|
|
|
- it.oldCostAmt = it.costAmt
|
|
|
- data.push(it)
|
|
|
- })
|
|
|
- this.formData = data
|
|
|
+ this.formData = res.data.list
|
|
|
}else {
|
|
|
this.$Message.warning(res.message)
|
|
|
}
|