index.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. <template>
  2. <!-- 款项审核-->
  3. <a-modal class="add-custom custom-detail"
  4. title="款项审核"
  5. v-model:visible="visible"
  6. centered
  7. :maskClosable="false"
  8. @cancel="cancel"
  9. width="890px">
  10. <template #footer>
  11. <a-button key="submit"
  12. type="primary"
  13. :loading="loading"
  14. @click="cancel">关闭
  15. </a-button>
  16. <a-button key="submit"
  17. type="primary"
  18. :loading="loading"
  19. v-if="isShowContractCheck(selectedRow.applystatus)"
  20. @click="pass">审核通过
  21. </a-button>
  22. <a-button key="submit"
  23. type="primary"
  24. :loading="loading"
  25. v-if="isShowContractCheck(selectedRow.applystatus)"
  26. @click="refuse">审核拒绝
  27. </a-button>
  28. </template>
  29. <a-form class="inlineForm">
  30. <fieldset class="formFieldSet"
  31. v-if="isShowContractInfo(selectedRow.inouttype)">
  32. <legend>合同基本信息</legend>
  33. <a-row :gutter="24">
  34. <a-col :span="12">
  35. <a-form-item label="合同编号">
  36. <span class="white">{{
  37. getContractTypeName(selectedRow.contracttype) + '/' + formatValue(selectedRow.contractno)
  38. }}</span>
  39. </a-form-item>
  40. </a-col>
  41. <a-col :span="12">
  42. <a-form-item label="定价类型">
  43. <span class="white">{{ getPriceTypeName(selectedRow.pricetype) }}</span>
  44. </a-form-item>
  45. </a-col>
  46. </a-row>
  47. <a-row :gutter="24">
  48. <a-col :span="12">
  49. <a-form-item label="销售方">
  50. <span class="white">{{ formatValue(selectedRow.sellusername) }}</span>
  51. </a-form-item>
  52. </a-col>
  53. <a-col :span="12">
  54. <a-form-item label="现货品种">
  55. <span class="white">{{ formatValue(selectedRow.deliverygoodsname) }}</span>
  56. </a-form-item>
  57. </a-col>
  58. </a-row>
  59. <a-row :gutter="24">
  60. <a-col :span="12">
  61. <a-form-item label="采购方">
  62. <span class="white">{{ formatValue(selectedRow.buyusername) }}</span>
  63. </a-form-item>
  64. </a-col>
  65. <a-col :span="12">
  66. <a-form-item label="合同签署量">
  67. <span class="white">{{ formatValue(selectedRow.contractqty) }}</span>
  68. </a-form-item>
  69. </a-col>
  70. </a-row>
  71. </fieldset>
  72. <fieldset class="formFieldSet">
  73. <legend>登记信息</legend>
  74. <a-row :gutter="24">
  75. <a-col :span="12">
  76. <a-form-item label="出库类型">
  77. <span class="white">{{ InOutTypeName(selectedRow.inouttype) }}</span>
  78. </a-form-item>
  79. </a-col>
  80. <a-col :span="12">
  81. <a-form-item label="品类">
  82. <span class="white">{{ formatValue(selectedRow.deliverygoodsname) }}</span>
  83. </a-form-item>
  84. </a-col>
  85. </a-row>
  86. <a-row :gutter="24">
  87. <a-col :span="12">
  88. <a-form-item label="品牌">
  89. <span class="white">{{ formatValue(selectedRow.brandname) }}</span>
  90. </a-form-item>
  91. </a-col>
  92. <a-col :span="12">
  93. <a-form-item label="入库仓库">
  94. <span class="white">{{ formatValue(selectedRow.warehousename) }}</span>
  95. </a-form-item>
  96. </a-col>
  97. </a-row>
  98. <a-row :gutter="24">
  99. <a-col :span="12">
  100. <a-form-item label="入库数量">
  101. <span class="white">{{
  102. formatValue(selectedRow.qty) + getGoodsUnitEnumItemName(selectedRow.unitid)
  103. }}</span>
  104. </a-form-item>
  105. </a-col>
  106. <a-col :span="12">
  107. <a-form-item label="登记时间">
  108. <span class="white">{{ formatValue(selectedRow.applytime) }}</span>
  109. </a-form-item>
  110. </a-col>
  111. </a-row>
  112. <a-row :gutter="24">
  113. <a-col :span="12">
  114. <a-form-item label="登记人">
  115. <span class="white">{{ formatValue(selectedRow.applyname) }}</span>
  116. </a-form-item>
  117. </a-col>
  118. <a-col :span="12">
  119. <a-form-item label="状态">
  120. <span class="white">{{ getApplyStatusName(selectedRow.applystatus) }}</span>
  121. </a-form-item>
  122. </a-col>
  123. </a-row>
  124. </fieldset>
  125. <fieldset class="formFieldSet">
  126. <legend>审核信息</legend>
  127. <a-row :gutter="24">
  128. <a-col :span="12">
  129. <a-form-item label="审核时间">
  130. <span class="white">{{ formatValue(selectedRow.audittime) }}</span>
  131. </a-form-item>
  132. </a-col>
  133. <a-col :span="12">
  134. <a-form-item label="审核人">
  135. <span class="white">{{ formatValue(selectedRow.auditname) }}</span>
  136. </a-form-item>
  137. </a-col>
  138. </a-row>
  139. <a-row :gutter="24">
  140. <a-col :span="12">
  141. <a-form-item label="审核意见">
  142. <span class="white">{{ formatValue(selectedRow.auditremark) }}</span>
  143. </a-form-item>
  144. </a-col>
  145. </a-row>
  146. </fieldset>
  147. </a-form>
  148. </a-modal>
  149. </template>
  150. <script lang="ts">
  151. import { defineComponent, PropType, reactive, ref, watchEffect } from 'vue';
  152. import { closeModal } from '@/common/setup/modal/index';
  153. import { QueryCustomInfoType } from '@/services/go/ermcp/customInfo/interface';
  154. import { mergeObj } from '@/utils/objHandle';
  155. import { getStatusName } from '@/common/constants/enumsName';
  156. import { formatValue, formatTime } from '@/common/methods';
  157. import { Ermcp3AreaStockApply } from '@/services/go/ermcp/inventory-review/interface';
  158. import { InOutTypeName, isShowContractCheck, isShowContractInfo } from '@/views/manage/inventory-review/setup';
  159. import { getContractTypeName, getPriceTypeName, getApplyStatusName } from '@/common/constants/enumsName';
  160. import { getGoodsUnitEnumItemName } from '@/common/constants/enumsName';
  161. import { Modal } from 'ant-design-vue';
  162. import { AreaInOutApplyAuditPassReq, AuditERMCPAreaInOutStockApplyReq } from '@/services/proto/warehouse/interface';
  163. import Long from 'long';
  164. import { getLongTypeLoginID } from '@/services/bus/login';
  165. import { LongType } from '@/services/socket/login/interface';
  166. import { passStockControl, refuseStockControl } from '@/views/manage/inventory-review/components/setup';
  167. import moment from 'moment';
  168. export default defineComponent({
  169. name: 'inventory_review_checkin_audit',
  170. components: {},
  171. props: {
  172. selectedRow: {
  173. type: Object as PropType<Ermcp3AreaStockApply>,
  174. default: {},
  175. },
  176. },
  177. setup(props, context) {
  178. const { visible, cancel } = closeModal('inventory_review_checkin_audit');
  179. const loading = ref<boolean>(false);
  180. const maskClosableFlag = ref<boolean>(false);
  181. function submit() {
  182. loading.value = true;
  183. setTimeout(() => {
  184. loading.value = false;
  185. cancel();
  186. }, 200);
  187. }
  188. // 审核通过
  189. function pass() {
  190. Modal.confirm({
  191. title: '是否确认审核通过',
  192. okText: '审核通过',
  193. cancelText: '取消',
  194. onOk() {
  195. const param: AreaInOutApplyAuditPassReq = {
  196. InOutApplyID: Long.fromString(props.selectedRow.inoutapplyid),
  197. AuditID: Long.fromString((getLongTypeLoginID() as LongType).toString()),
  198. Remark: '',
  199. };
  200. passStockControl(param, loading)
  201. .then((res) => {
  202. context.emit('refresh');
  203. cancel();
  204. })
  205. .catch((err) => {});
  206. },
  207. onCancel() {},
  208. });
  209. }
  210. // 审核拒绝
  211. function refuse() {
  212. Modal.confirm({
  213. title: '是否确认审核拒绝',
  214. okText: '审核拒绝',
  215. cancelText: '取消',
  216. onOk() {
  217. const param: AuditERMCPAreaInOutStockApplyReq = {
  218. InOutApplyID: Long.fromString(props.selectedRow.inoutapplyid), // uint64 申请ID
  219. AuditID: Long.fromString((getLongTypeLoginID() as LongType).toString()), // uint64 审核人
  220. AuditRemark: '', // string 审核备注
  221. AuditTradeDate: moment().format('YYYYMMDD'), // string 审核交易日(yyyyMMdd)
  222. ApplyStatus: 3, // int32 审核状态:3-审核拒绝 5-已撤回
  223. };
  224. refuseStockControl(param, loading)
  225. .then((res) => {
  226. context.emit('refresh');
  227. cancel();
  228. })
  229. .catch((err) => {});
  230. },
  231. onCancel() {},
  232. });
  233. }
  234. return {
  235. visible,
  236. cancel,
  237. submit,
  238. loading,
  239. formatValue,
  240. getStatusName,
  241. maskClosableFlag,
  242. isShowContractInfo,
  243. getContractTypeName,
  244. getPriceTypeName,
  245. InOutTypeName,
  246. getGoodsUnitEnumItemName,
  247. getApplyStatusName,
  248. isShowContractCheck,
  249. refuse,
  250. pass,
  251. };
  252. },
  253. });
  254. </script>
  255. <style lang="less">
  256. .inventory_review_checkin_audit {
  257. .ant-form.inlineForm {
  258. margin-top: 20px;
  259. }
  260. }
  261. </style>;