index.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. <template>
  2. <!-- 恢复仓库信息-->
  3. <a-modal class="commonModal modify-custom"
  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. class="cancelBtn"
  13. @click="cancel">取消
  14. </a-button>
  15. <a-button key="submit"
  16. type="primary"
  17. :loading="loading"
  18. @click="submit">确认恢复
  19. </a-button>
  20. </template>
  21. <a-form class="inlineForm"
  22. :form="form"
  23. @submit="handleSearch">
  24. <a-row :gutter="24">
  25. <a-col :span="12">
  26. <a-form-item label="仓库类型">
  27. <span class="white">{{ getWareHouseTypeName(selectedRow.warehousetype) }}</span>
  28. </a-form-item>
  29. </a-col>
  30. <a-col :span="12">
  31. <a-form-item label="仓库名称">
  32. <span class="white">{{ formatValue(selectedRow.warehousename)}}</span>
  33. </a-form-item>
  34. </a-col>
  35. </a-row>
  36. <a-row :gutter="24">
  37. <a-col :span="12">
  38. <a-form-item label="仓库简称">
  39. <span class="white">{{ formatValue(selectedRow.warehousecode) }}</span>
  40. </a-form-item>
  41. </a-col>
  42. <a-col :span="12">
  43. <a-form-item label="状态">
  44. <span class="white">{{ gerWareHouseStatusName(selectedRow.warehousestatus) }}</span>
  45. </a-form-item>
  46. </a-col>
  47. </a-row>
  48. <template v-if="!isOemByEnum(OemType.pingan)">
  49. <a-row :gutter="24">
  50. <a-col :span="12">
  51. <a-form-item label="联系电话">
  52. <span class="white">{{ formatValue(selectedRow.contactnum) }}</span>
  53. </a-form-item>
  54. </a-col>
  55. <a-col :span="12">
  56. <a-form-item label="联系人">
  57. <span class="white">{{ formatValue(selectedRow.contactname) }}</span>
  58. </a-form-item>
  59. </a-col>
  60. </a-row>
  61. <a-row :gutter="24">
  62. <a-col :span="12">
  63. <a-form-item label="所在地区">
  64. <span
  65. class="white">{{ getProvinceName(selectedRow.provinceid) + getCityName(selectedRow.cityid) + getDistrictName(selectedRow.districtid) }}</span>
  66. </a-form-item>
  67. </a-col>
  68. <a-col :span="12">
  69. <a-form-item label="详细地址">
  70. <span class="white">{{ formatValue(selectedRow.address) }}</span>
  71. </a-form-item>
  72. </a-col>
  73. </a-row>
  74. </template>
  75. </a-form>
  76. </a-modal>
  77. </template>
  78. <script lang="ts">
  79. import { defineComponent, PropType, ref } from 'vue';
  80. import { closeModal } from '@/common/setup/modal/index';
  81. import { ErmcpWareHouseInfo } from '@/services/go/ermcp/warehouse-info/interface';
  82. import { Modal } from 'ant-design-vue';
  83. import { gerWareHouseStatusName, getWareHouseTypeName } from '@/views/information/warehouse-info/setup';
  84. import { formatValue } from '@/common/methods';
  85. import { getSelectedAccountId } from '@/services/bus/account';
  86. import { WarehouseStateChangeReq } from '@/services/proto/warehouse/interface';
  87. import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
  88. import { warehouseStateChangeReq } from '@/services/proto/warehouse';
  89. import { isOemByEnum, OemType } from '@/common/config/projectName';
  90. export default defineComponent({
  91. name: 'warehouse_info_btn_recover',
  92. components: {},
  93. props: {
  94. selectedRow: {
  95. type: Object as PropType<ErmcpWareHouseInfo>,
  96. default: {},
  97. },
  98. },
  99. setup(props, context) {
  100. const { visible, cancel } = closeModal('warehouse_info_btn_recover');
  101. const loading = ref<boolean>(false);
  102. const maskClosableFlag = ref<boolean>(false);
  103. function submit() {
  104. loading.value = true;
  105. Modal.confirm({
  106. title: '是否确认恢复仓库信息',
  107. okText: '确认恢复',
  108. cancelText: '取消',
  109. onOk() {
  110. const accountid = getSelectedAccountId();
  111. const req: WarehouseStateChangeReq = {
  112. accountid: accountid === undefined ? 0 : accountid,
  113. warehouseid: props.selectedRow.autoid,
  114. warehousestatus: 1,
  115. };
  116. requestResultLoadingAndInfo(warehouseStateChangeReq, req, loading, ['恢复仓库成功', '恢复仓库失败:']).then(() => {
  117. context.emit('refresh');
  118. cancel();
  119. });
  120. },
  121. onCancel() {},
  122. });
  123. }
  124. return {
  125. visible,
  126. cancel,
  127. submit,
  128. loading,
  129. maskClosableFlag,
  130. gerWareHouseStatusName,
  131. getWareHouseTypeName,
  132. formatValue,
  133. isOemByEnum,
  134. OemType,
  135. };
  136. },
  137. });
  138. </script>
  139. <style lang="less">
  140. .modify-custom {
  141. }
  142. </style
  143. >;