feat: 项目组套和三方出入库明细
parent
2318737957
commit
066630cf5d
@ -0,0 +1,66 @@
|
||||
import axios from '@/utils/request'
|
||||
|
||||
/**
|
||||
* 获取单据列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
export function getThrInvOrders(query) {
|
||||
return axios({
|
||||
url: '/udiwms/thrsys/getThrInvOrders',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取单据明细列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
export function getThrInvOrderDetails(query) {
|
||||
return axios({
|
||||
url: '/udiwms/thrsys/getThrInvOrderDetails',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除明细行
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
export function delThrInvOrderDetail(query) {
|
||||
return axios({
|
||||
url: '/udiwms/thrsys/delThrInvOrderDetail',
|
||||
method: 'post',
|
||||
data: query
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除单据
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
export function delThrInvOrder(query) {
|
||||
return axios({
|
||||
url: '/udiwms/thrsys/delThrInvOrder',
|
||||
method: 'post',
|
||||
data: query
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 生成单据
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
export function generateOrder(query) {
|
||||
return axios({
|
||||
url: '/udiwms/thrsys/generateOrder',
|
||||
method: 'post',
|
||||
data: query
|
||||
})
|
||||
}
|
||||
|
@ -0,0 +1,278 @@
|
||||
<template>
|
||||
<el-form :model="generateOrderDate" label-width="120px">
|
||||
<el-row type="flex">
|
||||
<el-col :span="11" type="flex">
|
||||
<el-form-item label="来源单据号:" prop="code">
|
||||
<el-input style="width: 90%" size="small" placeholder="请输入来源单据号"
|
||||
disabled
|
||||
v-model.trim="generateOrderDate.billNo"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="11">
|
||||
<el-form-item prop="invCode" label="当前仓库:">
|
||||
<el-select
|
||||
v-model="generateOrderDate.invCode"
|
||||
placeholder="当前仓库"
|
||||
style="width: 90%"
|
||||
:disabled="corpOrderIdDisabled"
|
||||
@change="changeInv"
|
||||
filterable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in curInvOptions"
|
||||
:key="item.name"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
>
|
||||
<span style="float: left">{{ item.name }}</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px">{{
|
||||
item.warehouseName
|
||||
}}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="11">
|
||||
<el-form-item prop="action" label="单据类型:">
|
||||
<el-select
|
||||
v-model="generateOrderDate.action"
|
||||
placeholder="请选择单据类型"
|
||||
:disabled="corpOrderIdDisabled"
|
||||
style="width: 90%"
|
||||
filterable
|
||||
@change="actionChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in busTypeOptions"
|
||||
:key="item.name"
|
||||
:label="item.name"
|
||||
:value="item.action"
|
||||
>
|
||||
<span style="float: left">{{ item.name }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row type="flex">
|
||||
<el-form-item
|
||||
prop="fromCorp"
|
||||
label="往来信息:">
|
||||
<el-select
|
||||
v-model="generateOrderDate.fromCorp"
|
||||
filterable
|
||||
remote
|
||||
clearable
|
||||
reserve-keyword
|
||||
style="width: 90%"
|
||||
placeholder="请输入往来信息"
|
||||
:remote-method="findMethod"
|
||||
:loading="loading"
|
||||
:disabled="corpOrderIdDisabled"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in fromOptions"
|
||||
:key="item.erpId"
|
||||
:label="item.name"
|
||||
:value="item.erpId"
|
||||
>
|
||||
<span style="float: left">{{ item.name }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
|
||||
<div style='text-align: center; margin-bottom: 10px;'>
|
||||
<el-button type="primary" @click="generateOrder">提交</el-button>
|
||||
<el-button type="primary" @click="closeAddDialog">取消</el-button>
|
||||
</div>
|
||||
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {generateOrder} from "@/api/thrsys/thrInvOrder";
|
||||
import { findByFrom, findInvByUser } from '../../../api/system/invSubWarehouse'
|
||||
import { parseTime } from '../../../utils/coTools'
|
||||
import {findByInvUser, getBusTypeList} from "@/api/basic/busType";
|
||||
import { getBasicUnitMaintains } from '../../../api/basic/basicUnitMaintain'
|
||||
|
||||
export default {
|
||||
name: 'thrInvOrderGenerate',
|
||||
props: {
|
||||
generateOrderDate: {
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
closeAddDialog: {
|
||||
type: Function,
|
||||
required: true,
|
||||
},
|
||||
originTypes: {
|
||||
type: Object,
|
||||
required: true,
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
thirdSys: [],
|
||||
options: [{
|
||||
value: 1,
|
||||
label: '客户信息'
|
||||
}, {
|
||||
value: 2,
|
||||
label: '供应商信息'
|
||||
},
|
||||
{
|
||||
value: 3,
|
||||
label: '内部科室'
|
||||
}, {
|
||||
value: 4,
|
||||
label: '特殊往来'
|
||||
}],
|
||||
|
||||
curInvOptions: [],
|
||||
fromOptions: [],
|
||||
busTypeOptions: [],
|
||||
fromInvOptions: [],
|
||||
curPreInInvOptions: [], //预验收仓库
|
||||
curPreInSpaceOptions: [], //预验收货位
|
||||
curPreSpaceOptions: [], //寄售货位
|
||||
curSpaceOptions: [], //当前货位
|
||||
curAction: {
|
||||
corpType: 0,
|
||||
genUnit: false,
|
||||
checkWebNew: null,
|
||||
mainAction: null,
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
methods:{
|
||||
//提交
|
||||
generateOrder(){
|
||||
generateOrder(this.generateOrderDate).then((res) => {
|
||||
if (res.code == 20000) {
|
||||
this.$message.success("生成成功!");
|
||||
} else
|
||||
this.$message.error(res.message);
|
||||
}).catch((error) => {
|
||||
this.$message.error(error.message);
|
||||
})
|
||||
},
|
||||
//获取用户仓库列表
|
||||
findInvListByUser() {
|
||||
this.curInvOptions = [];
|
||||
findInvByUser()
|
||||
.then((response) => {
|
||||
this.curInvOptions = response.data || [];
|
||||
if (
|
||||
this.curInvOptions != null &&
|
||||
this.curInvOptions.length > 0 &&
|
||||
this.generateOrderDate.invWarehouseCode == null
|
||||
) {
|
||||
//this.orderFormData.invCode = this.curInvOptions[0].code;
|
||||
this.getBusTypeByInv();
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
});
|
||||
},
|
||||
//仓库改变
|
||||
changeInv(row) {
|
||||
this.generateOrderDate.action = null;
|
||||
this.generateOrderDate.checkPreInOrders = null;
|
||||
this.checkPreInArray = [];
|
||||
if (this.documentShow) {
|
||||
this.documentShow = false;
|
||||
}
|
||||
|
||||
this.curSpaceShow = false;
|
||||
this.preInSpaceShow = false;
|
||||
this.preSpaceShow = false;
|
||||
this.generateOrderDate.curSpaceCode = false;
|
||||
this.generateOrderDate.checkPreInSpaceCode = false;
|
||||
this.generateOrderDate.preCurSpaceCode = false;
|
||||
this.getBusTypeByInv();
|
||||
},
|
||||
//单据类型改变
|
||||
actionChange(item) {
|
||||
this.generateOrderDate.checkPreInOption = null;
|
||||
this.generateOrderDate.checkPreInOrders = null;
|
||||
this.checkPreInArray = [];
|
||||
this.curAction = this.getActionItem(item);
|
||||
this.bizShow = false;
|
||||
//2. 切换往来仓库
|
||||
this.generateOrderDate.fromInvCode = null;
|
||||
this.findMethod();
|
||||
},
|
||||
//根据仓库,用户获取单据类型
|
||||
getBusTypeByInv() {
|
||||
let query = {
|
||||
code: this.generateOrderDate.invCode,
|
||||
editType: 2 //可编辑
|
||||
};
|
||||
findByInvUser(query)
|
||||
.then((response) => {
|
||||
this.busTypeOptions = response.data || [];
|
||||
})
|
||||
.catch(() => {
|
||||
});
|
||||
},
|
||||
//获取当前单据类型
|
||||
getActionItem(action) {
|
||||
for (let i = 0; i < this.busTypeOptions.length; i++) {
|
||||
if (this.busTypeOptions[i].action == action) {
|
||||
return this.busTypeOptions[i];
|
||||
}
|
||||
}
|
||||
},
|
||||
//获取往来单位候选列表
|
||||
findMethod(query) {
|
||||
this.fromOptions = [];
|
||||
let cQuery = {
|
||||
key: query,
|
||||
corpType: 4,
|
||||
outType: null,
|
||||
page: 1,
|
||||
limit: 20,
|
||||
};
|
||||
getBasicUnitMaintains(cQuery)
|
||||
.then((response) => {
|
||||
this.loading = false;
|
||||
this.fromOptions = response.data.list || [];
|
||||
})
|
||||
.catch(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
|
||||
},
|
||||
created() {
|
||||
//页面初始化
|
||||
this.generateOrderDate.code = "";
|
||||
this.generateOrderDate.orderType = this.viewType;
|
||||
//新增页面
|
||||
this.corpOrderIdDisabled = false;
|
||||
let date = new Date();
|
||||
this.generateOrderDate.createTime = parseTime(
|
||||
date,
|
||||
"{y}-{m}-{d} {h}:{i}:{s}"
|
||||
);
|
||||
this.generateOrderDate.corpOrderId =
|
||||
parseTime(date, "{y}{m}{d}{h}{i}{s}") +
|
||||
Math.ceil(Math.random() * 89 + 10);
|
||||
this.generateOrderDate.deptCode = this.$store.getters.deptCode;
|
||||
this.generateOrderDate.invCode = this.$store.getters.locInvCode;
|
||||
this.findInvListByUser();
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
Loading…
Reference in New Issue