|
@@ -9,7 +9,7 @@
|
|
|
<template #footer>
|
|
<template #footer>
|
|
|
<a-button key="submit"
|
|
<a-button key="submit"
|
|
|
class="cancelBtn"
|
|
class="cancelBtn"
|
|
|
- >取消</a-button>
|
|
|
|
|
|
|
+ @click="cancel">取消</a-button>
|
|
|
<a-button key="submit"
|
|
<a-button key="submit"
|
|
|
type="primary"
|
|
type="primary"
|
|
|
:loading="loading"
|
|
:loading="loading"
|
|
@@ -17,23 +17,30 @@
|
|
|
</template>
|
|
</template>
|
|
|
<a-form class="inlineForm"
|
|
<a-form class="inlineForm"
|
|
|
ref="formRef"
|
|
ref="formRef"
|
|
|
|
|
+ :model="formState"
|
|
|
|
|
+ :rules="rules"
|
|
|
>
|
|
>
|
|
|
<fieldset class="formFieldSet">
|
|
<fieldset class="formFieldSet">
|
|
|
<legend>合同基本信息</legend>
|
|
<legend>合同基本信息</legend>
|
|
|
<a-row :gutter="24">
|
|
<a-row :gutter="24">
|
|
|
<a-col :span="12">
|
|
<a-col :span="12">
|
|
|
<a-form-item label="合同编号">
|
|
<a-form-item label="合同编号">
|
|
|
- <span class="white">NPCQ-2020121001</span>
|
|
|
|
|
|
|
+ <span class="white">{{ formatValue(selectedRow.contractno) }}</span>
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
</a-col>
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
<a-col :span="12">
|
|
|
- <a-form-item label="销售方">
|
|
|
|
|
- <span class="white">江西铜业集团</span>
|
|
|
|
|
|
|
+ <a-form-item :label="selectedRow.contracttype===1? '采购方': '销售方'">
|
|
|
|
|
+ <span class="white">{{ formatValue(selectedRow.accountname) }}</span>
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
</a-col>
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
<a-col :span="12">
|
|
|
<a-form-item label="现货品种">
|
|
<a-form-item label="现货品种">
|
|
|
- <span class="white">铜板</span>
|
|
|
|
|
|
|
+ <span class="white">{{formatValue(selectedRow.deliverygoodsname)}}</span>
|
|
|
|
|
+ </a-form-item>
|
|
|
|
|
+ </a-col>
|
|
|
|
|
+ <a-col :span="12">
|
|
|
|
|
+ <a-form-item label="合同签署量">
|
|
|
|
|
+ <span class="white">{{formatValue(selectedRow.qty)}}</span>
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
</a-col>
|
|
</a-col>
|
|
|
</a-row>
|
|
</a-row>
|
|
@@ -70,42 +77,41 @@
|
|
|
<a-form-item label="品类">
|
|
<a-form-item label="品类">
|
|
|
<a-select class="inlineFormSelect"
|
|
<a-select class="inlineFormSelect"
|
|
|
style="width: 200px"
|
|
style="width: 200px"
|
|
|
- placeholder="请选择品类">
|
|
|
|
|
- <a-select-option value="品牌一">
|
|
|
|
|
- 品牌一
|
|
|
|
|
- </a-select-option>
|
|
|
|
|
|
|
+ placeholder="请选择品类"
|
|
|
|
|
+ v-model:value="selectedRow.wrstandardid"
|
|
|
|
|
+ disabled>
|
|
|
|
|
+ <a-select-option v-for="option in gmlist" :key="option.wrstandardid" :value="option.wrstandardid">{{option.wrstandardname}}</a-select-option>
|
|
|
</a-select>
|
|
</a-select>
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
</a-col>
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
<a-col :span="12">
|
|
|
- <a-form-item label="品牌">
|
|
|
|
|
|
|
+ <a-form-item label="品牌" name="SpotGoodsBrandID">
|
|
|
<a-select class="inlineFormSelect"
|
|
<a-select class="inlineFormSelect"
|
|
|
style="width: 200px"
|
|
style="width: 200px"
|
|
|
- placeholder="请选择品牌">
|
|
|
|
|
- <a-select-option value="品牌一">
|
|
|
|
|
- 品牌一
|
|
|
|
|
- </a-select-option>
|
|
|
|
|
|
|
+ placeholder="请选择品牌"
|
|
|
|
|
+ v-model:value="formState.SpotGoodsBrandID">
|
|
|
|
|
+ <a-select-option v-for="option in gblist" :key="option.brandid" :value="option.brandid">{{option.brandname}}</a-select-option>
|
|
|
</a-select>
|
|
</a-select>
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
</a-col>
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
<a-col :span="12">
|
|
|
- <a-form-item label="入库仓库">
|
|
|
|
|
|
|
+ <a-form-item label="入库仓库" name="WarehouseInfo">
|
|
|
<a-select class="inlineFormSelect"
|
|
<a-select class="inlineFormSelect"
|
|
|
style="width: 200px"
|
|
style="width: 200px"
|
|
|
- placeholder="请选择入库仓库">
|
|
|
|
|
- <a-select-option value="品牌一">
|
|
|
|
|
- 品牌一
|
|
|
|
|
- </a-select-option>
|
|
|
|
|
|
|
+ placeholder="请选择入库仓库"
|
|
|
|
|
+ v-model:value="formState.WarehouseInfo">
|
|
|
|
|
+ <a-select-option v-for="option in wareHouseList" :key="option.autoid" :value="option.autoid">{{option.warehousename}}</a-select-option>
|
|
|
</a-select>
|
|
</a-select>
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
</a-col>
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
<a-col :span="12">
|
|
|
- <a-form-item label="入库数量">
|
|
|
|
|
- <a-input class="dialogInput"
|
|
|
|
|
|
|
+ <a-form-item label="入库数量" name="Qty">
|
|
|
|
|
+ <a-input-number class="dialogInput"
|
|
|
style="width: 200px"
|
|
style="width: 200px"
|
|
|
suffix="单位"
|
|
suffix="单位"
|
|
|
- placeholder="请输入入库数量">
|
|
|
|
|
- </a-input>
|
|
|
|
|
|
|
+ placeholder="请输入入库数量"
|
|
|
|
|
+ v-model:value="formState.Qty">
|
|
|
|
|
+ </a-input-number>
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
</a-col>
|
|
</a-col>
|
|
|
</a-row>
|
|
</a-row>
|
|
@@ -115,13 +121,19 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
|
-import {defineComponent, PropType, ref} from 'vue';
|
|
|
|
|
|
|
+import {defineComponent, PropType, ref,unref,reactive} from 'vue';
|
|
|
import { closeModal } from '@/common/setup/modal/index';
|
|
import { closeModal } from '@/common/setup/modal/index';
|
|
|
import {SomePriceReq} from "@/services/proto/contract/interface";
|
|
import {SomePriceReq} from "@/services/proto/contract/interface";
|
|
|
import {somePriceReq, storageReq} from "@/views/business/purchase/components/setup";
|
|
import {somePriceReq, storageReq} from "@/views/business/purchase/components/setup";
|
|
|
import {Ermcp3SellBuyContract} from "@/services/go/ermcp/purchase/interface";
|
|
import {Ermcp3SellBuyContract} from "@/services/go/ermcp/purchase/interface";
|
|
|
import {ERMCPAreaInOutStockApplyReq} from "@/services/proto/warehouse/interface";
|
|
import {ERMCPAreaInOutStockApplyReq} from "@/services/proto/warehouse/interface";
|
|
|
|
|
+import { QueryWareHouse } from '@/services/go/ermcp/warehouse-info/index';
|
|
|
import * as Long from "long";
|
|
import * as Long from "long";
|
|
|
|
|
+import { formatValue } from '@/common/methods';
|
|
|
|
|
+import { handleForm } from './setup';
|
|
|
|
|
+import APP from "@/services";
|
|
|
|
|
+import { initData } from '@/common/methods';
|
|
|
|
|
+import { ErmcpWareHouseInfo } from '@/views/information/warehouse-info/list';
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
|
name: 'purchase_pending_storage',
|
|
name: 'purchase_pending_storage',
|
|
@@ -134,35 +146,58 @@ export default defineComponent({
|
|
|
},
|
|
},
|
|
|
setup(props, context) {
|
|
setup(props, context) {
|
|
|
const { visible, cancel } = closeModal('purchase_pending_storage');
|
|
const { visible, cancel } = closeModal('purchase_pending_storage');
|
|
|
|
|
+ const { rules, formState, formRef } = handleForm();
|
|
|
const loading = ref<boolean>(false);
|
|
const loading = ref<boolean>(false);
|
|
|
- function submit() {
|
|
|
|
|
-
|
|
|
|
|
- const params : ERMCPAreaInOutStockApplyReq = {
|
|
|
|
|
- InOutType: 1, // 1:采购入库 2:销售出库 3:生产入库 4:生产出库
|
|
|
|
|
- WRStandardID: props.selectedRow.wrstandardid, //品类ID
|
|
|
|
|
- SpotGoodsBrandID: props.selectedRow.spotgoodsbrandid, //现货品牌ID(DGFactoryItem表的ID)
|
|
|
|
|
- DeliveryGoodsID: props.selectedRow.deliverygoodsid, //现货商品ID
|
|
|
|
|
- SpotContractID: Long.fromString(props.selectedRow.spotcontractid), //合同ID
|
|
|
|
|
- WarehouseInfo: 8, // uint64 现货仓库ID
|
|
|
|
|
- Qty: 10, // double 数量
|
|
|
|
|
- ApplyRemark: "", // string 申请备注
|
|
|
|
|
- }
|
|
|
|
|
- // 入库
|
|
|
|
|
- storageReq(
|
|
|
|
|
- params, loading)
|
|
|
|
|
- .then(res => {
|
|
|
|
|
- cancel()
|
|
|
|
|
- context.emit('refresh')
|
|
|
|
|
- })
|
|
|
|
|
- .catch(err => {
|
|
|
|
|
|
|
+ const wareHouseList = ref<ErmcpWareHouseInfo[]>([]);
|
|
|
|
|
+ const gblist = ref<[]>([]);
|
|
|
|
|
+ const gmlist = ref<[]>([]);
|
|
|
|
|
+ initData(()=>{
|
|
|
|
|
+ const deliverygoods = APP.get('DeliveryGoodsList').find((x:any) => x.deliverygoodsid === props.selectedRow.deliverygoodsid);
|
|
|
|
|
+ gblist.value = deliverygoods&&deliverygoods.gblist;
|
|
|
|
|
+ gmlist.value = deliverygoods&&deliverygoods.gmlist;
|
|
|
|
|
+ // 查询仓库信息
|
|
|
|
|
+ QueryWareHouse("1")
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ wareHouseList.value = res;
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ function submit() {
|
|
|
|
|
+ console.log(props.selectedRow)
|
|
|
|
|
+ console.log(wareHouseList)
|
|
|
|
|
+ const wrapEl = unref(formRef);
|
|
|
|
|
+ wrapEl.validate().then(() => {
|
|
|
|
|
+ const params : ERMCPAreaInOutStockApplyReq = {
|
|
|
|
|
+ InOutType: 1, // 1:采购入库 2:销售出库 3:生产入库 4:生产出库
|
|
|
|
|
+ WRStandardID: props.selectedRow.wrstandardid, //品类ID
|
|
|
|
|
+ SpotGoodsBrandID: formState.SpotGoodsBrandID || 0, //现货品牌ID(DGFactoryItem表的ID)
|
|
|
|
|
+ DeliveryGoodsID: props.selectedRow.deliverygoodsid, //现货商品ID
|
|
|
|
|
+ SpotContractID: Long.fromString(props.selectedRow.spotcontractid), //合同ID
|
|
|
|
|
+ WarehouseInfo: formState.WarehouseInfo || 0, // uint64 现货仓库ID
|
|
|
|
|
+ Qty: formState.Qty || 0, // double 数量
|
|
|
|
|
+ ApplyRemark: "", // string 申请备注
|
|
|
|
|
+ }
|
|
|
|
|
+ // 入库
|
|
|
|
|
+ storageReq(params, loading)
|
|
|
|
|
+ .then(res => {
|
|
|
|
|
+ cancel()
|
|
|
|
|
+ context.emit('refresh')
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(err => {})
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
return {
|
|
return {
|
|
|
visible,
|
|
visible,
|
|
|
cancel,
|
|
cancel,
|
|
|
submit,
|
|
submit,
|
|
|
loading,
|
|
loading,
|
|
|
|
|
+ formatValue,
|
|
|
|
|
+ rules,
|
|
|
|
|
+ formState,
|
|
|
|
|
+ formRef,
|
|
|
|
|
+ wareHouseList,
|
|
|
|
|
+ gblist,
|
|
|
|
|
+ gmlist,
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|