diff --git a/src/views/foodManage/stockManage/warehouseIn/edit.vue b/src/views/foodManage/stockManage/warehouseIn/edit.vue
index 64b67f0c..233222b7 100644
--- a/src/views/foodManage/stockManage/warehouseIn/edit.vue
+++ b/src/views/foodManage/stockManage/warehouseIn/edit.vue
@@ -51,6 +51,7 @@
添加货品
+ 导入采购订单
删除
@@ -180,6 +181,57 @@
取 消
+
+
+
+
+
+
+
+
+ 搜索
+ 重置
+
+
+
+
+
+
+
+ {{(queryParams2.pageNum - 1) * queryParams2.pageSize + scope.$index + 1}}
+
+
+
+
+
+
+ {{ (scope.row.orderAmount/100).toFixed(2) }}
+
+
+
+
+
+
+ 导入
+
+
+
+
+
+
+
+
@@ -188,6 +240,7 @@ import { imgUpLoadTwo } from '@/api/system/upload'
import { systemAreaTreeApi } from "@/api/base/stall";
import { systemMaterialTreeApi,getMaterialListApi,drpWareHousePageApi,supplierPageApi } from "@/api/foodManage/stockManage";
import { getWarehouseInInfoApi,addWarehouseInApi,editWarehouseInApi } from "@/api/foodManage/stockManage";
+import { purchaseOrderPageApi,getPurchaseOrderInfoApi } from "@/api/foodManage/purchaseManage";
export default {
name: "WarehouseInEdit",
dicts: [],
@@ -258,6 +311,18 @@ export default {
tableListData: [],//货品弹窗-货品表格数据
batchChosenMaterial:[],//货品弹窗-货品表格-选中的货品数组
noMaterial:false,
+ //导入功能
+ openImportDialog:false,
+ queryParams2: { // 货品弹窗-货品表格-查询参数
+ pageNum: 1,
+ pageSize: 10,
+ orderGoodsCode:null
+ },
+ loading2:false,
+ total2: 0, // 总条数
+ tableListData2: [],//导入弹窗-表格数据
+ importRow:{},//导入弹窗-表格数据-选中数据
+ materialDetailsData: [],//导入弹窗-明细数据
};
},
@@ -313,6 +378,10 @@ export default {
getAreaTreeData() {
systemAreaTreeApi({}).then((response) => {
this.treeAreaOptions = response.data;
+ if(this.treeAreaOptions.length>0){
+ this.$set(this.baseInfo,"areaId",this.getFirstChild(this.treeAreaOptions[0]).id)
+ this.handleAreaChange()
+ }
});
},
getFirstChild(node) {
@@ -331,7 +400,9 @@ export default {
getWareHouseData() {
drpWareHousePageApi({ areaId:this.baseInfo.areaId }).then((response) => {
this.wareHouseOptions = response.rows||[];
- this.$set(this.baseInfo,'warehouseId',null)
+ if(this.wareHouseOptions.length>0){
+ this.$set(this.baseInfo,"warehouseId",this.wareHouseOptions[0].warehouseId)
+ }
});
},
/** 查询供应商下拉结构 */
@@ -547,7 +618,72 @@ export default {
}
});
},
-
+ //导入
+ importPurchaseOrder(){
+ if(this.baseInfo.areaId!=undefined||this.baseInfo.warehouseId!=undefined){
+ this.openImportDialog=true
+ this.resetQuery2()
+ // setTimeout(()=>{
+ // this.$refs.multipleTable2.clearSelection()
+ // },300)
+ }else{
+ this.$modal.msgError("请先选择区域,仓库");
+ }
+ },
+ /** 搜索按钮操作 */
+ handleQuery2() {
+ this.queryParams2.pageNum = 1;
+ this.getList2();
+ },
+ /** 重置按钮操作 */
+ resetQuery2() {
+ this.resetForm("queryForm2");
+ this.handleQuery2();
+ },
+ /** 查询列表 */
+ getList2() {
+ this.loading2 = true;
+ let param = {
+ "pageSize": this.queryParams2.pageSize,
+ "pageNum": this.queryParams2.pageNum,
+ "orderGoodsCode": this.queryParams2.orderGoodsCode,
+ "orderStatus":2,
+ "areaId": this.baseInfo.areaId,
+ "warehouseId": this.baseInfo.warehouseId,
+ "supplierId": this.baseInfo.deliverySupplierId,
+ }
+ purchaseOrderPageApi(param).then(response => {
+ this.tableListData2 = response.rows;
+ this.total2 = Number(response.total);
+ this.loading2 = false;
+ });
+ },
+ confirmImport(row){
+ console.log(row)
+ this.importRow = row;
+ let param = {
+ orderGoodsId:this.importRow.orderGoodsId
+ }
+ getPurchaseOrderInfoApi(param).then((response) => {
+ this.materialDetailsData = response.data.orderGoodsDetailList||[];
+ this.$modal.confirm('是否确认导入采购订单?').then(()=>{
+ if(this.materialDetailsData.length>0){
+ this.materialList = this.materialDetailsData;
+ this.materialList.forEach(item=>{
+ this.$set(item,"unitPrice",Number(item.singlePrice)/100)
+ this.$set(item,"purNum",item.orderNum)
+ })
+ // this.baseInfo.relateOrderGoodsId = this.importRow.orderGoodsCode;
+ // this.$set(this.baseInfo,"remark","导入采购订单")
+ setTimeout(()=>{
+ this.openImportDialog=false
+ },500)
+ }else{
+ this.$modal.msgError("采购订单明细无货品!");
+ }
+ }).catch(() => {});
+ });
+ },
//日期
formatDate(date) {
// 格式化为 YYYY-MM-DD