diff --git a/src/api/StockIn/index.ts b/src/api/StockIn/index.ts
index 438c974..af152ad 100644
--- a/src/api/StockIn/index.ts
+++ b/src/api/StockIn/index.ts
@@ -47,18 +47,6 @@ export function getBarCode(ChangeParams: any) {
})
}
-/**
- * 无单据入库确定
- * @param ChangeParams
- */
-export function QTRCommit(ChangeParams: any) {
- return request({
- url: '/api/NoInvoice/QTRCommit',
- method: 'post',
- data: ChangeParams
- })
-}
-
export function CreateBox(ChangeParams: any) {
return request({
url: '/api/MaterialReceiveAct/TrackOutBox',
@@ -187,3 +175,29 @@ export function confirm(data: any) {
});
}
+/**
+ * 盘盈入库
+ * @param data
+ * @returns
+ */
+export function QTRCommit(data: any) {
+ return request({
+ url: '/api/MaterialReceiveAct/QTRCommit',
+ method: 'post',
+ data: data
+ })
+}
+
+/**
+ * 盘亏出库
+ * @param data
+ * @returns
+ */
+export function QTCCommit(data: any) {
+ return request({
+ url: '/api/MaterialReceiveAct/QTCCommit',
+ method: 'post',
+ data: data
+ })
+}
+
diff --git a/src/api/check/index.ts b/src/api/check/index.ts
index 7f142ea..d25a3fe 100644
--- a/src/api/check/index.ts
+++ b/src/api/check/index.ts
@@ -47,12 +47,13 @@ export function createCheckPlan(data: any) {
/**
* 获取成本中心
- * @param data
+ * @param params
* @returns
*/
-export function getCostCenter() {
+export function getCostCenter(params) {
return request({
url: '/api/CostCenter/getCostCenter',
method: 'get',
+ params: params
})
}
\ No newline at end of file
diff --git a/src/views/check/auditSheet/index.vue b/src/views/check/auditSheet/index.vue
index 112cdef..368cb8a 100644
--- a/src/views/check/auditSheet/index.vue
+++ b/src/views/check/auditSheet/index.vue
@@ -217,7 +217,7 @@ function audit() {
}
function getCost(){
- getCostCenter().then((res: any) => {
+ getCostCenter({erpFactory: JSON.parse(localStorage.get('orgNo'))}).then((res: any) => {
state.costCenterList = res.data;
})
}
diff --git a/src/views/check/auxiliaryOutIn/index.vue b/src/views/check/auxiliaryOutIn/index.vue
index 5c6c5b9..577d458 100644
--- a/src/views/check/auxiliaryOutIn/index.vue
+++ b/src/views/check/auxiliaryOutIn/index.vue
@@ -49,12 +49,19 @@
-
+
+
+
+
确认
@@ -67,7 +74,7 @@
-
-
-
+
+
@@ -104,10 +112,11 @@ import { ElForm, ElMessageBox, ElTable } from 'element-plus'
import { getQueryPageList,getQueryList } from '@/api/common'
import { areAllNotEmpty, msToDate } from '@/utils/CommonUtil';
import { localStorage } from '@/utils/storage'
-import { confirm } from '@/api/StockIn'
+import { confirm,QTRCommit,QTCCommit } from '@/api/StockIn'
import { bTableHeight } from '@/composables/calcTableHeight'
import { getORG } from '@/api/auth'
import { search } from '@/api/wareHouse'
+import { getCostCenter } from '@/api/check'
// 公共变量
const { tableContainer, tableHeight, updateTableHeight, handleResize } = bTableHeight(310)
const { proxy }: any = getCurrentInstance()
@@ -121,6 +130,7 @@ const formDataRef = ref()
// 变量
const state = reactive({
dataList: [] as any, // 表格数据
+ costCenterList: [],
loadings: false, // 更新按钮
loadingC: false,
loading: false, // 表格
@@ -130,10 +140,11 @@ const state = reactive({
ERPLocationList: [] as any,
// 货位
LocationList: [] as any,
+ commitDate: '',
// 查询参数
queryParams: {
- queryId: 'NotPosted',
- version: 'G5001',
+ queryId: 'AuxiliaryOutIn',
+ version: '00001',
params: {
siteName: localStorage.get('siteName') || 'SDK',
user: localStorage.get('userName'),
@@ -175,7 +186,6 @@ const state = reactive({
checkType: [{required: true, message: '请选择盘点类型', trigger: 'blur'}],
erpFactory: [{required: true, message: '请选择组织', trigger: 'blur'}],
erpLocation: [{required: true, message: '请选择仓库', trigger: 'blur'}],
- location: [{required: true, message: '请选择货位', trigger: 'blur'}],
materialSpecName: [{required: true, message: '请输入料号', trigger: 'blur'}],
nums: [{required: true, message: '请输入数量', trigger: 'blur'}],
},
@@ -184,8 +194,16 @@ const { queryParams, loading, ERPFactoryList, rules, rulesParam } = toRefs(state
// 加载
onMounted(() => {
+ var newDate = new Date()
+ var year = newDate.getFullYear()
+ var moth = newDate.getMonth() + 1
+ if (moth < 10) moth = '0' + moth
+ var day = newDate.getDate()
+ if (day < 10) day = '0' + day
+ state.commitDate = year + '-' + moth + '-' + day;
+
tableConfig.value.column = [
- { header: '二维码', field: 'SITENAME', hide: true },
+ { header: '二维码', field: 'MATERIALPACKINGNAME', hide: false },
{ header: '组织', field: 'ERPFACTORY', hide: false },
// { header: '组织(CN)', field: 'ERPFACTORYDESC', hide: false, width: 100 },
{ header: '仓库编码', field: 'ERPLOCATION', hide: false, width: 100 },
@@ -194,16 +212,29 @@ onMounted(() => {
// { header: '货位名称', field: 'LOCATIONNAMEDESC', hide: false, width: 100 },
{ header: '物料编号', field: 'MATERIALSPECNAME', hide: false, width: 140 },
{ header: '差异数量', field: 'MATERIALQUANTITY', hide: false, width: 140 },
+ { header: '规格', field: 'TRUEGG', hide: false, width: 100 },
{ header: '批次号', field: 'CHARGE', hide: false, width: 180 },
]
getErpFactory()
updateTableHeight()
+ getCost()
window.addEventListener('resize', handleResize)
})
-// 更新
-function submit() {
+function getCost(){
+ getCostCenter({erpFactory: JSON.parse(localStorage.get('orgNo'))}).then((res: any) => {
+ state.costCenterList = res.data;
+ })
}
+
+function resetQuery() {
+ // queryFormRef.value.resetFields();
+ state.queryParams.params.erpFactory = ''
+ state.queryParams.params.erpLocation = ''
+ state.queryParams.params.location = ''
+ state.queryParams.params.materialSpecName = ''
+}
+
// 加载组织
function getErpFactory() {
getORG({ orgNo: null }).then((res: any) => {
@@ -219,6 +250,7 @@ function ERPLocationQuery() {
state.queryParamsERPLocation.params.ERPFACTORYNAME = state.queryParams.params.erpFactory
getQueryList(state.queryParamsERPLocation).then((res: any) => {
state.ERPLocationList = res.data;
+ state.ERPLocationList.push({DESCRIPTION:'6101',ENUMVALUE: '6101'}) ;
});
}
function GetLocationListForSomeERPLocation(value: any) {
@@ -249,25 +281,103 @@ function handleInput(val: any) {
})
}
}
+ function handleSearch(){
+ if(!state.queryParams.params.CHARGE){
+ proxy.$ElMessage.warning("请输入批次号");
+ return
+ }
+ getQueryPageList(state.queryParams).then(res => {
+ if(res.code == '200'){
+ state.dataList = res.data.list;
+ } else {
+ proxy.$ElMessage.error(res.message);
+ }
+ })
+ }
function handleConfirm(){
queryFormRef.value.validate((valid: any) => {
if (!valid) {
return
}
- })
- let param = {
- ...state.queryParams.params,
- }
- state.loadingC = true
- confirm(state.queryParams.params).then(res => {
- if(res.success){
- state.dataList = res.resultObj;
- } else {
- proxy.$ElMessage.error(res.message);
- }
- state.loadingC = false
+ state.loadingC = true
+ confirm(state.queryParams.params).then(res => {
+ if(res.success){
+ state.dataList = res.resultObj;
+ resetQuery();
+ } else {
+ proxy.$ElMessage.error(res.message);
+ }
+ state.loadingC = false
+ })
})
}
+
+ // 提交
+function submit() {
+ formDataRef.value.validate((valid: any) => {
+ if (!valid) {
+ return
+ }
+ if (state.dataList.length == 0){
+ proxy.$ElMessage.warning("列表没有数据")
+ return
+ }
+ if(!state.queryParams.params.checkType){
+ proxy.$ElMessage.warning("请选择盘点类型");
+ return
+ }
+ let param = {
+ boxList: state.dataList,
+ user: localStorage.get("userId"),
+ commitDate: state.commitDate,
+ opcode: '',
+ qtc: 'Z06',
+ costName: state.updateParams.costName,
+ siteName: 'SDK'
+ }
+ // todo, STOCKSTATE
+ state.loadings = true
+ if (state.queryParams.params.checkType == "盘盈") {
+ let hasEven = state.dataList.some(item =>
+ item.STOCKSTATE != 'Created'
+ )
+ if(hasEven){
+ proxy.$ElMessage.warning("列表中含有状态不是Created的数据,不能进行盘盈");
+ state.loadings = false
+ return
+ }
+ QTRCommit(param).then(res => {
+ if(res.success){
+ proxy.$ElMessage.success(res.message);
+ state.dataList = [];
+ } else {
+ proxy.$ElMessage.error(res.message);
+ }
+ state.loadings = false
+ })
+ } else {
+ let hasEven = state.dataList.some(item =>
+ item.STOCKSTATE != 'Stocked'
+ )
+ if(hasEven){
+ proxy.$ElMessage.warning("列表中含有状态不是Stocked的数据,不能进行盘亏");
+ state.loadings = false
+ return
+ }
+ param.qtc = 'Z05'
+ QTCCommit(param).then(res => {
+ if(res.success){
+ proxy.$ElMessage.success(res.message);
+ state.dataList = [];
+ } else {
+ proxy.$ElMessage.error(res.message);
+ }
+ state.loadings = false
+ })
+ }
+ })
+
+}