index.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <template>
  2. <!-- 出库登记-->
  3. <a-modal class="commonModal" title="出库登记" v-model:visible="visible" @cancel="cancel" centered width="890px">
  4. <template #footer>
  5. <a-button key="submit" class="cancelBtn" @click="cancel">取消
  6. </a-button>
  7. <a-button key="submit" type="primary" :loading="loading" @click="submit">出库登记
  8. </a-button>
  9. </template>
  10. <a-form class="inlineForm" ref="formRef" :model="formState" :rules="rules">
  11. <fieldset class="formFieldSet">
  12. <legend>合同基本信息</legend>
  13. <a-row :gutter="24">
  14. <a-col :span="12">
  15. <a-form-item label="合同编号">
  16. <span class="white">{{ formatValue(selectedRow.contractno) }}</span>
  17. </a-form-item>
  18. </a-col>
  19. <a-col :span="12">
  20. <a-form-item :label="selectedRow.contracttype===1? '采购方': '销售方'">
  21. <span class="white">{{ formatValue(selectedRow.accountname) }}</span>
  22. </a-form-item>
  23. </a-col>
  24. <a-col :span="12">
  25. <a-form-item label="现货品种">
  26. <span class="white">{{formatValue(selectedRow.deliverygoodsname)}}</span>
  27. </a-form-item>
  28. </a-col>
  29. <a-col :span="12">
  30. <a-form-item label="合同签署量">
  31. <span class="white">{{formatValue(selectedRow.qty)}}</span>
  32. </a-form-item>
  33. </a-col>
  34. </a-row>
  35. </fieldset>
  36. <fieldset class="formFieldSet">
  37. <legend>已登记信息</legend>
  38. <a-row :gutter="24">
  39. <a-col :span="12" v-for="(item, i) in DGList" :key="i">
  40. <a-form-item label="已入库量">
  41. <span class="white">{{item.wrstandardname}} + {{item.brandname}} ({{item.totalqty + selectedRow.enumdicname}})</span>
  42. </a-form-item>
  43. </a-col>
  44. <!-- <a-col :span="12">
  45. <a-form-item label="已入库量2">
  46. <span class="white">品类2+品牌2(66吨)</span>
  47. </a-form-item>
  48. </a-col>
  49. <a-col :span="12">
  50. <a-form-item label="已入库量3">
  51. <span class="white">品类3+品牌3(1000吨)</span>
  52. </a-form-item>
  53. </a-col>
  54. <a-col :span="12">
  55. <a-form-item label="已入库量4">
  56. <span class="white">品类4+品牌4(5吨)</span>
  57. </a-form-item>
  58. </a-col> -->
  59. </a-row>
  60. </fieldset>
  61. <fieldset class="formFieldSet">
  62. <legend>本次入库信息</legend>
  63. <a-row :gutter="24">
  64. <a-col :span="12">
  65. <a-form-item label="商品">
  66. <a-select class="inlineFormSelect" style="width: 200px" placeholder="请选择商品" v-model:value="selectedRow.wrstandardid" readonly>
  67. <a-select-option v-for="option in gmlist" :key="option.wrstandardid" :value="option.wrstandardid">{{option.wrstandardname}}
  68. </a-select-option>
  69. </a-select>
  70. </a-form-item>
  71. </a-col>
  72. <a-col :span="12">
  73. <a-form-item label="品牌" name="SpotGoodsBrandID">
  74. <a-select class="inlineFormSelect" style="width: 200px" placeholder="请选择品牌" v-model:value="formState.SpotGoodsBrandID">
  75. <a-select-option v-for="option in gblist" :key="option.brandid" :value="option.brandid">{{option.brandname}}
  76. </a-select-option>
  77. </a-select>
  78. </a-form-item>
  79. </a-col>
  80. <a-col :span="12">
  81. <a-form-item label="出库仓库" name="WarehouseInfo">
  82. <a-select class="inlineFormSelect" style="width: 200px" placeholder="请选择入库仓库" v-model:value="formState.WarehouseInfo">
  83. <a-select-option v-for="option in wareHouseList" :key="option.autoid" :value="option.autoid">{{option.warehousecode}}
  84. </a-select-option>
  85. </a-select>
  86. </a-form-item>
  87. </a-col>
  88. <a-col :span="12">
  89. <a-form-item label="出库数量" name="Qty">
  90. <a-input-number class="dialogInput" style="width: 200px" suffix="单位" :min="0" placeholder="请输入出库数量" v-model:value="formState.Qty">
  91. </a-input-number>
  92. </a-form-item>
  93. </a-col>
  94. </a-row>
  95. </fieldset>
  96. </a-form>
  97. </a-modal>
  98. </template>
  99. <script lang="ts">
  100. import { defineComponent, PropType, ref, unref } from 'vue';
  101. import { Ermcp3SellBuyContract } from '@/services/go/ermcp/purchase/interface';
  102. import { ERMCPAreaInOutStockApplyReq } from '@/services/proto/warehouse/interface';
  103. import { QueryAreaStockApply, QueryWareHouse } from '@/services/go/ermcp/warehouse-info/index';
  104. import * as Long from 'long';
  105. import { formatValue } from '@/common/methods';
  106. import { handleForm } from './setup';
  107. import APP from '@/services';
  108. import { ErmcpWareHouseInfo } from '@/views/information/warehouse-info/list';
  109. import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
  110. import { message } from 'ant-design-vue';
  111. import { Ermcp3AreaStockApplySum } from '@/services/go/ermcp/warehouse-info/interface';
  112. import { ermcpInOutStockApplyReq } from '@/services/proto/warehouse';
  113. import { _closeModal } from '@/common/setup/modal/modal';
  114. export default defineComponent({
  115. name: 'sell_pending_storage',
  116. emits: ['cancel', 'update'],
  117. props: {
  118. selectedRow: {
  119. type: Object as PropType<Ermcp3SellBuyContract>,
  120. default: {},
  121. },
  122. },
  123. setup(props, context) {
  124. const { visible, cancel } = _closeModal(context);
  125. const { rules, formState, formRef } = handleForm();
  126. const loading = ref<boolean>(false);
  127. const wareHouseList = ref<ErmcpWareHouseInfo[]>([]);
  128. const gblist = ref<[]>([]);
  129. const gmlist = ref<[]>([]);
  130. const DGList = ref<Ermcp3AreaStockApplySum[]>([]);
  131. QueryAreaStockApply(props.selectedRow.spotcontractid)
  132. .then((res) => {
  133. DGList.value = res.filter((e) => e.inouttype === 6);
  134. })
  135. .catch((err) => message.error(err));
  136. const deliverygoods = APP.get('DeliveryGoodsList').find((x: any) => x.data.deliverygoodsid === props.selectedRow.deliverygoodsid);
  137. gblist.value = deliverygoods && deliverygoods.gblist;
  138. gmlist.value = deliverygoods && deliverygoods.gmlist;
  139. // 查询仓库信息
  140. QueryWareHouse('1').then((res) => {
  141. wareHouseList.value = res;
  142. });
  143. function submit() {
  144. const wrapEl = unref(formRef);
  145. wrapEl.validate().then(() => {
  146. const params: ERMCPAreaInOutStockApplyReq = {
  147. InOutType: 6, // 5:采购入库 6:销售出库 7:生产入库 8:生产出库
  148. WRStandardID: props.selectedRow.wrstandardid, //品类ID
  149. SpotGoodsBrandID: formState.SpotGoodsBrandID || 0, //现货品牌ID(DGFactoryItem表的ID)
  150. DeliveryGoodsID: props.selectedRow.deliverygoodsid, //现货商品ID
  151. SpotContractID: Long.fromString(props.selectedRow.spotcontractid), //合同ID
  152. WarehouseInfo: formState.WarehouseInfo || 0, // uint64 现货仓库ID
  153. Qty: formState.Qty || 0, // double 数量t
  154. ApplyRemark: '', // string 申请备注
  155. };
  156. requestResultLoadingAndInfo(ermcpInOutStockApplyReq, params, loading, ['出库登记成功', '出库登记失败:']).then(() => {
  157. cancel(true);
  158. });
  159. });
  160. }
  161. return {
  162. visible,
  163. cancel,
  164. submit,
  165. loading,
  166. formatValue,
  167. rules,
  168. formState,
  169. formRef,
  170. wareHouseList,
  171. gblist,
  172. gmlist,
  173. DGList,
  174. };
  175. },
  176. });
  177. </script>
  178. <style lang="less">
  179. </style>;