no message
							parent
							
								
									3c7f2eb212
								
							
						
					
					
						commit
						8840675dc5
					
				| 
						 | 
					@ -41,6 +41,8 @@
 | 
				
			||||||
        "vue3-json-viewer": "2.2.2"
 | 
					        "vue3-json-viewer": "2.2.2"
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      "devDependencies": {
 | 
					      "devDependencies": {
 | 
				
			||||||
 | 
					        "@types/lodash": "^4.17.16",
 | 
				
			||||||
 | 
					        "@types/pinyin": "^2.10.2",
 | 
				
			||||||
        "@vitejs/plugin-vue": "5.1.4",
 | 
					        "@vitejs/plugin-vue": "5.1.4",
 | 
				
			||||||
        "@vitejs/plugin-vue-jsx": "4.0.1",
 | 
					        "@vitejs/plugin-vue-jsx": "4.0.1",
 | 
				
			||||||
        "@vue/eslint-config-prettier": "^10.0.0",
 | 
					        "@vue/eslint-config-prettier": "^10.0.0",
 | 
				
			||||||
| 
						 | 
					@ -1588,6 +1590,12 @@
 | 
				
			||||||
      "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==",
 | 
					      "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==",
 | 
				
			||||||
      "dev": true
 | 
					      "dev": true
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					    "node_modules/@types/lodash": {
 | 
				
			||||||
 | 
					      "version": "4.17.16",
 | 
				
			||||||
 | 
					      "resolved": "https://registry.npmmirror.com/@types/lodash/-/lodash-4.17.16.tgz",
 | 
				
			||||||
 | 
					      "integrity": "sha512-HX7Em5NYQAXKW+1T+FiuG27NGwzJfCX3s1GjOa7ujxZa52kjJLOr4FUxT+giF6Tgxv1e+/czV/iTtBw27WTU9g==",
 | 
				
			||||||
 | 
					      "dev": true
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
    "node_modules/@types/minimist": {
 | 
					    "node_modules/@types/minimist": {
 | 
				
			||||||
      "version": "1.2.5",
 | 
					      "version": "1.2.5",
 | 
				
			||||||
      "resolved": "https://registry.npmmirror.com/@types/minimist/-/minimist-1.2.5.tgz",
 | 
					      "resolved": "https://registry.npmmirror.com/@types/minimist/-/minimist-1.2.5.tgz",
 | 
				
			||||||
| 
						 | 
					@ -1615,6 +1623,12 @@
 | 
				
			||||||
      "resolved": "https://registry.npmmirror.com/@types/parse-json/-/parse-json-4.0.2.tgz",
 | 
					      "resolved": "https://registry.npmmirror.com/@types/parse-json/-/parse-json-4.0.2.tgz",
 | 
				
			||||||
      "integrity": "sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw=="
 | 
					      "integrity": "sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw=="
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					    "node_modules/@types/pinyin": {
 | 
				
			||||||
 | 
					      "version": "2.10.2",
 | 
				
			||||||
 | 
					      "resolved": "https://registry.npmmirror.com/@types/pinyin/-/pinyin-2.10.2.tgz",
 | 
				
			||||||
 | 
					      "integrity": "sha512-jLzlRkaLRLg+lgYPjOuP3HX2cozUkhXls5GTXopsKuKJ9lDGlIAb88OoIztH6TbNUsoJnl/7e/kjaumA5IKKJg==",
 | 
				
			||||||
 | 
					      "dev": true
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
    "node_modules/@typescript-eslint/eslint-plugin": {
 | 
					    "node_modules/@typescript-eslint/eslint-plugin": {
 | 
				
			||||||
      "version": "8.29.1",
 | 
					      "version": "8.29.1",
 | 
				
			||||||
      "resolved": "https://registry.npmmirror.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.29.1.tgz",
 | 
					      "resolved": "https://registry.npmmirror.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.29.1.tgz",
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -49,6 +49,8 @@
 | 
				
			||||||
    "vue3-json-viewer": "2.2.2"
 | 
					    "vue3-json-viewer": "2.2.2"
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  "devDependencies": {
 | 
					  "devDependencies": {
 | 
				
			||||||
 | 
					    "@types/lodash": "^4.17.16",
 | 
				
			||||||
 | 
					    "@types/pinyin": "^2.10.2",
 | 
				
			||||||
    "@vitejs/plugin-vue": "5.1.4",
 | 
					    "@vitejs/plugin-vue": "5.1.4",
 | 
				
			||||||
    "@vitejs/plugin-vue-jsx": "4.0.1",
 | 
					    "@vitejs/plugin-vue-jsx": "4.0.1",
 | 
				
			||||||
    "@vue/eslint-config-prettier": "^10.0.0",
 | 
					    "@vue/eslint-config-prettier": "^10.0.0",
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -6,27 +6,27 @@
 | 
				
			||||||
 * @Copyright  友仓
 | 
					 * @Copyright  友仓
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
import {postRequest, getRequest,getDownload} from '/@/lib/axios';
 | 
					import {postRequest, getRequest,getDownload} from '/@/lib/axios';
 | 
				
			||||||
 | 
					import {AddressAddOrUpdateForm, AddressQueryForm,} from "/@/api/business/wms/base/address/address";
 | 
				
			||||||
export const addressApi = {
 | 
					export const addressApi = {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * 分页查询  @author  hj
 | 
					     * 分页查询  @author  hj
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    queryPage: (param:object) => {
 | 
					    queryPage: (param:AddressQueryForm) => {
 | 
				
			||||||
        return postRequest('/address/queryPage', param);
 | 
					        return postRequest('/address/queryPage', param);
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * 增加  @author  hj
 | 
					     * 增加  @author  hj
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    add: (param:object) => {
 | 
					    add: (param:AddressAddOrUpdateForm) => {
 | 
				
			||||||
        return postRequest('/address/add', param);
 | 
					        return postRequest('/address/add', param);
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * 修改  @author  hj
 | 
					     * 修改  @author  hj
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    update: (param:object) => {
 | 
					    update: (param:AddressAddOrUpdateForm) => {
 | 
				
			||||||
        return postRequest('/address/update', param);
 | 
					        return postRequest('/address/update', param);
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,39 @@
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * 收货单位-定义TS类型
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					//查询类型定义
 | 
				
			||||||
 | 
					export interface AddressQueryForm {
 | 
				
			||||||
 | 
					    addressId?: number;
 | 
				
			||||||
 | 
					    pageNum: number;
 | 
				
			||||||
 | 
					    pageSize: number;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					//表格数据类型定义
 | 
				
			||||||
 | 
					export interface AddressTableDate {
 | 
				
			||||||
 | 
					    addressId: number;
 | 
				
			||||||
 | 
					    name: string;
 | 
				
			||||||
 | 
					    person: string;
 | 
				
			||||||
 | 
					    telephone: string;
 | 
				
			||||||
 | 
					    address: string;
 | 
				
			||||||
 | 
					    createTime: Date;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					//新增或修改表单类型定义
 | 
				
			||||||
 | 
					export interface AddressAddOrUpdateForm {
 | 
				
			||||||
 | 
					    addressId?: number;
 | 
				
			||||||
 | 
					    name?: string;
 | 
				
			||||||
 | 
					    person?: string;
 | 
				
			||||||
 | 
					    telephone?: string;
 | 
				
			||||||
 | 
					    address?: string;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					//下拉查询
 | 
				
			||||||
 | 
					interface AddressSelect {
 | 
				
			||||||
 | 
					    addressId: number;
 | 
				
			||||||
 | 
					    name: string;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -45,7 +45,7 @@
 | 
				
			||||||
import {SmartLoading} from '/@/components/framework/smart-loading';
 | 
					import {SmartLoading} from '/@/components/framework/smart-loading';
 | 
				
			||||||
import {addressApi} from '/@/api/business/wms/base/address/address-api';
 | 
					import {addressApi} from '/@/api/business/wms/base/address/address-api';
 | 
				
			||||||
import {smartSentry} from '/@/lib/smart-sentry';
 | 
					import {smartSentry} from '/@/lib/smart-sentry';
 | 
				
			||||||
 | 
					import {AddressAddOrUpdateForm} from "/@/api/business/wms/base/address/address";
 | 
				
			||||||
// ------------------------ 事件 ------------------------
 | 
					// ------------------------ 事件 ------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const emits = defineEmits(['reloadList']);
 | 
					const emits = defineEmits(['reloadList']);
 | 
				
			||||||
| 
						 | 
					@ -54,7 +54,7 @@
 | 
				
			||||||
// 是否显示
 | 
					// 是否显示
 | 
				
			||||||
const visibleFlag = ref(false);
 | 
					const visibleFlag = ref(false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  function show(rowData: object) {
 | 
					function show(rowData: AddressAddOrUpdateForm) {
 | 
				
			||||||
  Object.assign(form, formDefault);
 | 
					  Object.assign(form, formDefault);
 | 
				
			||||||
  if (rowData && !_.isEmpty(rowData)) {
 | 
					  if (rowData && !_.isEmpty(rowData)) {
 | 
				
			||||||
    Object.assign(form, rowData);
 | 
					    Object.assign(form, rowData);
 | 
				
			||||||
| 
						 | 
					@ -79,7 +79,7 @@
 | 
				
			||||||
// 组件ref
 | 
					// 组件ref
 | 
				
			||||||
const formRef = ref();
 | 
					const formRef = ref();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const formDefault = {
 | 
					const formDefault: AddressAddOrUpdateForm = {
 | 
				
			||||||
  addressId: undefined, //收货地址id
 | 
					  addressId: undefined, //收货地址id
 | 
				
			||||||
  name: undefined, //名称/单位
 | 
					  name: undefined, //名称/单位
 | 
				
			||||||
  person: undefined, //联系人
 | 
					  person: undefined, //联系人
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -97,8 +97,6 @@
 | 
				
			||||||
        <template v-if="column.dataIndex === 'action'">
 | 
					        <template v-if="column.dataIndex === 'action'">
 | 
				
			||||||
          <div class="smart-table-operate">
 | 
					          <div class="smart-table-operate">
 | 
				
			||||||
            <a-space>
 | 
					            <a-space>
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
              <a-button @click="showForm(record)" type="primary" ghost style="width:60px;height: 32px"
 | 
					              <a-button @click="showForm(record)" type="primary" ghost style="width:60px;height: 32px"
 | 
				
			||||||
                        v-privilege="'address:update'">
 | 
					                        v-privilege="'address:update'">
 | 
				
			||||||
                编辑
 | 
					                编辑
 | 
				
			||||||
| 
						 | 
					@ -170,7 +168,7 @@
 | 
				
			||||||
</template>
 | 
					</template>
 | 
				
			||||||
<script setup lang="ts">
 | 
					<script setup lang="ts">
 | 
				
			||||||
import {reactive, ref, onMounted} from 'vue';
 | 
					import {reactive, ref, onMounted} from 'vue';
 | 
				
			||||||
import {message, Modal, UploadFile} from 'ant-design-vue';
 | 
					import {message, Modal, UploadFile, TableColumnType} from 'ant-design-vue';
 | 
				
			||||||
import {SmartLoading} from '/@/components/framework/smart-loading';
 | 
					import {SmartLoading} from '/@/components/framework/smart-loading';
 | 
				
			||||||
import {addressApi} from '/@/api/business/wms/base/address/address-api';
 | 
					import {addressApi} from '/@/api/business/wms/base/address/address-api';
 | 
				
			||||||
import {PAGE_SIZE_OPTIONS} from '/@/constants/common-const';
 | 
					import {PAGE_SIZE_OPTIONS} from '/@/constants/common-const';
 | 
				
			||||||
| 
						 | 
					@ -180,10 +178,17 @@ import AddressForm from '/@/views/business/wms/base/address/address-form.vue';
 | 
				
			||||||
import {TABLE_ID_CONST} from "/@/constants/support/table-id-const";
 | 
					import {TABLE_ID_CONST} from "/@/constants/support/table-id-const";
 | 
				
			||||||
import AddressSelect from "/@/views/business/wms/base/address/address-select.vue";
 | 
					import AddressSelect from "/@/views/business/wms/base/address/address-select.vue";
 | 
				
			||||||
import {fileApi} from "/@/api/support/file-api";
 | 
					import {fileApi} from "/@/api/support/file-api";
 | 
				
			||||||
 | 
					import {AddressAddOrUpdateForm, AddressQueryForm, AddressTableDate} from "/@/api/business/wms/base/address/address";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// ---------------------------- 表格列 ----------------------------
 | 
					// ---------------------------- 表格配置 ----------------------------
 | 
				
			||||||
 | 
					// 表格加载loading
 | 
				
			||||||
const columns = ref([
 | 
					const tableLoading = ref(false);
 | 
				
			||||||
 | 
					// 表格数据
 | 
				
			||||||
 | 
					const tableData = ref(<AddressTableDate[]>[]);
 | 
				
			||||||
 | 
					// 总数
 | 
				
			||||||
 | 
					const total = ref(0);
 | 
				
			||||||
 | 
					//列
 | 
				
			||||||
 | 
					const columns = ref<TableColumnType<AddressTableDate>[]>([
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    title: '收货地址id',
 | 
					    title: '收货地址id',
 | 
				
			||||||
    dataIndex: 'addressId',
 | 
					    dataIndex: 'addressId',
 | 
				
			||||||
| 
						 | 
					@ -224,20 +229,13 @@ const columns = ref([
 | 
				
			||||||
]);
 | 
					]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// ---------------------------- 查询数据表单和方法 ----------------------------
 | 
					// ---------------------------- 查询数据表单和方法 ----------------------------
 | 
				
			||||||
 | 
					// 查询表单form
 | 
				
			||||||
const queryFormState = {
 | 
					const queryFormState: AddressQueryForm = {
 | 
				
			||||||
  addressId: undefined, //收货单位
 | 
					  addressId: undefined, //收货单位
 | 
				
			||||||
  pageNum: 1,
 | 
					  pageNum: 1,
 | 
				
			||||||
  pageSize: 10,
 | 
					  pageSize: 10,
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
// 查询表单form
 | 
					const queryForm = reactive<AddressQueryForm>({...queryFormState});
 | 
				
			||||||
const queryForm = reactive({...queryFormState});
 | 
					 | 
				
			||||||
// 表格加载loading
 | 
					 | 
				
			||||||
const tableLoading = ref(false);
 | 
					 | 
				
			||||||
// 表格数据
 | 
					 | 
				
			||||||
const tableData = ref([]);
 | 
					 | 
				
			||||||
// 总数
 | 
					 | 
				
			||||||
const total = ref(0);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
// 重置查询条件
 | 
					// 重置查询条件
 | 
				
			||||||
function resetQuery() {
 | 
					function resetQuery() {
 | 
				
			||||||
| 
						 | 
					@ -254,7 +252,7 @@ function onSearch() {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//选择收货单位
 | 
					//选择收货单位
 | 
				
			||||||
function changeAddressSelect(selectValue: any) {
 | 
					function changeAddressSelect(selectValue: { addressId: number }) {
 | 
				
			||||||
  if (selectValue) {
 | 
					  if (selectValue) {
 | 
				
			||||||
    queryForm.addressId = selectValue.addressId;
 | 
					    queryForm.addressId = selectValue.addressId;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
| 
						 | 
					@ -275,18 +273,16 @@ async function queryData() {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
onMounted(queryData);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// ---------------------------- 添加/修改 ----------------------------
 | 
					// ---------------------------- 添加/修改 ----------------------------
 | 
				
			||||||
const formRef = ref();
 | 
					const formRef = ref();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function showForm(data: object) {
 | 
					function showForm(data: AddressAddOrUpdateForm) {
 | 
				
			||||||
  formRef.value.show(data);
 | 
					  formRef.value.show(data);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// ---------------------------- 单个删除 ----------------------------
 | 
					// ---------------------------- 单个删除 ----------------------------
 | 
				
			||||||
//确认删除
 | 
					//确认删除
 | 
				
			||||||
function onDelete(data: object) {
 | 
					function onDelete(data: AddressTableDate) {
 | 
				
			||||||
  Modal.confirm({
 | 
					  Modal.confirm({
 | 
				
			||||||
    title: '提示',
 | 
					    title: '提示',
 | 
				
			||||||
    content: '确定要删除选吗?',
 | 
					    content: '确定要删除选吗?',
 | 
				
			||||||
| 
						 | 
					@ -302,7 +298,7 @@ function onDelete(data: object) {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//请求删除
 | 
					//请求删除
 | 
				
			||||||
async function requestDelete(data: any) {
 | 
					async function requestDelete(data:AddressTableDate) {
 | 
				
			||||||
  SmartLoading.show();
 | 
					  SmartLoading.show();
 | 
				
			||||||
  try {
 | 
					  try {
 | 
				
			||||||
    await addressApi.delete(data.addressId);
 | 
					    await addressApi.delete(data.addressId);
 | 
				
			||||||
| 
						 | 
					@ -318,9 +314,9 @@ async function requestDelete(data: any) {
 | 
				
			||||||
// ---------------------------- 批量删除 ----------------------------
 | 
					// ---------------------------- 批量删除 ----------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// 选择表格行
 | 
					// 选择表格行
 | 
				
			||||||
const selectedRowKeyList = ref([]);
 | 
					const selectedRowKeyList = ref<number[]>([]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function onSelectChange(selectedRowKeys: any) {
 | 
					function onSelectChange(selectedRowKeys: number[]) {
 | 
				
			||||||
  selectedRowKeyList.value = selectedRowKeys;
 | 
					  selectedRowKeyList.value = selectedRowKeys;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -347,6 +343,7 @@ async function requestBatchDelete() {
 | 
				
			||||||
    await addressApi.batchDelete(selectedRowKeyList.value);
 | 
					    await addressApi.batchDelete(selectedRowKeyList.value);
 | 
				
			||||||
    message.success('删除成功');
 | 
					    message.success('删除成功');
 | 
				
			||||||
    await queryData();
 | 
					    await queryData();
 | 
				
			||||||
 | 
					    selectedRowKeyList.value = [];
 | 
				
			||||||
  } catch (e) {
 | 
					  } catch (e) {
 | 
				
			||||||
    smartSentry.captureError(e);
 | 
					    smartSentry.captureError(e);
 | 
				
			||||||
  } finally {
 | 
					  } finally {
 | 
				
			||||||
| 
						 | 
					@ -406,8 +403,13 @@ async function onImportAddress() {
 | 
				
			||||||
  SmartLoading.show();
 | 
					  SmartLoading.show();
 | 
				
			||||||
  try {
 | 
					  try {
 | 
				
			||||||
    const response = await addressApi.importAddress(formData);
 | 
					    const response = await addressApi.importAddress(formData);
 | 
				
			||||||
    const {success} = JSON.parse(response.msg);
 | 
					    const {success, error} = JSON.parse(response.data);
 | 
				
			||||||
 | 
					    if (success) {
 | 
				
			||||||
      message.success(success);
 | 
					      message.success(success);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    if (error) {
 | 
				
			||||||
 | 
					      message.error(error);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    importModalShowFlag.value = false;
 | 
					    importModalShowFlag.value = false;
 | 
				
			||||||
    await queryData();
 | 
					    await queryData();
 | 
				
			||||||
  } catch (e) {
 | 
					  } catch (e) {
 | 
				
			||||||
| 
						 | 
					@ -421,4 +423,7 @@ async function onImportAddress() {
 | 
				
			||||||
function onExportAddress() {
 | 
					function onExportAddress() {
 | 
				
			||||||
  addressApi.exportAddress();
 | 
					  addressApi.exportAddress();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					onMounted(queryData);
 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -25,6 +25,8 @@
 | 
				
			||||||
<script setup lang="ts">
 | 
					<script setup lang="ts">
 | 
				
			||||||
import {onMounted, ref, watch} from 'vue';
 | 
					import {onMounted, ref, watch} from 'vue';
 | 
				
			||||||
import {addressApi} from "/@/api/business/wms/base/address/address-api";
 | 
					import {addressApi} from "/@/api/business/wms/base/address/address-api";
 | 
				
			||||||
 | 
					import {AddressSelect} from "/@/api/business/wms/base/address/address";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const props = defineProps({
 | 
					const props = defineProps({
 | 
				
			||||||
  value: [Number, String, Object, Array],
 | 
					  value: [Number, String, Object, Array],
 | 
				
			||||||
| 
						 | 
					@ -50,7 +52,8 @@ const props = defineProps({
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const addressList = ref([]);
 | 
					const addressList = ref<AddressSelect[]>([]);
 | 
				
			||||||
 | 
					const selectValue = ref(props.value);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
async function queryData() {
 | 
					async function queryData() {
 | 
				
			||||||
  let res = await addressApi.queryAddress({});
 | 
					  let res = await addressApi.queryAddress({});
 | 
				
			||||||
| 
						 | 
					@ -59,8 +62,6 @@ async function queryData() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const emit = defineEmits(['update:value', 'change']);
 | 
					const emit = defineEmits(['update:value', 'change']);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const selectValue = ref(props.value);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// 箭头value变化
 | 
					// 箭头value变化
 | 
				
			||||||
watch(
 | 
					watch(
 | 
				
			||||||
    () => props.value,
 | 
					    () => props.value,
 | 
				
			||||||
| 
						 | 
					@ -69,19 +70,20 @@ watch(
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
);
 | 
					);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function getSelectedAddress(value: number | number[] | undefined): AddressSelect | AddressSelect[] | undefined {
 | 
				
			||||||
function handleChange(value: any) {
 | 
					 | 
				
			||||||
  let selectedAddress: any[] | any;
 | 
					 | 
				
			||||||
  if (Array.isArray(value)) {
 | 
					  if (Array.isArray(value)) {
 | 
				
			||||||
    // 多选情况
 | 
					    return value
 | 
				
			||||||
    selectedAddress = value.map((id) => addressList.value.find((item: any) => item.addressId === id)).filter(Boolean);
 | 
					        .map(id => addressList.value.find(item => item.addressId === id))
 | 
				
			||||||
 | 
					        .filter((item): item is AddressSelect => Boolean(item));
 | 
				
			||||||
  } else {
 | 
					  } else {
 | 
				
			||||||
    // 单选情况
 | 
					    return addressList.value.find(item => item.addressId === value);
 | 
				
			||||||
    selectedAddress = addressList.value.find((item: any) => item.addressId === value);
 | 
					 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function handleChange(value: number | number[] | undefined) {
 | 
				
			||||||
 | 
					  const selectedAddress = getSelectedAddress(value);
 | 
				
			||||||
  emit('update:value', value);
 | 
					  emit('update:value', value);
 | 
				
			||||||
  emit('change', selectedAddress);
 | 
					  emit('change', selectedAddress);
 | 
				
			||||||
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -46,7 +46,7 @@
 | 
				
			||||||
        </a-col>
 | 
					        </a-col>
 | 
				
			||||||
        <a-col :span="12">
 | 
					        <a-col :span="12">
 | 
				
			||||||
          <a-form-item label="物料类型" name="itemType">
 | 
					          <a-form-item label="物料类型" name="itemType">
 | 
				
			||||||
            <DictSelect width="100%" :dict-code="'ITEM_TYPE'" v-model:value="form.unit"  />
 | 
					            <DictSelect width="100%" :dict-code="'ITEM_TYPE'" v-model:value="form.itemType"  />
 | 
				
			||||||
          </a-form-item>
 | 
					          </a-form-item>
 | 
				
			||||||
        </a-col>
 | 
					        </a-col>
 | 
				
			||||||
      </a-row>
 | 
					      </a-row>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -452,8 +452,13 @@ async function onImportItems() {
 | 
				
			||||||
  SmartLoading.show();
 | 
					  SmartLoading.show();
 | 
				
			||||||
  try {
 | 
					  try {
 | 
				
			||||||
    const response = await itemApi.importItems(formData);
 | 
					    const response = await itemApi.importItems(formData);
 | 
				
			||||||
    const {success} = JSON.parse(response.msg);
 | 
					    const {success, error} = JSON.parse(response.data);
 | 
				
			||||||
 | 
					    if (success) {
 | 
				
			||||||
      message.success(success);
 | 
					      message.success(success);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    if (error) {
 | 
				
			||||||
 | 
					      message.error(error);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    importModalShowFlag.value = false;
 | 
					    importModalShowFlag.value = false;
 | 
				
			||||||
    await queryData();
 | 
					    await queryData();
 | 
				
			||||||
  } catch (e) {
 | 
					  } catch (e) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -536,8 +536,13 @@ async function onImportLocations() {
 | 
				
			||||||
  SmartLoading.show();
 | 
					  SmartLoading.show();
 | 
				
			||||||
  try {
 | 
					  try {
 | 
				
			||||||
    const response = await locationApi.importLocations(formData);
 | 
					    const response = await locationApi.importLocations(formData);
 | 
				
			||||||
    const {success} = JSON.parse(response.msg);
 | 
					    const {success, error} = JSON.parse(response.data);
 | 
				
			||||||
 | 
					    if (success) {
 | 
				
			||||||
      message.success(success);
 | 
					      message.success(success);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    if (error) {
 | 
				
			||||||
 | 
					      message.error(error);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    importModalShowFlag.value = false;
 | 
					    importModalShowFlag.value = false;
 | 
				
			||||||
    await queryData();
 | 
					    await queryData();
 | 
				
			||||||
  } catch (e) {
 | 
					  } catch (e) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -467,8 +467,13 @@ async function onImportStocks() {
 | 
				
			||||||
  SmartLoading.show();
 | 
					  SmartLoading.show();
 | 
				
			||||||
  try {
 | 
					  try {
 | 
				
			||||||
    const response = await stockApi.importStocks(formData);
 | 
					    const response = await stockApi.importStocks(formData);
 | 
				
			||||||
    const {success} = JSON.parse(response.msg);
 | 
					    const {success, error} = JSON.parse(response.data);
 | 
				
			||||||
 | 
					    if (success) {
 | 
				
			||||||
      message.success(success);
 | 
					      message.success(success);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    if (error) {
 | 
				
			||||||
 | 
					      message.error(error);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    importModalShowFlag.value = false;
 | 
					    importModalShowFlag.value = false;
 | 
				
			||||||
    await queryData();
 | 
					    await queryData();
 | 
				
			||||||
  } catch (e) {
 | 
					  } catch (e) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -109,20 +109,19 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        <template v-if="column.dataIndex === 'action'">
 | 
					        <template v-if="column.dataIndex === 'action'">
 | 
				
			||||||
          <div class="smart-table-operate">
 | 
					          <div class="smart-table-operate">
 | 
				
			||||||
            <a-button @click="showForm(record)" type="link" v-privilege="'asn:update'">
 | 
					            <a-space>
 | 
				
			||||||
              <template #icon>
 | 
					              <a-button @click="showForm(record)" type="primary" ghost style="width:60px;height: 32px"
 | 
				
			||||||
                <EditOutlined/>
 | 
					                        v-privilege="'asn:update'">
 | 
				
			||||||
              </template>
 | 
					
 | 
				
			||||||
                编辑
 | 
					                编辑
 | 
				
			||||||
              </a-button>
 | 
					              </a-button>
 | 
				
			||||||
            <a-button @click="onDelete(record)" danger type="link"
 | 
					              <a-button @click="onDelete(record)" type="primary" danger ghost style="width:60px;height: 32px"
 | 
				
			||||||
                        :disabled="record.orderQuantity>0 && record.orderQuantity-record.receivedQuantity==0"
 | 
					                        :disabled="record.orderQuantity>0 && record.orderQuantity-record.receivedQuantity==0"
 | 
				
			||||||
                        v-privilege="'asn:delete'">
 | 
					                        v-privilege="'asn:delete'">
 | 
				
			||||||
              <template #icon>
 | 
					
 | 
				
			||||||
                <DeleteOutlined/>
 | 
					 | 
				
			||||||
              </template>
 | 
					 | 
				
			||||||
                删除
 | 
					                删除
 | 
				
			||||||
              </a-button>
 | 
					              </a-button>
 | 
				
			||||||
 | 
					            </a-space>
 | 
				
			||||||
          </div>
 | 
					          </div>
 | 
				
			||||||
        </template>
 | 
					        </template>
 | 
				
			||||||
      </template>
 | 
					      </template>
 | 
				
			||||||
| 
						 | 
					@ -220,9 +219,9 @@ const columns = ref([
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    title: '操作',
 | 
					    title: '操作',
 | 
				
			||||||
    dataIndex: 'action',
 | 
					    dataIndex: 'action',
 | 
				
			||||||
    align: 'center',
 | 
					 | 
				
			||||||
    fixed: 'right',
 | 
					    fixed: 'right',
 | 
				
			||||||
    width: 140,
 | 
					    align: 'center',
 | 
				
			||||||
 | 
					    width: 150,
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
]);
 | 
					]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -117,7 +117,7 @@ async function save() {
 | 
				
			||||||
  SmartLoading.show();
 | 
					  SmartLoading.show();
 | 
				
			||||||
  try {
 | 
					  try {
 | 
				
			||||||
    const response = await receiveApi.batchReceive(form);
 | 
					    const response = await receiveApi.batchReceive(form);
 | 
				
			||||||
    const {error, success} = JSON.parse(response.msg);
 | 
					    const {error, success} = JSON.parse(response.data);
 | 
				
			||||||
    if (error) {
 | 
					    if (error) {
 | 
				
			||||||
      message.error(error);
 | 
					      message.error(error);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -242,7 +242,7 @@ async function requestDelete(data: any) {
 | 
				
			||||||
  SmartLoading.show();
 | 
					  SmartLoading.show();
 | 
				
			||||||
  try {
 | 
					  try {
 | 
				
			||||||
    const response = await asnDetailApi.delete(data.asnDetailId);
 | 
					    const response = await asnDetailApi.delete(data.asnDetailId);
 | 
				
			||||||
    const {error, success} = JSON.parse(response.msg);
 | 
					    const {error, success} = JSON.parse(response.data);
 | 
				
			||||||
    if (error) {
 | 
					    if (error) {
 | 
				
			||||||
      message.error(error);
 | 
					      message.error(error);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					@ -278,7 +278,7 @@ async function requestBatchDelete() {
 | 
				
			||||||
  try {
 | 
					  try {
 | 
				
			||||||
    SmartLoading.show();
 | 
					    SmartLoading.show();
 | 
				
			||||||
    const response = await asnDetailApi.batchDelete(selectedRowKeyList.value);
 | 
					    const response = await asnDetailApi.batchDelete(selectedRowKeyList.value);
 | 
				
			||||||
    const {error, success} = JSON.parse(response.msg);
 | 
					    const {error, success} = JSON.parse(response.data);
 | 
				
			||||||
    if (error) {
 | 
					    if (error) {
 | 
				
			||||||
      message.error(error);
 | 
					      message.error(error);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -196,7 +196,7 @@ async function requestBatchReturn() {
 | 
				
			||||||
      taskIds: selectedRowKeyList.value,
 | 
					      taskIds: selectedRowKeyList.value,
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
    const response = await receiveApi.batchReturn(param);
 | 
					    const response = await receiveApi.batchReturn(param);
 | 
				
			||||||
    const {error, success} = JSON.parse(response.msg);
 | 
					    const {error, success} = JSON.parse(response.data);
 | 
				
			||||||
    if (error) {
 | 
					    if (error) {
 | 
				
			||||||
      message.error(error);
 | 
					      message.error(error);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue