|
|
@@ -143,411 +143,439 @@
|
|
|
</el-form>
|
|
|
</template>
|
|
|
<script>
|
|
|
- import { numberReg } from 'ele-admin';
|
|
|
- import dictMixins from '@/mixins/dictMixins';
|
|
|
- import productList from '@/views/bpm/handleTask/components/saleOrder/invoice/product-list.vue';
|
|
|
+import {numberReg} from 'ele-admin';
|
|
|
+import dictMixins from '@/mixins/dictMixins';
|
|
|
+import productList from '@/views/bpm/handleTask/components/saleOrder/invoice/product-list.vue';
|
|
|
|
|
|
- import { getWarehouseOutStock } from '@/api/bpm/components/saleManage/saleorder';
|
|
|
- export default {
|
|
|
- mixins: [dictMixins],
|
|
|
- props: {
|
|
|
- receiveId: String
|
|
|
- },
|
|
|
- components: {
|
|
|
- productList
|
|
|
- },
|
|
|
- data() {
|
|
|
- const defaultForm = {
|
|
|
- key: null,
|
|
|
- endTime: '',
|
|
|
- isFirst: 0,
|
|
|
- name: '',
|
|
|
- startTime: '',
|
|
|
- workHour: '',
|
|
|
- technicalDrawings: []
|
|
|
- };
|
|
|
- return {
|
|
|
- discountTotalPrice: 0.0,
|
|
|
- allPrice: 0.0,
|
|
|
- numberReg,
|
|
|
- defaultForm,
|
|
|
- // warehouseList: [],
|
|
|
- form: {
|
|
|
- datasource: []
|
|
|
- },
|
|
|
- rules: {},
|
|
|
+import {getWarehouseOutStock} from '@/api/bpm/components/saleManage/saleorder';
|
|
|
+
|
|
|
+export default {
|
|
|
+ mixins: [dictMixins],
|
|
|
+ props: {
|
|
|
+ receiveId: String,
|
|
|
+ payAmount: [Number,String]
|
|
|
+ },
|
|
|
+ components: {
|
|
|
+ productList
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ const defaultForm = {
|
|
|
+ key: null,
|
|
|
+ endTime: '',
|
|
|
+ isFirst: 0,
|
|
|
+ name: '',
|
|
|
+ startTime: '',
|
|
|
+ workHour: '',
|
|
|
+ technicalDrawings: []
|
|
|
+ };
|
|
|
+ return {
|
|
|
+ discountTotalPrice: 0.0,
|
|
|
+ allPrice: 0.0,
|
|
|
+ numberReg,
|
|
|
+ defaultForm,
|
|
|
+ // warehouseList: [],
|
|
|
+ form: {
|
|
|
+ datasource: []
|
|
|
+ },
|
|
|
+ rules: {},
|
|
|
|
|
|
- columns: [
|
|
|
- {
|
|
|
- width: 45,
|
|
|
- type: 'index',
|
|
|
- columnKey: 'index',
|
|
|
- align: 'center',
|
|
|
- fixed: 'left'
|
|
|
- },
|
|
|
- {
|
|
|
- width: 200,
|
|
|
- prop: 'productName',
|
|
|
- label: '名称',
|
|
|
- slot: 'productName'
|
|
|
- },
|
|
|
- {
|
|
|
- width: 120,
|
|
|
- prop: 'productCode',
|
|
|
- label: '编码',
|
|
|
- slot: 'productCode'
|
|
|
- },
|
|
|
- {
|
|
|
- width: 200,
|
|
|
- prop: 'productCategoryName',
|
|
|
- label: '类型',
|
|
|
- slot: 'productCategoryName'
|
|
|
- },
|
|
|
- {
|
|
|
- width: 160,
|
|
|
- prop: 'productBrand',
|
|
|
- label: '牌号',
|
|
|
- slot: 'productBrand'
|
|
|
- },
|
|
|
- {
|
|
|
- width: 120,
|
|
|
- prop: 'modelType',
|
|
|
- label: '型号',
|
|
|
- slot: 'modelType'
|
|
|
- },
|
|
|
- {
|
|
|
- width: 120,
|
|
|
- prop: 'specification',
|
|
|
- label: '规格',
|
|
|
- slot: 'specification'
|
|
|
- },
|
|
|
- {
|
|
|
- width: 200,
|
|
|
- prop: 'warehouseName',
|
|
|
- label: '仓库名称',
|
|
|
- slot: 'warehouseName'
|
|
|
- },
|
|
|
- {
|
|
|
- width: 100,
|
|
|
- prop: 'warehouseNum',
|
|
|
- label: '库存',
|
|
|
- slot: 'warehouseNum'
|
|
|
- },
|
|
|
- {
|
|
|
- width: 120,
|
|
|
- prop: 'receiveTotalCount',
|
|
|
- label: '收货数量',
|
|
|
- slot: 'receiveTotalCount'
|
|
|
- },
|
|
|
- {
|
|
|
- width: 120,
|
|
|
- prop: 'totalCount',
|
|
|
- label: '退货数量',
|
|
|
- slot: 'totalCount',
|
|
|
- headerSlot: 'headerTotalCount'
|
|
|
- },
|
|
|
- {
|
|
|
- width: 80,
|
|
|
- prop: 'measuringUnit',
|
|
|
- label: '计量单位',
|
|
|
- slot: 'measuringUnit'
|
|
|
- },
|
|
|
- {
|
|
|
- width: 160,
|
|
|
- prop: 'singlePrice',
|
|
|
- label: '单价',
|
|
|
- slot: 'singlePrice'
|
|
|
- },
|
|
|
- {
|
|
|
- width: 120,
|
|
|
- prop: 'totalPrice',
|
|
|
- label: '合计',
|
|
|
- slot: 'totalPrice'
|
|
|
- },
|
|
|
- {
|
|
|
- width: 200,
|
|
|
- prop: 'returnReason',
|
|
|
- label: '退货原因',
|
|
|
- slot: 'returnReason'
|
|
|
- },
|
|
|
- // {
|
|
|
- // width: 140,
|
|
|
- // prop: 'returnType',
|
|
|
- // label: '退货类型',
|
|
|
- // slot: 'returnType'
|
|
|
- // },
|
|
|
+ columns: [
|
|
|
+ {
|
|
|
+ width: 45,
|
|
|
+ type: 'index',
|
|
|
+ columnKey: 'index',
|
|
|
+ align: 'center',
|
|
|
+ fixed: 'left'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 200,
|
|
|
+ prop: 'productName',
|
|
|
+ label: '名称',
|
|
|
+ slot: 'productName'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 120,
|
|
|
+ prop: 'productCode',
|
|
|
+ label: '编码',
|
|
|
+ slot: 'productCode'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 200,
|
|
|
+ prop: 'productCategoryName',
|
|
|
+ label: '类型',
|
|
|
+ slot: 'productCategoryName'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 160,
|
|
|
+ prop: 'productBrand',
|
|
|
+ label: '牌号',
|
|
|
+ slot: 'productBrand'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 120,
|
|
|
+ prop: 'modelType',
|
|
|
+ label: '型号',
|
|
|
+ slot: 'modelType'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 120,
|
|
|
+ prop: 'specification',
|
|
|
+ label: '规格',
|
|
|
+ slot: 'specification'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 200,
|
|
|
+ prop: 'warehouseName',
|
|
|
+ label: '仓库名称',
|
|
|
+ slot: 'warehouseName'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 100,
|
|
|
+ prop: 'warehouseNum',
|
|
|
+ label: '库存',
|
|
|
+ slot: 'warehouseNum'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 120,
|
|
|
+ prop: 'receiveTotalCount',
|
|
|
+ label: '收货数量',
|
|
|
+ slot: 'receiveTotalCount'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 120,
|
|
|
+ prop: 'totalCount',
|
|
|
+ label: '退货数量',
|
|
|
+ slot: 'totalCount',
|
|
|
+ headerSlot: 'headerTotalCount'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 80,
|
|
|
+ prop: 'measuringUnit',
|
|
|
+ label: '计量单位',
|
|
|
+ slot: 'measuringUnit'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 160,
|
|
|
+ prop: 'singlePrice',
|
|
|
+ label: '单价',
|
|
|
+ slot: 'singlePrice'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 160,
|
|
|
+ prop: 'discountSinglePrice',
|
|
|
+ label: '折让单价',
|
|
|
+ slot: 'discountSinglePrice'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 120,
|
|
|
+ prop: 'totalPrice',
|
|
|
+ label: '合计',
|
|
|
+ slot: 'totalPrice'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 160,
|
|
|
+ prop: 'discountTotalPrice',
|
|
|
+ label: '折让合计',
|
|
|
+ slot: 'discountTotalPrice'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 200,
|
|
|
+ prop: 'returnReason',
|
|
|
+ label: '退货原因',
|
|
|
+ slot: 'returnReason'
|
|
|
+ },
|
|
|
+ // {
|
|
|
+ // width: 140,
|
|
|
+ // prop: 'returnType',
|
|
|
+ // label: '退货类型',
|
|
|
+ // slot: 'returnType'
|
|
|
+ // },
|
|
|
|
|
|
- // {
|
|
|
- // width: 80,
|
|
|
- // prop: 'deliveryDays',
|
|
|
- // label: '交期(天)',
|
|
|
- // slot: 'deliveryDays'
|
|
|
- // },
|
|
|
- // {
|
|
|
- // width: 200,
|
|
|
- // prop: 'guaranteePeriod',
|
|
|
- // label: '质保期',
|
|
|
- // slot: 'guaranteePeriod'
|
|
|
- // },
|
|
|
+ // {
|
|
|
+ // width: 80,
|
|
|
+ // prop: 'deliveryDays',
|
|
|
+ // label: '交期(天)',
|
|
|
+ // slot: 'deliveryDays'
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // width: 200,
|
|
|
+ // prop: 'guaranteePeriod',
|
|
|
+ // label: '质保期',
|
|
|
+ // slot: 'guaranteePeriod'
|
|
|
+ // },
|
|
|
|
|
|
- // {
|
|
|
- // width: 130,
|
|
|
- // prop: 'technicalAnswerName',
|
|
|
- // label: '技术答疑人',
|
|
|
- // slot: 'technicalAnswerName'
|
|
|
- // },
|
|
|
- // {
|
|
|
- // width: 220,
|
|
|
- // prop: 'technicalParams',
|
|
|
- // label: '技术参数',
|
|
|
- // slot: 'technicalParams'
|
|
|
- // },
|
|
|
- // {
|
|
|
- // width: 240,
|
|
|
- // prop: 'technicalDrawings',
|
|
|
- // label: '技术图纸',
|
|
|
- // slot: 'technicalDrawings'
|
|
|
- // },
|
|
|
- {
|
|
|
- width: 220,
|
|
|
- prop: 'remark',
|
|
|
- label: '备注',
|
|
|
- slot: 'remark'
|
|
|
- },
|
|
|
- {
|
|
|
- columnKey: 'action',
|
|
|
- label: '操作',
|
|
|
- width: 120,
|
|
|
- align: 'center',
|
|
|
- resizable: false,
|
|
|
- slot: 'action',
|
|
|
- fixed: 'right',
|
|
|
- showOverflowTooltip: true
|
|
|
- }
|
|
|
- ]
|
|
|
- };
|
|
|
+ // {
|
|
|
+ // width: 130,
|
|
|
+ // prop: 'technicalAnswerName',
|
|
|
+ // label: '技术答疑人',
|
|
|
+ // slot: 'technicalAnswerName'
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // width: 220,
|
|
|
+ // prop: 'technicalParams',
|
|
|
+ // label: '技术参数',
|
|
|
+ // slot: 'technicalParams'
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // width: 240,
|
|
|
+ // prop: 'technicalDrawings',
|
|
|
+ // label: '技术图纸',
|
|
|
+ // slot: 'technicalDrawings'
|
|
|
+ // },
|
|
|
+ {
|
|
|
+ width: 220,
|
|
|
+ prop: 'remark',
|
|
|
+ label: '备注',
|
|
|
+ slot: 'remark'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnKey: 'action',
|
|
|
+ label: '操作',
|
|
|
+ width: 120,
|
|
|
+ align: 'center',
|
|
|
+ resizable: false,
|
|
|
+ slot: 'action',
|
|
|
+ fixed: 'right',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ contractId() {
|
|
|
+ return this.$store.state.order.contractId;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ // getWarehouseList().then((res) => {
|
|
|
+ // this.warehouseList = res;
|
|
|
+ // });
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ //修改数量更新合计
|
|
|
+ changeNum(val, index) {
|
|
|
+ this.$set(
|
|
|
+ this.form.datasource[index],
|
|
|
+ 'totalPrice',
|
|
|
+ (Number(this.form.datasource[index].singlePrice) * val).toFixed(2)
|
|
|
+ );
|
|
|
+ this.$set(
|
|
|
+ this.form.datasource[index],
|
|
|
+ 'discountTotalPrice',
|
|
|
+ (Number(this.form.datasource[index].discountSinglePrice) * val).toFixed(2)
|
|
|
+ );
|
|
|
+ this.$store.commit('returnGoods/setIsDefaultPayableAmount', false);
|
|
|
+ this.gettotalAmount();
|
|
|
},
|
|
|
- computed: {
|
|
|
- contractId() {
|
|
|
- return this.$store.state.order.contractId;
|
|
|
+ //获取订单总金额
|
|
|
+ gettotalAmount() {
|
|
|
+ let productData = this.form.datasource;
|
|
|
+ if (productData.length) {
|
|
|
+ let sum = productData
|
|
|
+ .reduce((sum, item) => {
|
|
|
+ return sum + Number(item.totalPrice);
|
|
|
+ }, 0)
|
|
|
+ .toFixed(2);
|
|
|
+ this.$emit('update:payAmount', productData
|
|
|
+ .reduce((sum, item) => {
|
|
|
+ return sum + Number(item.discountTotalPrice);
|
|
|
+ }, 0).toFixed(2))
|
|
|
+ this.$store.commit('returnGoods/setAllcountAmount', sum);
|
|
|
+ } else {
|
|
|
+ this.$store.commit('returnGoods/setAllcountAmount', 0);
|
|
|
}
|
|
|
},
|
|
|
- created() {
|
|
|
- // getWarehouseList().then((res) => {
|
|
|
- // this.warehouseList = res;
|
|
|
- // });
|
|
|
- },
|
|
|
- methods: {
|
|
|
- //修改数量更新合计
|
|
|
- changeNum(val, index) {
|
|
|
- this.$set(
|
|
|
- this.form.datasource[index],
|
|
|
- 'totalPrice',
|
|
|
- (Number(this.form.datasource[index].singlePrice) * val).toFixed(2)
|
|
|
- );
|
|
|
- this.$store.commit('returnGoods/setIsDefaultPayableAmount', false);
|
|
|
- this.gettotalAmount();
|
|
|
- },
|
|
|
- //获取订单总金额
|
|
|
- gettotalAmount() {
|
|
|
- let productData = this.form.datasource;
|
|
|
- if (productData.length) {
|
|
|
- let sum = productData
|
|
|
- .reduce((sum, item) => {
|
|
|
- return sum + Number(item.totalPrice);
|
|
|
- }, 0)
|
|
|
- .toFixed(2);
|
|
|
- this.$store.commit('returnGoods/setAllcountAmount', sum);
|
|
|
- } else {
|
|
|
- this.$store.commit('returnGoods/setAllcountAmount', 0);
|
|
|
- }
|
|
|
- },
|
|
|
- //选择产品回调
|
|
|
- async changeParent(obj, idx) {
|
|
|
- obj.receiveTotalCount = obj.totalCount;
|
|
|
- obj.receiveProductId = obj.id;
|
|
|
- obj.id = '';
|
|
|
-
|
|
|
- if (obj.warehouseId) {
|
|
|
- obj['warehouseNum'] = await getWarehouseOutStock({
|
|
|
- warehouseId: obj.warehouseId,
|
|
|
- code: obj.productCode
|
|
|
- });
|
|
|
- }
|
|
|
- this.$set(this.form.datasource, this.form.datasource.length, obj);
|
|
|
- },
|
|
|
+ //选择产品回调
|
|
|
+ async changeParent(obj, idx) {
|
|
|
+ obj.receiveTotalCount = obj.totalCount;
|
|
|
+ obj.receiveProductId = obj.id;
|
|
|
+ obj.id = '';
|
|
|
|
|
|
- // async warehouseChange(index, row) {
|
|
|
- // let warehouseIds =
|
|
|
- // this.form.datasource
|
|
|
- // .filter(
|
|
|
- // (item, i) => row.productCode == item.productCode && index != i
|
|
|
- // )
|
|
|
- // .map((item) => item.warehouseId) || [];
|
|
|
- // const data = this.warehouseList.find(
|
|
|
- // (item) => item.id == row.warehouseId
|
|
|
- // );
|
|
|
- // if (warehouseIds.length > 0 && warehouseIds.includes(row.warehouseId)) {
|
|
|
- // row.warehouseId = '';
|
|
|
- // return this.$message.error('同一个产品不能选择相同的仓库');
|
|
|
- // }
|
|
|
+ if (obj.warehouseId) {
|
|
|
+ obj['warehouseNum'] = await getWarehouseOutStock({
|
|
|
+ warehouseId: obj.warehouseId,
|
|
|
+ code: obj.productCode
|
|
|
+ });
|
|
|
+ }
|
|
|
+ this.$set(this.form.datasource, this.form.datasource.length, obj);
|
|
|
+ },
|
|
|
|
|
|
- // this.$set(this.form.datasource[index], 'warehouseName', data.name);
|
|
|
- // this.$set(this.form.datasource[index], 'warehouseCode', data.code);
|
|
|
- // const warehouseOutStock = await getWarehouseOutStock({
|
|
|
- // warehouseId: data.id,
|
|
|
- // code: row.productCode
|
|
|
- // });
|
|
|
- // this.$set(
|
|
|
- // this.form.datasource[index],
|
|
|
- // 'warehouseNum',
|
|
|
- // warehouseOutStock
|
|
|
- // );
|
|
|
- // },
|
|
|
+ // async warehouseChange(index, row) {
|
|
|
+ // let warehouseIds =
|
|
|
+ // this.form.datasource
|
|
|
+ // .filter(
|
|
|
+ // (item, i) => row.productCode == item.productCode && index != i
|
|
|
+ // )
|
|
|
+ // .map((item) => item.warehouseId) || [];
|
|
|
+ // const data = this.warehouseList.find(
|
|
|
+ // (item) => item.id == row.warehouseId
|
|
|
+ // );
|
|
|
+ // if (warehouseIds.length > 0 && warehouseIds.includes(row.warehouseId)) {
|
|
|
+ // row.warehouseId = '';
|
|
|
+ // return this.$message.error('同一个产品不能选择相同的仓库');
|
|
|
+ // }
|
|
|
|
|
|
- validateTotalCount(row) {
|
|
|
- return (rule, value, callback) => {
|
|
|
- if (isNaN(value) || Number(value) <= 0) {
|
|
|
- this.$message.error('请输入大于0的数');
|
|
|
- callback(new Error('请输入大于0的数字'));
|
|
|
- } else if (Number(value) > row.receiveTotalCount) {
|
|
|
- this.$message.error('退货数量不能大于收货数量');
|
|
|
- callback(new Error('退货数量不能大于收货数量'));
|
|
|
- } else {
|
|
|
- callback();
|
|
|
- }
|
|
|
- };
|
|
|
- },
|
|
|
- // else if (this.getTotalCount(row)> row.warehouseNum) {
|
|
|
- // this.$message.error('退货数量不能大于库存');
|
|
|
- // callback(new Error('退货数量不能大于库存'));
|
|
|
- // }
|
|
|
- getTotalCount(row) {
|
|
|
- let num = 0;
|
|
|
- this.form.datasource
|
|
|
- .filter((item) => item.warehouseId == row.warehouseId)
|
|
|
- .forEach((item) => {
|
|
|
- num += Number(item.totalCount);
|
|
|
- });
|
|
|
+ // this.$set(this.form.datasource[index], 'warehouseName', data.name);
|
|
|
+ // this.$set(this.form.datasource[index], 'warehouseCode', data.code);
|
|
|
+ // const warehouseOutStock = await getWarehouseOutStock({
|
|
|
+ // warehouseId: data.id,
|
|
|
+ // code: row.productCode
|
|
|
+ // });
|
|
|
+ // this.$set(
|
|
|
+ // this.form.datasource[index],
|
|
|
+ // 'warehouseNum',
|
|
|
+ // warehouseOutStock
|
|
|
+ // );
|
|
|
+ // },
|
|
|
|
|
|
- return num;
|
|
|
- },
|
|
|
- // 返回列表数据
|
|
|
- getTableValue() {
|
|
|
- let comitDatasource = this.form.datasource;
|
|
|
- if (comitDatasource.length === 0) return [];
|
|
|
- comitDatasource.forEach((v) => {
|
|
|
- v.totalCount = Number(v.totalCount);
|
|
|
- v.technicalDrawings = Array.isArray(v.technicalDrawings)
|
|
|
- ? v.technicalDrawings
|
|
|
- : [];
|
|
|
+ validateTotalCount(row) {
|
|
|
+ return (rule, value, callback) => {
|
|
|
+ if (isNaN(value) || Number(value) <= 0) {
|
|
|
+ this.$message.error('请输入大于0的数');
|
|
|
+ callback(new Error('请输入大于0的数字'));
|
|
|
+ } else if (Number(value) > row.receiveTotalCount) {
|
|
|
+ this.$message.error('退货数量不能大于收货数量');
|
|
|
+ callback(new Error('退货数量不能大于收货数量'));
|
|
|
+ } else {
|
|
|
+ callback();
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ // else if (this.getTotalCount(row)> row.warehouseNum) {
|
|
|
+ // this.$message.error('退货数量不能大于库存');
|
|
|
+ // callback(new Error('退货数量不能大于库存'));
|
|
|
+ // }
|
|
|
+ getTotalCount(row) {
|
|
|
+ let num = 0;
|
|
|
+ this.form.datasource
|
|
|
+ .filter((item) => item.warehouseId == row.warehouseId)
|
|
|
+ .forEach((item) => {
|
|
|
+ num += Number(item.totalCount);
|
|
|
});
|
|
|
- return comitDatasource;
|
|
|
- },
|
|
|
- getPrice() {
|
|
|
- return [this.allPrice];
|
|
|
- },
|
|
|
-
|
|
|
- //修改回显
|
|
|
- putTableValue(data) {
|
|
|
- if (data && data?.length) {
|
|
|
- data.forEach((v, index) => {
|
|
|
- v.receiveTotalCount = v.receiveTotalCount || v.totalCount;
|
|
|
- v.receiveProductId = v.receiveProductId || v.id;
|
|
|
- });
|
|
|
|
|
|
- this.form.datasource = data;
|
|
|
- this.form.datasource.forEach(async (v, index) => {
|
|
|
- if (v.warehouseId) {
|
|
|
- this.$set(
|
|
|
- this.form.datasource[index],
|
|
|
- 'warehouseNum',
|
|
|
- await getWarehouseOutStock({
|
|
|
- warehouseId: v.warehouseId,
|
|
|
- code: v.productCode
|
|
|
- })
|
|
|
- );
|
|
|
- }
|
|
|
- });
|
|
|
- this.gettotalAmount();
|
|
|
- }
|
|
|
- },
|
|
|
+ return num;
|
|
|
+ },
|
|
|
+ // 返回列表数据
|
|
|
+ getTableValue() {
|
|
|
+ let comitDatasource = this.form.datasource;
|
|
|
+ if (comitDatasource.length === 0) return [];
|
|
|
+ comitDatasource.forEach((v) => {
|
|
|
+ v.totalCount = Number(v.totalCount);
|
|
|
+ v.technicalDrawings = Array.isArray(v.technicalDrawings)
|
|
|
+ ? v.technicalDrawings
|
|
|
+ : [];
|
|
|
+ });
|
|
|
+ return comitDatasource;
|
|
|
+ },
|
|
|
+ getPrice() {
|
|
|
+ return [this.allPrice];
|
|
|
+ },
|
|
|
|
|
|
- remove(row) {
|
|
|
- let index = this.form.datasource.findIndex((n) => n.key == row.key);
|
|
|
- if (index !== -1) {
|
|
|
- this.form.datasource.splice(index, 1);
|
|
|
- this.setSort();
|
|
|
- this.gettotalAmount();
|
|
|
- }
|
|
|
- },
|
|
|
- // 清空表格
|
|
|
- restTable() {
|
|
|
- this.form.datasource = [];
|
|
|
- },
|
|
|
- // 重新排序
|
|
|
- setSort() {
|
|
|
- this.form.datasource.forEach((n, index) => {
|
|
|
- n.key = index + 1;
|
|
|
+ //修改回显
|
|
|
+ putTableValue(data) {
|
|
|
+ if (data && data?.length) {
|
|
|
+ data.forEach((v, index) => {
|
|
|
+ v.receiveTotalCount = v.receiveTotalCount || v.totalCount;
|
|
|
+ v.receiveProductId = v.receiveProductId || v.id;
|
|
|
});
|
|
|
- },
|
|
|
- // 添加
|
|
|
- handlAdd() {
|
|
|
- if (!this.receiveId) return this.$message.error('请先选择收货单');
|
|
|
- this.$refs.productListRef.open(this.form.datasource);
|
|
|
- },
|
|
|
|
|
|
- validateForm(callback) {
|
|
|
- //开始表单校验
|
|
|
- this.$refs.form.validate((valid) => {
|
|
|
- callback(valid);
|
|
|
+ this.form.datasource = data;
|
|
|
+ this.form.datasource.forEach(async (v, index) => {
|
|
|
+ if (v.warehouseId) {
|
|
|
+ this.$set(
|
|
|
+ this.form.datasource[index],
|
|
|
+ 'warehouseNum',
|
|
|
+ await getWarehouseOutStock({
|
|
|
+ warehouseId: v.warehouseId,
|
|
|
+ code: v.productCode
|
|
|
+ })
|
|
|
+ );
|
|
|
+ }
|
|
|
});
|
|
|
+ this.gettotalAmount();
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ remove(row) {
|
|
|
+ let index = this.form.datasource.findIndex((n) => n.key == row.key);
|
|
|
+ if (index !== -1) {
|
|
|
+ this.form.datasource.splice(index, 1);
|
|
|
+ this.setSort();
|
|
|
+ this.gettotalAmount();
|
|
|
}
|
|
|
+ },
|
|
|
+ // 清空表格
|
|
|
+ restTable() {
|
|
|
+ this.form.datasource = [];
|
|
|
+ },
|
|
|
+ // 重新排序
|
|
|
+ setSort() {
|
|
|
+ this.form.datasource.forEach((n, index) => {
|
|
|
+ n.key = index + 1;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 添加
|
|
|
+ handlAdd() {
|
|
|
+ if (!this.receiveId) return this.$message.error('请先选择收货单');
|
|
|
+ this.$refs.productListRef.open(this.form.datasource);
|
|
|
+ },
|
|
|
+
|
|
|
+ validateForm(callback) {
|
|
|
+ //开始表单校验
|
|
|
+ this.$refs.form.validate((valid) => {
|
|
|
+ callback(valid);
|
|
|
+ });
|
|
|
}
|
|
|
- };
|
|
|
+ }
|
|
|
+};
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
- .headbox {
|
|
|
- display: flex;
|
|
|
- justify-content: space-between;
|
|
|
- align-items: center;
|
|
|
- .amount {
|
|
|
- font-size: 14px;
|
|
|
- font-weight: bold;
|
|
|
- padding-right: 30px;
|
|
|
- }
|
|
|
- }
|
|
|
- .time-form .el-form-item {
|
|
|
- margin-bottom: 0 !important;
|
|
|
+.headbox {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ .amount {
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: bold;
|
|
|
+ padding-right: 30px;
|
|
|
}
|
|
|
+}
|
|
|
|
|
|
- ::v-deep .period {
|
|
|
- display: flex;
|
|
|
- .borderleftnone {
|
|
|
- .el-input--medium .el-input__inner {
|
|
|
- border-top-right-radius: 0;
|
|
|
- border-bottom-right-radius: 0;
|
|
|
- }
|
|
|
- }
|
|
|
- .borderrightnone {
|
|
|
- .el-input--medium .el-input__inner {
|
|
|
- border-top-left-radius: 0;
|
|
|
- border-bottom-left-radius: 0;
|
|
|
- }
|
|
|
+.time-form .el-form-item {
|
|
|
+ margin-bottom: 0 !important;
|
|
|
+}
|
|
|
+
|
|
|
+::v-deep .period {
|
|
|
+ display: flex;
|
|
|
+
|
|
|
+ .borderleftnone {
|
|
|
+ .el-input--medium .el-input__inner {
|
|
|
+ border-top-right-radius: 0;
|
|
|
+ border-bottom-right-radius: 0;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- ::v-deep .time-form tbody > tr:hover > td {
|
|
|
- background-color: transparent !important;
|
|
|
- }
|
|
|
- ::v-deep .time-form .el-table tr {
|
|
|
- background-color: #ffffff;
|
|
|
+ .borderrightnone {
|
|
|
+ .el-input--medium .el-input__inner {
|
|
|
+ border-top-left-radius: 0;
|
|
|
+ border-bottom-left-radius: 0;
|
|
|
+ }
|
|
|
}
|
|
|
+}
|
|
|
|
|
|
- .pricebox {
|
|
|
- display: flex;
|
|
|
- justify-content: flex-start;
|
|
|
- align-items: center;
|
|
|
- font-weight: bold;
|
|
|
- }
|
|
|
+::v-deep .time-form tbody > tr:hover > td {
|
|
|
+ background-color: transparent !important;
|
|
|
+}
|
|
|
+
|
|
|
+::v-deep .time-form .el-table tr {
|
|
|
+ background-color: #ffffff;
|
|
|
+}
|
|
|
+
|
|
|
+.pricebox {
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-start;
|
|
|
+ align-items: center;
|
|
|
+ font-weight: bold;
|
|
|
+}
|
|
|
</style>
|