|
|
@@ -84,6 +84,11 @@
|
|
|
valueKey="taxRate"
|
|
|
@success="setAllTaxRateChange"
|
|
|
/>
|
|
|
+ <setAllCountPrice
|
|
|
+ :disabled="tableBusy || !selection.length"
|
|
|
+ :show-price="quoteType !== 2"
|
|
|
+ @success="setAllCountPriceChange"
|
|
|
+ />
|
|
|
</div>
|
|
|
<div class="pricebox">
|
|
|
<span class="amount" v-if="showSummary"
|
|
|
@@ -1084,6 +1089,8 @@
|
|
|
import { copyObj } from '@/utils/util';
|
|
|
import selectStockLedgerDialog from '@/BIZComponents/selectStockLedger/selectStockLedgerDialog.vue'; //库存台账
|
|
|
import setAllValue from '@/BIZComponents/setAllValue.vue'; //批量修改
|
|
|
+ import setAllCountPrice from '@/BIZComponents/setAllCountPrice.vue'; //批量修改数量与单价
|
|
|
+ import { IS_DEV } from '@/config/setting'; //是否开发环境
|
|
|
|
|
|
import tabMixins from '@/mixins/tableColumnsMixin';
|
|
|
import commodityPriceListDialog from '@/views/commodityManagement/commodityPriceList/components/commodityPriceListDialog.vue';
|
|
|
@@ -1107,7 +1114,8 @@
|
|
|
timeDialog,
|
|
|
selectStockLedgerDialog,
|
|
|
commodityPriceListDialog,
|
|
|
- setAllValue
|
|
|
+ setAllValue,
|
|
|
+ setAllCountPrice
|
|
|
},
|
|
|
props: {
|
|
|
pageName: {
|
|
|
@@ -2450,6 +2458,48 @@
|
|
|
this.setDeliveryDays(this.form.datasource[i], i, 'guaranteePeriod');
|
|
|
});
|
|
|
},
|
|
|
+ // 批量设置数量与单价:只作用于勾选的行,仅开发环境可用
|
|
|
+ setAllCountPriceChange({ count, singlePrice }) {
|
|
|
+ if (!IS_DEV || this.tableBusy) return;
|
|
|
+ const indexS = this.getSelectedIndexes();
|
|
|
+ if (!indexS.length) {
|
|
|
+ this.$message.warning('请先勾选需要设置的行');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ indexS.forEach((i) => {
|
|
|
+ const row = this.form.datasource[i];
|
|
|
+ if (!row) return;
|
|
|
+ if (count !== undefined && count !== null) {
|
|
|
+ this.$set(row, this.countObj.countKey, count);
|
|
|
+ }
|
|
|
+ if (singlePrice !== undefined && singlePrice !== null) {
|
|
|
+ this.$set(row, 'singlePrice', singlePrice);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (this.quoteType === 2) {
|
|
|
+ // 生产加工类型:合计按含税小计 × 数量计算,不走普通计价逻辑
|
|
|
+ indexS.forEach((i) => {
|
|
|
+ const row = this.form.datasource[i];
|
|
|
+ if (row) {
|
|
|
+ this.calculateIncludingTaxPrice(row, i);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ // 只重算勾选的行:计量数量、总重、合计、折让等,未勾选的行保持原样
|
|
|
+ this.recalculateTableOnce(indexS);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 勾选行在数据源中的下标:按 row-key 匹配,不依赖 key 与下标一一对应
|
|
|
+ getSelectedIndexes() {
|
|
|
+ const keys = new Set(this.selection.map((item) => item.key));
|
|
|
+ const indexS = [];
|
|
|
+ this.form.datasource.forEach((row, index) => {
|
|
|
+ if (keys.has(row.key)) {
|
|
|
+ indexS.push(index);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return indexS;
|
|
|
+ },
|
|
|
//获取折让单价
|
|
|
getDiscountSinglePrice(row) {
|
|
|
let num =
|