查询采购订单生成单据

ywj_dev
郑明梁 2 years ago
parent 2c7bead208
commit 2c6816a868

@ -93,11 +93,8 @@ export default {
methods: {
saveCode() {
debugger
updateCodeLost(this.editQuery)
.then((response) => {
console.log(response)
debugger
if (response.code === 20000) {
this.$message.success("提交成功");
this.closeCodeDialog()

@ -777,7 +777,6 @@ export default {
});
},
confirm() {
debugger
if (this.confirmStatus == null) {
this.$message.error("请选择确认状态");
return;

@ -185,7 +185,6 @@
<el-select v-model="inputQuery.allowNoBatch" style="width: 100%" size="small">
<el-option label="是" :value="true"></el-option>
<el-option label="否" :value="false"></el-option>
<el-option label="否" :value="null"></el-option>
</el-select>
</el-form-item>
</el-col>
@ -194,18 +193,16 @@
<el-select v-model="inputQuery.allowNoExpire" style="width: 100%" size="small">
<el-option label="是" :value="true"></el-option>
<el-option label="否" :value="false"></el-option>
<el-option label="否" :value="null"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="10" class="el-col">
<el-form-item label="允许无批次号">
<el-form-item label="允许无生产日期">
<el-select v-model="inputQuery.allowNoProduct" style="width: 100%" size="small">
<el-option label="是" :value="true"></el-option>
<el-option label="否" :value="false"></el-option>
<el-option label="否" :value="null"></el-option>
</el-select>
</el-form-item>
</el-col>
@ -214,7 +211,6 @@
<el-select v-model="inputQuery.allowNoSerial" style="width: 100%" size="small">
<el-option label="是" :value="true"></el-option>
<el-option label="否" :value="false"></el-option>
<el-option label="否" :value="null"></el-option>
</el-select>
</el-form-item>
</el-col>

@ -35,12 +35,14 @@
<el-col :span="11">
<el-form-item label="收货仓库:" prop="locStorageCode">
<el-select v-model="formData.invName" placeholder="收货仓库信息" style="width: 90%"
:disabled="true" clearable>
:disabled="true" clearable
>
<el-option
v-for="item in subInvList"
:key="item.name"
:label="item.name"
:value="item.code">
:value="item.code"
>
<span style="float: left">{{ item.name }}</span>
</el-option>
</el-select>
@ -67,40 +69,27 @@
<el-row>
<el-col :span="24">
<el-form-item label="订单说明:" prop="billNo">
<el-input v-model="formData.remark" style="width: 90%" :disabled="true" auto-complete="off"
type="textarea" autosize></el-input>
<el-input v-model="formData.remark" style="width: 87%" :disabled="true" auto-complete="off"
type="textarea" autosize
></el-input>
</el-form-item>
</el-col>
<el-col :span="11">
<!-- <el-form-item>-->
<!-- <el-checkbox v-model="formData.autoPurchase"></el-checkbox>-->
<!-- </el-form-item>-->
</el-col>
</el-row>
<el-row v-show="formData.autoPurchase">
<el-row>
<el-col :span="11">
<el-form-item label="入库仓库:" prop="locStorageCode">
<el-select v-model="formData.targetSubInv" placeholder="入库仓库信息" style="width: 90%"
@change="targetInvChange" clearable>
<el-option
v-for="item in tarSubList"
:key="item.name"
:label="item.name"
:value="item.code">
<span style="float: left">{{ item.name }}</span>
</el-option>
</el-select>
<el-form-item>
<el-checkbox v-model="formData.autoPurchase"></el-checkbox>
</el-form-item>
</el-col>
<el-col :span="11">
<el-col :span="11" v-show="formData.autoPurchase">
<el-form-item label="入库单据类型:" class="query-form-item" prop="targetBillAction">
<el-select v-model="formData.targetBillAction" placeholder="请选择单据类型" style="width: 90%">
<el-option
v-for="item in busTypes"
:key="item.name"
:label="item.name"
:value="item.action">
:value="item.action"
>
<span style="float: left">{{ item.name }}</span>
</el-option>
</el-select>
@ -113,7 +102,8 @@
<el-card>
<el-table v-loading="loading" :data="codeArray" style="width: 100%;" :row-class-name="tableRowClassName" border
highlight-current-row max-height="300" height="300" ref="multipleTable">
highlight-current-row max-height="300" height="300" ref="multipleTable"
>
<el-table-column label="序号" type="index" width="50"></el-table-column>
<el-table-column label="物资名称" prop="productName" show-overflow-tooltip width="150"></el-table-column>
<el-table-column label="规格型号" prop="spec" show-overflow-tooltip width="160"></el-table-column>
@ -121,16 +111,18 @@
<template slot-scope="scope">
<el-input size="small" v-model="scope.row.count"
placeholder="请输入数量" style="width: 80%"
type='number'
type="number"
@change="tableCountChange(scope.row)"
:disabled="scope.row.index !== selectedIndex"
oninput="value=value.replace(/[^\d]/g,'')"></el-input>
oninput="value=value.replace(/[^\d]/g,'')"
></el-input>
</template>
</el-table-column>
<el-table-column label="计量单位" prop="measname" show-overflow-tooltip width="100"></el-table-column>
<el-table-column label="生产企业" prop="manufactory" show-overflow-tooltip width="160"></el-table-column>
<el-table-column label="注册/备案号" prop="zczbhhzbapzbh" show-overflow-tooltip="true"
width="160"></el-table-column>
width="160"
></el-table-column>
</el-table>
</el-card>
@ -143,7 +135,7 @@
:close-on-press-escape="false"
width="80%"
v-if="selectProductVisible"
:append-to-body='true'
:append-to-body="true"
>
<purPlanProducts
:closeDialog="closeDialogC2"
@ -155,42 +147,42 @@
</template>
<script>
import draggable from "vuedraggable";
import purPlanProducts from "@/views/purchase/purPlan/purOrderSelectProduct";
import {auditOrder, dealOrder, delOrderDetail, listOrderDetail} from "@/api/purchase/purOrder";
import {filterAllByUser, selectByCode} from "@/api/system/invWarehouse";
import {filterSubByInv} from "@/api/system/invSubWarehouse";
import {getLocalJoinByUser} from "@/api/basic/busType";
import draggable from 'vuedraggable'
import purPlanProducts from '@/views/purchase/purPlan/purOrderSelectProduct'
import { auditOrder, dealOrder, delOrderDetail, listOrderDetail } from '@/api/purchase/purOrder'
import { filterAllByUser, selectByCode } from '@/api/system/invWarehouse'
import { filterSubByInv } from '@/api/system/invSubWarehouse'
import { getLocalJoinByUser } from '@/api/basic/busType'
export default {
name: "idQuery",
name: 'idQuery',
props: {
closeDialog: {
type: Function,
required: true,
required: true
},
idQuery: {
type: Object,
required: true,
required: true
},
editType: {
type: Object,
required: true,
},
required: true
}
},
data() {
return {
code: "",
code: '',
query: {
orderIdFk: "",
orderIdFk: '',
page: 1,
limit: 10,
limit: 10
},
formData: {
id: null,
billNo: null,
billDate: "",
remark: "",
billDate: '',
remark: '',
deptCode: null,
locStorageCode: null,
invWarehouseCode: null,
@ -198,7 +190,7 @@ export default {
autoPurchase: false,
targetInv: 1000,
targetSubInv: null,
targetBillAction: null,
targetBillAction: null
},
formRules: {},
codeArray: [],
@ -210,13 +202,13 @@ export default {
deleteLoading: false,
orderNo: null,
statusMap: {
1: "草稿",
2: "未审核",
3: "已审核",
1: '草稿',
2: '未审核',
3: '已审核'
},
typeMap: {
1: "预入库",
2: "普通采购",
1: '预入库',
2: '普通采购'
},
orderEditor: true,
sOptions: [],
@ -225,71 +217,70 @@ export default {
sLoading: false,
busTypes: [],
currentRow: {},
selectedIndex: "",
selectedIndex: '',
selectProductVisible: false,
thisData: {},
subInvList: [],
tarSubList: [],
invQueryData: {},
showSup: false,
showSup: false
};
}
},
components: {
draggable,
purPlanProducts,
purPlanProducts
},
methods: {
dealOrder(status) {
this.formData.dealStatus = status;
this.formData.dealStatus = status
let tQuery = {
purOrderEntity: this.formData,
subErpOrders: this.codeArray,
autoPurchase: this.formData.autoPurchase,
targetBillAction:this.formData.targetBillAction,
}
dealOrder(tQuery)
.then(response => {
this.loading = false;
this.loading = false
if (response.code === 20000) {
this.$message.success("处理成功");
this.closeDialog(true);
this.$message.success('处理成功')
this.closeDialog(true)
} else {
this.$message.error(response.message);
this.$message.error(response.message)
}
})
.catch(() => {
this.loading = false;
this.loading = false
})
},
saveOrder(status) {
let tip = "";
if (status == "1") {
if(this.formData.dealStatus == 1){
tip = "该单据已配货,是否继续配货?";
}else {
tip = "是否确定开始配货?";
let tip = ''
if (status == '1') {
if (this.formData.dealStatus == 1) {
tip = '该单据已配货,是否继续配货?'
} else {
tip = '是否确定开始配货?'
}
} else {
tip = "是否确定作废采购订单?";
tip = '是否确定作废采购订单?'
}
this.$confirm(tip, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.dealOrder(status);
this.dealOrder(status)
}).catch(() => {
this.loading = false;
});
this.loading = false
})
},
submitFunction(status) {
let tMessage = status === '1' ? '保存' : '提交';
this.loading = true;
let tMessage = status === '1' ? '保存' : '提交'
this.loading = true
let tQuery = {
autoPurchase: this.formData.autoPurchase,
targetSubInv: this.formData.targetSubInv,
@ -297,205 +288,203 @@ export default {
targetBillAction: this.formData.targetBillAction,
editStatus: status,
purOrderEntity: this.formData,
subErpOrders: this.codeArray,
subErpOrders: this.codeArray
}
auditOrder(tQuery)
.then(response => {
this.loading = false;
this.loading = false
if (response.code === 20000) {
this.$message.success(tMessage + "成功");
this.closeDialog(true);
this.$message.success(tMessage + '成功')
this.closeDialog(true)
} else {
this.$message.error(response.message);
this.$message.error(response.message)
}
})
.catch(() => {
this.loading = false;
this.loading = false
})
},
selectProductFunction() {
this.selectProductVisible = true;
this.selectProductVisible = true
},
closeDialogC2(rData) {
this.selectProductVisible = false;
this.thisData = {};
this.selectProductVisible = false
this.thisData = {}
if (this.$isNotBlank(rData)) {
this.codeArray = [];
this.codeArray = []
rData.forEach((obj, index) => {
this.codeArray.unshift(obj);
});
this.$refs.multipleTable.setCurrentRow(this.codeArray[0]);
this.currentRow = this.codeArray[0];
this.selectedIndex = 0;
this.codeArray.unshift(obj)
})
this.$refs.multipleTable.setCurrentRow(this.codeArray[0])
this.currentRow = this.codeArray[0]
this.selectedIndex = 0
}
},
rowChange(val) {
this.currentRow = val;
this.selectedIndex = val.index;
this.currentRow = val
this.selectedIndex = val.index
},
tableCountChange(row) {
if (this.$isNotBlank(row)) {
// row.count = row.reCount;
}
},
tableRowClassName({row, rowIndex}) {
row.index = rowIndex;
tableRowClassName({ row, rowIndex }) {
row.index = rowIndex
},
//
resetForm() {
if (this.$refs["dataForm"]) {
if (this.$refs['dataForm']) {
//
this.$refs["dataForm"].clearValidate();
this.$refs['dataForm'].clearValidate()
//
this.$refs["dataForm"].resetFields();
this.getList();
this.$refs['dataForm'].resetFields()
this.getList()
}
},
deleteCodeArray(index, row) {
this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$refs.multipleTable.setCurrentRow();
this.currentRow = {};
this.selectedIndex = "";
this.$refs.multipleTable.setCurrentRow()
this.currentRow = {}
this.selectedIndex = ''
if (this.orderEditor) {
this.detailLoading = true;
this.detailLoading = true
if (this.$isNotBlank(row.id)) {
delOrderDetail(row.id)
.then(response => {
this.detailLoading = false;
this.detailLoading = false
if (response.code === 20000) {
this.$message.success(response.data);
this.$message.success(response.data)
// this.getStockOrderDetailList();
this.codeArray.splice(index, 1);
this.codeArray.splice(index, 1)
} else {
this.$message.error(response.message);
this.$message.error(response.message)
}
})
.catch(() => {
this.detailLoading = false;
this.detailLoading = false
})
} else {
this.$message.success('删除成功');
this.codeArray.splice(index, 1);
this.$message.success('删除成功')
this.codeArray.splice(index, 1)
}
} else {
this.$message.success('删除成功');
this.codeArray.splice(index, 1);
this.$message.success('删除成功')
this.codeArray.splice(index, 1)
}
}).catch(() => {
});
})
},
getStockOrderDetailList() {
this.loading = true;
this.loading = true
listOrderDetail(this.query) //
.then((response) => {
console.log(response)
this.codeArray = response.data.list || [];
this.total = response.data.total || 0;
this.loading = false;
this.codeArray = response.data.list || []
this.total = response.data.total || 0
this.loading = false
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
this.loading = false
this.list = []
this.total = 0
})
},
findSubInvs() {
this.subInvList = [];
this.subInvList = []
let query = {
pcode: this.formData.locStorageCode
};
}
filterSubByInv(query)
.then((response) => {
this.subInvList = response.data || [];
this.subInvList = response.data || []
if (this.subInvList != null && this.subInvList.length == 1) {
this.formData.invWarehouseCode = this.subInvList[0].code;
this.formData.invWarehouseCode = this.subInvList[0].code
}
})
.catch(() => {
});
})
},
findTargetSubInvs() {
if (this.formData.targetSubInv != null && this.tarSubList.length > 0) {
this.formData.targetDeptCode = this.subInvList.find(item => item.code == this.formData.targetSubInv).parentId
}
this.tarSubList = [];
this.tarSubList = []
let query = {
pcode: 1000
};
}
filterSubByInv(query)
.then((response) => {
this.tarSubList = response.data || [];
this.tarSubList = response.data || []
if (this.tarSubList != null && this.tarSubList.length == 1) {
this.formData.targetSubInv = this.tarSubList[0].code;
this.formData.targetDeptCode = this.tarSubList[0].parentId;
this.formData.targetSubInv = this.tarSubList[0].code
this.formData.targetDeptCode = this.tarSubList[0].parentId
this.targetInvChange();
this.targetInvChange()
}
})
.catch(() => {
});
})
},
targetInvChange() {
let query = {
code: this.formData.targetSubInv,
enabled: true,
spUse: true,
};
enable: true,
spUse: true
}
getLocalJoinByUser(query)
.then((response) => {
this.busTypes = response.data.list || [];
this.busTypes = response.data.list || []
// this.formData.targetBillAction = this.busTypes[0].localAction;
})
.catch(() => {
});
})
let query1 = {
code: this.formData.targetSubInv,
};
code: this.formData.targetSubInv
}
selectByCode(query1)
.then((res) => {
if (res.code === 20000) {
this.formData.targetDeptCode = res.data
}
})
},
}
},
filters: {},
mounted() {
document.body.ondrop = function (event) {
event.preventDefault();
event.stopPropagation();
};
document.body.ondrop = function(event) {
event.preventDefault()
event.stopPropagation()
}
},
created() {
let supId = this.$store.getters.customerId;
if (supId == "110") {
this.showSup = true;
let supId = this.$store.getters.customerId
if (supId == '110') {
this.showSup = true
}
if (this.$isNotBlank(this.idQuery.id)) {
this.query.limit = 100;
this.query.orderIdFk = this.idQuery.id;
this.formData = this.idQuery.formData;
this.formData.targetInv = 1000;
this.orderEditor = true;
this.sValue = this.formData.corpName;
this.getStockOrderDetailList();
this.query.limit = 100
this.query.orderIdFk = this.idQuery.id
this.formData = this.idQuery.formData
this.formData.targetInv = 1000
this.orderEditor = true
this.sValue = this.formData.corpName
this.getStockOrderDetailList()
} else {
this.formData = {
id: null,
billNo: null,
billDate: "",
remark: "",
billDate: '',
remark: '',
deptCode: null,
locStorageCode: null,
invWarehouseCode: null,
@ -503,14 +492,15 @@ export default {
autoPurchase: false,
targetInv: 1000,
targetSubInv: null,
targetBillAction: null,
};
this.orderEditor = false;
targetBillAction: null
}
this.orderEditor = false
}
this.findTargetSubInvs();
this.codeArray = [];
},
};
this.findTargetSubInvs()
this.targetInvChange()
this.codeArray = []
}
}
</script>
<style>

@ -545,7 +545,6 @@ export default {
indexOf(ext.toLowerCase()) !== -1;
},
showImgViewer(row){
debugger
var varindex= row.filePath.lastIndexOf(".");
var varext = row.filePath.substring(varindex+1);
var isImage=this.isAssetTypeAnImage(varext);

@ -705,7 +705,6 @@ export default {
});
},
handleModifyClick(row) {
debugger
this.editQuery = row;
this.editDialogVisible = true;
},

@ -224,7 +224,6 @@ export default {
methods: {
submitUpload() {
debugger
var data = {
id: this.editQuery.prid,
sptm: this.editQuery.sptm,

@ -300,7 +300,6 @@ export default {
}
})
}else{
debugger
this.thisDetail = row;
this.thisDetail.isAudit=type
this.thrProductsDetailVisible = true;

@ -198,7 +198,7 @@ export default {
this.$message.error("菜单名称不能为空!");
return;
}
debugger
if(this.formName==2){
updateMenuHelp(this.formData).then((res) => {
if (res.code === 20000){
@ -286,7 +286,6 @@ export default {
ADMIN_ID: store.getters.adminId,
ADMIN_TOKEN: store.getters.token,
};
debugger
if( isBlank(this.from.id)){
this.formData={};

@ -190,7 +190,6 @@
/** 编辑按钮操作 */
handleView(row) {
debugger
this.addMenuVisible=true;
this.formName=2;
this.form = row;

Loading…
Cancel
Save