|
|
@@ -208,6 +208,10 @@
|
|
|
@changeParent="changeParent"
|
|
|
:productType="productType"
|
|
|
></product-list>
|
|
|
+ <product-list-main
|
|
|
+ ref="productListMainRef"
|
|
|
+ @changeParent="changeParentMain"
|
|
|
+ ></product-list-main>
|
|
|
<!--出库详情-->
|
|
|
<outbound-details-dialog
|
|
|
v-if="outboundDetailsDialogFlag"
|
|
|
@@ -228,17 +232,15 @@
|
|
|
import productList from '@/views/saleManage/saleOrder/invoice/components/product-list.vue';
|
|
|
import dictMixins from '@/mixins/dictMixins';
|
|
|
import { getWarehouseList } from '@/api/saleManage/saleorder';
|
|
|
-
|
|
|
- import store from '@/store';
|
|
|
import { copyObj } from '@/utils/util';
|
|
|
import { getFile } from '@/api/system/file';
|
|
|
import outboundDetailsDialog from './outboundDetailsDialog.vue';
|
|
|
- import { getOutInBySourceBizNoAPI } from '@/api/saleManage/returnGoods';
|
|
|
import fileMain from '@/components/addDoc/index.vue';
|
|
|
import taskinstanceDialog from '@/BIZComponents/procedure/taskinstanceDialog.vue';
|
|
|
import { lbjtList, orderSourceType } from '@/enum/dict.js';
|
|
|
import { parameterGetByCode } from '@/api/main/index.js';
|
|
|
import tabMixins from '@/mixins/tableColumnsMixin';
|
|
|
+ import productListMain from '@/BIZComponents/product-list.vue';
|
|
|
|
|
|
export default {
|
|
|
mixins: [dictMixins, tabMixins],
|
|
|
@@ -254,7 +256,8 @@
|
|
|
fileMain,
|
|
|
outboundDetailsDialog,
|
|
|
productList,
|
|
|
- taskinstanceDialog
|
|
|
+ taskinstanceDialog,
|
|
|
+ productListMain
|
|
|
},
|
|
|
data() {
|
|
|
const defaultForm = {
|
|
|
@@ -559,9 +562,14 @@
|
|
|
label: '质保期',
|
|
|
slot: 'guaranteePeriod',
|
|
|
formatter: (_row, _column, cellValue) => {
|
|
|
- return (
|
|
|
- (_row.guaranteePeriod || '') + _row.guaranteePeriodUnitName
|
|
|
- );
|
|
|
+ let name=''
|
|
|
+ if(_row.guaranteePeriod){
|
|
|
+ name+=_row.guaranteePeriod
|
|
|
+ }
|
|
|
+ if(_row.guaranteePeriodUnitName){
|
|
|
+ name+=_row.guaranteePeriodUnitName
|
|
|
+ }
|
|
|
+ return name||''
|
|
|
},
|
|
|
align: 'center'
|
|
|
},
|
|
|
@@ -840,27 +848,49 @@
|
|
|
this.changeNum(item.totalCount, index, item);
|
|
|
});
|
|
|
},
|
|
|
- // validateTotalCount(row) {
|
|
|
- // let totalCount = Number(row.totalCount);
|
|
|
- // if (row.receiveTotalCount) {
|
|
|
- // totalCount += Number(row.receiveTotalCount);
|
|
|
- // }
|
|
|
- // return (rule, value, callback) => {
|
|
|
- // if (isNaN(value) || Number(value) <= 0) {
|
|
|
- // // this.$message.error('请输入大于0的数');
|
|
|
- // callback(new Error('请输入大于0的数字'));
|
|
|
- // } else if (totalCount > row.orderTotalCount) {
|
|
|
- // if (this.isTotalCount == 1) {
|
|
|
- // callback(false);
|
|
|
- // } else {
|
|
|
- // callback();
|
|
|
- // }
|
|
|
- // this.$message.warning('收货数量大于采购总数量');
|
|
|
- // } else {
|
|
|
- // callback();
|
|
|
- // }
|
|
|
- // };
|
|
|
- // },
|
|
|
+ changeParentMain(obj) {
|
|
|
+ obj.forEach(async (item, index) => {
|
|
|
+ let row = JSON.parse(JSON.stringify(this.defaultForm));
|
|
|
+ row.key = this.form.datasource.length + 1;
|
|
|
+ let parasm = row;
|
|
|
+ this.$set(parasm, 'productId', item.id);
|
|
|
+ this.$set(parasm, 'categoryName', item.name);
|
|
|
+ this.$set(parasm, 'productCategoryId', item.categoryLevelId);
|
|
|
+ this.$set(parasm, 'productBrand', item.brandNum);
|
|
|
+ this.$set(parasm, 'productCategoryName', item.categoryLevelPath);
|
|
|
+ this.$set(parasm, 'productCode', item.code);
|
|
|
+ this.$set(parasm, 'productName', item.name);
|
|
|
+ this.$set(parasm, 'modelType', item.modelType);
|
|
|
+ this.$set(parasm, 'availableCountBase', item.availableCountBase);
|
|
|
+ this.$set(parasm, 'measuringUnit', item.measuringUnit);
|
|
|
+ this.$set(parasm, 'specification', item.specification);
|
|
|
+ this.$set(parasm, 'weightUnit', item.weightUnit);
|
|
|
+ this.$set(parasm, 'imgCode', item.imgCode);
|
|
|
+ this.$set(parasm, 'produceType', item.componentAttribute);
|
|
|
+ this.$set(parasm, 'approvalNumber', item.extField?.approvalNumber);
|
|
|
+ this.$set(parasm, 'singleWeight', item.netWeight);
|
|
|
+ this.$set(parasm, 'pricingWay', item.pricingWay || 1);
|
|
|
+ this.$set(parasm, 'singlePrice', 0);
|
|
|
+ this.$set(parasm, 'discountSinglePrice', 0);
|
|
|
+
|
|
|
+ this.$set(
|
|
|
+ parasm,
|
|
|
+ 'packingSpecification',
|
|
|
+ item.extField?.packingSpecification
|
|
|
+ );
|
|
|
+ this.$set(
|
|
|
+ parasm,
|
|
|
+ 'supplierMark',
|
|
|
+ this.form.datasource[0]?.supplierMark
|
|
|
+ );
|
|
|
+ // this.$set(parasm, 'batchNo', await getCode('1900101420390125570'));
|
|
|
+ if (item.purchaseOrigins?.length > 0) {
|
|
|
+ item.purchaseOrigins = item.purchaseOrigins.map((val) => val + '');
|
|
|
+ }
|
|
|
+ this.$set(parasm, 'provenance', item.purchaseOrigins || []);
|
|
|
+ this.form.datasource.push(row);
|
|
|
+ });
|
|
|
+ },
|
|
|
getTotalCount(row) {
|
|
|
let num = 0;
|
|
|
this.form.datasource
|
|
|
@@ -947,7 +977,11 @@
|
|
|
// 添加
|
|
|
handlAdd() {
|
|
|
if (!this.orderId) return this.$message.error('请先选择订单');
|
|
|
- this.$refs.productListRef.open(this.form.datasource);
|
|
|
+ if (orderSourceType.includes(this.sourceType)) {
|
|
|
+ this.$refs.productListMainRef.open('', -1);
|
|
|
+ } else {
|
|
|
+ this.$refs.productListRef.open(this.form.datasource);
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
validateForm(callback) {
|