Browse Source

PDA生产退仓、生产领退料现在用存储过程形式

master
shenzhouyu 4 weeks ago
parent
commit
451bdebf35
  1. 3
      src/api/production/production-return2.js
  2. 13
      src/views/modules/production/productionIssueReturnList.vue
  3. 13
      src/views/modules/production/productionQualifiedReturn.vue

3
src/api/production/production-return2.js

@ -21,4 +21,5 @@ export const getMaterialList = data => createAPI(`productionReturn/getMaterialLi
* 获取已扫描标签列表(从缓存表) * 获取已扫描标签列表(从缓存表)
* @param {Object} data - 查询参数 {site, buNo, inboundNo} * @param {Object} data - 查询参数 {site, buNo, inboundNo}
*/ */
export const getScannedLabelList = data => createAPI(`productionReturn/getScannedLabelList`, 'post', data)
export const getScannedLabelList = data => createAPI(`productionReturn/getScannedLabelList`, 'post', data)
export const getQualifiedReturnListByProcedure = data => createAPI(`productionReturn/getQualifiedReturnListByProcedure`, 'post', data)

13
src/views/modules/production/productionIssueReturnList.vue

@ -74,7 +74,7 @@
</template> </template>
<script> <script>
import { getQualifiedReturnList } from "@/api/production/production-return2.js";
import { getQualifiedReturnListByProcedure } from "@/api/production/production-return2.js";
import { getCurrentWarehouse } from '@/utils' import { getCurrentWarehouse } from '@/utils'
import moment from 'moment'; import moment from 'moment';
@ -94,6 +94,7 @@ export default {
// 处理搜索 // 处理搜索
handleSearch() { handleSearch() {
if (this.loading) return;
if (this.searchCode.trim()) { if (this.searchCode.trim()) {
this.searchQualifiedList(this.searchCode.trim()); this.searchQualifiedList(this.searchCode.trim());
} else { } else {
@ -104,12 +105,14 @@ export default {
// 搜索特定入库单 // 搜索特定入库单
searchQualifiedList(searchCode) { searchQualifiedList(searchCode) {
if (this.loading) return;
const currentWarehouse = getCurrentWarehouse(); const currentWarehouse = getCurrentWarehouse();
if (!currentWarehouse) { if (!currentWarehouse) {
this.$message.error('请先选择仓库'); this.$message.error('请先选择仓库');
return; return;
} }
this.qualifiedList = [];
this.loading = true; this.loading = true;
this.hasSearched = true; this.hasSearched = true;
const params = { const params = {
@ -119,20 +122,20 @@ export default {
status: '待入库' status: '待入库'
}; };
getQualifiedReturnList(params).then(({ data }) => {
getQualifiedReturnListByProcedure(params).then(({ data }) => {
this.loading = false; this.loading = false;
if (data && data.code === 0) { if (data && data.code === 0) {
if (data.data.length === 0) {
if (!data.data || data.data.length === 0) {
this.$message.warning('未找到匹配的入库单'); this.$message.warning('未找到匹配的入库单');
} }
this.qualifiedList = data.data || []; this.qualifiedList = data.data || [];
} else { } else {
this.$message.error(data.msg || '查询失败');
this.$message.error((data && data.msg) || '查询失败');
} }
}).catch(error => { }).catch(error => {
this.loading = false; this.loading = false;
console.error('搜索失败:', error); console.error('搜索失败:', error);
this.$message.error('查询失败');
this.$message.error(error.response && error.response.status === 504 ? '查询超时,请稍后重试或联系管理员' : '查询失败');
}); });
}, },

13
src/views/modules/production/productionQualifiedReturn.vue

@ -74,7 +74,7 @@
</template> </template>
<script> <script>
import { getQualifiedReturnList } from "@/api/production/production-return2.js";
import { getQualifiedReturnListByProcedure } from "@/api/production/production-return2.js";
import { getCurrentWarehouse } from '@/utils' import { getCurrentWarehouse } from '@/utils'
import moment from 'moment'; import moment from 'moment';
@ -94,6 +94,7 @@ export default {
// 处理搜索 // 处理搜索
handleSearch() { handleSearch() {
if (this.loading) return;
if (this.searchCode.trim()) { if (this.searchCode.trim()) {
this.searchQualifiedList(this.searchCode.trim()); this.searchQualifiedList(this.searchCode.trim());
} else { } else {
@ -104,12 +105,14 @@ export default {
// 搜索特定入库单 // 搜索特定入库单
searchQualifiedList(searchCode) { searchQualifiedList(searchCode) {
if (this.loading) return;
const currentWarehouse = getCurrentWarehouse(); const currentWarehouse = getCurrentWarehouse();
if (!currentWarehouse) { if (!currentWarehouse) {
this.$message.error('请先选择仓库'); this.$message.error('请先选择仓库');
return; return;
} }
this.qualifiedList = [];
this.loading = true; this.loading = true;
this.hasSearched = true; this.hasSearched = true;
const params = { const params = {
@ -119,20 +122,20 @@ export default {
status: '待入库' status: '待入库'
}; };
getQualifiedReturnList(params).then(({ data }) => {
getQualifiedReturnListByProcedure(params).then(({ data }) => {
this.loading = false; this.loading = false;
if (data && data.code === 0) { if (data && data.code === 0) {
if (data.data.length === 0) {
if (!data.data || data.data.length === 0) {
this.$message.warning('未找到匹配的入库单'); this.$message.warning('未找到匹配的入库单');
} }
this.qualifiedList = data.data || []; this.qualifiedList = data.data || [];
} else { } else {
this.$message.error(data.msg || '查询失败');
this.$message.error((data && data.msg) || '查询失败');
} }
}).catch(error => { }).catch(error => {
this.loading = false; this.loading = false;
console.error('搜索失败:', error); console.error('搜索失败:', error);
this.$message.error('查询失败');
this.$message.error(error.response && error.response.status === 504 ? '查询超时,请稍后重试或联系管理员' : '查询失败');
}); });
}, },

Loading…
Cancel
Save