index.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <template>
  2. <!-- 停用仓库信息-->
  3. <a-modal class="commonModal warehouse-disable"
  4. title="停用仓库信息"
  5. v-model:visible="visible"
  6. centered
  7. :maskClosable="maskClosableFlag"
  8. @cancel="cancel"
  9. width="890px">
  10. <template #footer>
  11. <a-button key="cancel"
  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">{{ formatValue(selectedRow.contactname) }}</span>
  45. </a-form-item>
  46. </a-col>
  47. </a-row>
  48. <a-row :gutter="24">
  49. <a-col :span="12">
  50. <a-form-item label="联系电话">
  51. <span class="white">{{ formatValue(selectedRow.contactnum) }}</span>
  52. </a-form-item>
  53. </a-col>
  54. <a-col :span="12">
  55. <a-form-item label="状态">
  56. <span class="white">{{ gerWareHouseStatusName(selectedRow.warehousestatus) }}</span>
  57. </a-form-item>
  58. </a-col>
  59. </a-row>
  60. <a-row :gutter="24">
  61. <a-col :span="12">
  62. <a-form-item label="所在地区">
  63. <span class="white">{{ formatValue(selectedRow.address) }}</span>
  64. </a-form-item>
  65. </a-col>
  66. <a-col :span="12">
  67. <a-form-item label="详细地址">
  68. <span class="white">{{ formatValue(selectedRow.address) }}</span>
  69. </a-form-item>
  70. </a-col>
  71. </a-row>
  72. </a-form>
  73. </a-modal>
  74. </template>
  75. <script lang="ts">
  76. import {defineComponent, PropType, ref} from 'vue';
  77. import {closeModal} from '@/common/setup/modal/index';
  78. import {stopOrResumeWarehouse, wareType} from "@/views/information/warehouse-info/compoments/setup";
  79. import {ErmcpWareHouseInfo} from "@/services/go/ermcp/warehouse-info/interface";
  80. import {message, Modal} from "ant-design-vue";
  81. import {gerWareHouseStatusName, getWareHouseTypeName} from "@/views/information/warehouse-info/setup";
  82. import {formatValue} from "@/common/methods";
  83. export default defineComponent({
  84. name: 'warehouse_info_btn_disable',
  85. components: {},
  86. props: {
  87. selectedRow: {
  88. type: Object as PropType<ErmcpWareHouseInfo>,
  89. default: {},
  90. },
  91. },
  92. setup(props, context) {
  93. const {visible, cancel} = closeModal('warehouse_info_btn_disable');
  94. const maskClosableFlag = ref<boolean>(false);
  95. const {loading, changeStatus} = stopOrResumeWarehouse(wareType.stop);
  96. function submit() {
  97. loading.value = true;
  98. Modal.confirm({
  99. title: '是否确认停用仓库信息',
  100. okText: '确认停用',
  101. cancelText: '取消',
  102. onOk() {
  103. console.log('OK');
  104. changeStatus(props.selectedRow.autoid)
  105. .then(res => {
  106. message.success(res)
  107. context.emit('refresh')
  108. cancel()
  109. })
  110. .catch(err => {
  111. message.error(err)
  112. })
  113. },
  114. onCancel() {
  115. console.log('Cancel');
  116. },
  117. });
  118. }
  119. return {
  120. visible,
  121. cancel,
  122. submit,
  123. loading,
  124. maskClosableFlag,
  125. gerWareHouseStatusName,
  126. getWareHouseTypeName,
  127. formatValue,
  128. };
  129. },
  130. });
  131. </script>
  132. <style lang="less">
  133. .warehouse-disable {
  134. }
  135. </style
  136. >;