下拉框添加
This commit is contained in:
parent
df3d8f527d
commit
35d7787215
|
|
@ -399,7 +399,7 @@ export default {
|
|||
},
|
||||
},
|
||||
methods: {
|
||||
// 公用方法:获取用户列表
|
||||
// 公用方法
|
||||
fetchUsers() {
|
||||
let param = {
|
||||
pageNum:1,
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<template>
|
||||
<div style="padding: 10px;background: #E5EBF6;min-height: 830px;">
|
||||
<div style="background: #FFF;padding: 10px;border-radius: 10px;margin-bottom: 20px;">
|
||||
<el-descriptions style="margin-bottom: 20px;" title="基本信息" :column="4" size="medium" border>
|
||||
<div style="background: #FFF;padding: 10px;border-radius: 10px;margin-bottom: 20px;">
|
||||
<el-descriptions style="margin-bottom: 20px;" title="基本信息" :column="4" size="medium" border>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">验货单编号</template>
|
||||
{{baseInfo.inspectGoodsCode}}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">送货日期</template>
|
||||
{{ baseInfo.deliveryDate }}
|
||||
|
|
@ -37,54 +37,54 @@
|
|||
<el-descriptions-item>
|
||||
<template slot="label">验货人</template>
|
||||
{{ baseInfo.inspector }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">备注</template>
|
||||
{{ baseInfo.remark }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">查验附件</template>
|
||||
<div v-for="(item,index) in baseInfo.inspectAttachmentList" :key="index">
|
||||
<div v-for="(item,index) in baseInfo.inspectAttachmentList" :key="index">
|
||||
<a :href="item" download="demo">{{ item }}</a>
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
|
||||
<div style="width: 100%;height: 450px;padding: 10px;border-radius: 10px;margin-bottom: 10px;background: #FFF;">
|
||||
<div style="width: 100%;display: flex;justify-content: space-between;align-items: center;margin-bottom: 10px;">
|
||||
<div>
|
||||
货品信息
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="width: 100%;height: 400px;overflow-y: auto;">
|
||||
<el-table v-loading="loading" :data="materialList" ref="multipleTable" height="380" :row-key="(row)=>{return row.materialId}" @selection-change="handleSelectionChange">
|
||||
<!-- <el-table-column type="selection" width="50" align="center" :reserve-selection="true" /> -->
|
||||
<el-table-column label="序号" align="center" width="80" type="index" />
|
||||
<!-- <el-table-column label="图片" align="center" prop="" :show-overflow-tooltip="true" /> -->
|
||||
<el-table-column label="货品编码" align="center" prop="materialCode" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="货品名称" align="center" prop="materialName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="货品类别" align="center" prop="materialTypeName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="计量单位" align="center" prop="unitName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="货品编码" align="center" prop="materialCode" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="货品名称" align="center" prop="materialName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="货品类别" align="center" prop="materialTypeName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="计量单位" align="center" prop="unitName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="货品规格" align="center" prop="size" :show-overflow-tooltip="true">
|
||||
<!-- <template slot-scope="scope">
|
||||
<span v-if="scope.row.salesMode==1">按份</span>
|
||||
<span v-if="scope.row.salesMode==2">称重</span>
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="单价(元)" align="center" prop="unitPrice" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ (scope.row.unitPrice).toFixed(2) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="订货数量" align="center" prop="orderNum" :show-overflow-tooltip="true"></el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="订货数量" align="center" prop="orderNum" :show-overflow-tooltip="true"></el-table-column>
|
||||
<el-table-column label="总金额(元)" align="center" prop="" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ (scope.row.orderNum*scope.row.unitPrice/100).toFixed(2) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="送货数量" align="center" prop="deliveryNum" :show-overflow-tooltip="true"></el-table-column>
|
||||
<el-table-column label="合格数量" align="center" prop="qualifiedNum" :show-overflow-tooltip="true"></el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="送货数量" align="center" prop="deliveryNum" :show-overflow-tooltip="true"></el-table-column>
|
||||
<el-table-column label="合格数量" align="center" prop="qualifiedNum" :show-overflow-tooltip="true"></el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true"></el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
|
@ -92,14 +92,14 @@
|
|||
<div style="width: 100%;height: 80px;padding: 10px;background: #FFF;border-radius: 10px;display: flex;align-items: center;justify-content: center;">
|
||||
<!-- <el-button type="primary" @click="confirmSave" :loading="loadingBtn">保存草稿</el-button> -->
|
||||
<el-button @click="jumpList">返回</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
import { getCanteenByAreaApi } from "@/api/base/stall";
|
||||
import { supplierPageApi } from "@/api/foodManage/purchaseManage";
|
||||
import { getPurchaseInspectInfoApi } from "@/api/foodManage/purchaseManage";
|
||||
import { getCanteenByAreaApi } from "@/api/base/stall";
|
||||
import { supplierPageApi } from "@/api/foodManage/purchaseManage";
|
||||
import { getPurchaseInspectInfoApi } from "@/api/foodManage/purchaseManage";
|
||||
export default {
|
||||
name: "InspectionDetail",
|
||||
dicts: [],
|
||||
|
|
@ -108,12 +108,12 @@ export default {
|
|||
purchaseInspectionRowData:{},//页面传参
|
||||
loading:false,
|
||||
loadingBtn:false,
|
||||
baseInfo: {
|
||||
baseInfo: {
|
||||
contractTitle:undefined,
|
||||
contractType:undefined,
|
||||
areaId:undefined,
|
||||
canteenId:undefined,
|
||||
dateRange:[],
|
||||
canteenId:undefined,
|
||||
dateRange:[],
|
||||
},
|
||||
// 表单校验
|
||||
baseRules: {
|
||||
|
|
@ -140,19 +140,19 @@ export default {
|
|||
canteenOptions:[],
|
||||
supplierOptions:[],
|
||||
stallOptions:[],
|
||||
|
||||
pickerOptions: {
|
||||
|
||||
pickerOptions: {
|
||||
disabledDate(v) {
|
||||
return v.getTime() < (new Date().getTime() - 86400000);// - 86400000是否包括当天
|
||||
}
|
||||
},
|
||||
materialList:[],
|
||||
materialList:[],
|
||||
openDialog:false,
|
||||
materialTreeOptions:[],
|
||||
materialTreeOptions:[],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 10,
|
||||
},
|
||||
// 总条数
|
||||
total: 0,
|
||||
|
|
@ -162,8 +162,8 @@ export default {
|
|||
noMaterial:false,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
if(this.$route.query.purchaseInspectionRowData){
|
||||
created() {
|
||||
if(this.$route.query.purchaseInspectionRowData){
|
||||
this.purchaseInspectionRowData = JSON.parse(this.$route.query.purchaseInspectionRowData)
|
||||
this.getContractInfo()
|
||||
}
|
||||
|
|
@ -179,34 +179,34 @@ export default {
|
|||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
methods: {
|
||||
// 返回列表页
|
||||
jumpList() {
|
||||
const obj = { path: "foodManage/purchaseManage/inspectionDetail" };
|
||||
this.$tab.closeOpenPage(obj);
|
||||
this.$router.replace({ path: "/foodManage/purchaseManage/purchaseInspection" }); // 要打开的页面
|
||||
this.$router.replace({ path: "/foodManage/purchaseManage/purchaseInspection" }); // 要打开的页面
|
||||
},
|
||||
getContractInfo(){
|
||||
console.log(this.purchaseInspectionRowData)
|
||||
console.log(this.purchaseInspectionRowData)
|
||||
let param = {
|
||||
inspectGoodsId:this.purchaseInspectionRowData.inspectGoodsId
|
||||
}
|
||||
//查询查询食堂下拉结构
|
||||
getPurchaseInspectInfoApi(param).then((response) => {
|
||||
this.baseInfo = response.data;
|
||||
this.materialList = this.baseInfo.inspectGoodsDetails;
|
||||
this.materialList = this.baseInfo.inspectGoodsDetails;
|
||||
this.materialList.forEach(item=>{
|
||||
this.$set(item,"unitPrice",Number(item.unitPrice)/100)
|
||||
this.$set(item,"unitPrice",Number(item.unitPrice)/100)
|
||||
})
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
// this.batchIds1 = selection.map(item => item.tradeId)
|
||||
// this.single = selection.length !== 1
|
||||
// this.multiple = !selection.length
|
||||
},
|
||||
|
||||
|
||||
//日期
|
||||
formatDate(date) {
|
||||
// 格式化为 YYYY-MM-DD
|
||||
|
|
@ -227,7 +227,7 @@ export default {
|
|||
const minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()
|
||||
const seconds = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
@ -269,10 +269,10 @@ export default {
|
|||
align-items: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
.dish-name:hover{
|
||||
.dish-name:hover{
|
||||
background-color:rgba(0, 0, 0, 0.1);
|
||||
color: #4b80fd;
|
||||
}
|
||||
}
|
||||
|
||||
.dialog-center{
|
||||
width: 10%;
|
||||
|
|
@ -324,4 +324,4 @@ export default {
|
|||
border: 1px solid #fff;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -4,20 +4,20 @@
|
|||
<el-form :model="baseInfo" ref="baseInfo" :rules="baseRules" size="medium" :inline="true" label-width="110px">
|
||||
<el-form-item label="验货单编号" prop="inspectGoodsCode">
|
||||
<el-input v-model="baseInfo.inspectGoodsCode" placeholder="验货单编号自动生成" disabled maxlength="20" clearable style="width: 240px"/>
|
||||
</el-form-item>
|
||||
</el-form-item>
|
||||
<el-form-item label="送货日期" prop="deliveryDate">
|
||||
<el-date-picker
|
||||
v-model="baseInfo.deliveryDate"
|
||||
type="date" align="right"
|
||||
type="date" align="right"
|
||||
format="yyyy-MM-dd" style="width: 240px;"
|
||||
:picker-options="pickerOptions" @change="baseInfo.deliveryDate=formatDate(baseInfo.deliveryDate)">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属区域" prop="areaId">
|
||||
<el-cascader v-model="baseInfo.areaId"
|
||||
:options="treeAreaOptions" :filterable="true" style="width: 240px" :show-all-levels="false"
|
||||
:disabled="materialList.length>0"
|
||||
:props="{
|
||||
:props="{
|
||||
emitPath: false,// 若设置 false,则只返回该节点的值,只返回最后选择的id
|
||||
checkStrictly: false,//来设置父子节点取消选中关联,从而达到选择任意一级选项的目的
|
||||
value:'id',label:'label'
|
||||
|
|
@ -40,14 +40,14 @@
|
|||
:label="item.supplierName"
|
||||
:value="item.supplierId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="送货人" prop="deliveryMan">
|
||||
<el-input v-model="baseInfo.deliveryMan" placeholder="请输入送货人" maxlength="20" clearable style="width: 240px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="送货人电话" prop="deliveryPhone">
|
||||
<el-input v-model="baseInfo.deliveryPhone" placeholder="请输入送货人电话" maxlength="11" clearable style="width: 240px"/>
|
||||
</el-form-item>
|
||||
</el-form-item>
|
||||
<el-form-item label="验货日期" prop="inspectDate">
|
||||
<el-date-picker
|
||||
v-model="baseInfo.inspectDate"
|
||||
|
|
@ -55,13 +55,23 @@
|
|||
format="yyyy-MM-dd HH:mm:ss" style="width: 240px;"
|
||||
:picker-options="pickerOptions" @change="baseInfo.inspectDate=formatDateTime(baseInfo.inspectDate)">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="验货人" prop="inspector">
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="验货人" prop="inspector">
|
||||
<el-input v-model="baseInfo.inspector" placeholder="请输入验货人" maxlength="20" clearable style="width: 240px"/>
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="验货人" prop="inspector">
|
||||
<el-select v-model="contractPerson" placeholder="请选择验货人" clearable style="width: 240px">
|
||||
<el-option
|
||||
v-for="option in contractPersonOptions"
|
||||
:key="option.value"
|
||||
:label="option.label"
|
||||
:value="option.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="baseInfo.remark" placeholder="请输入备注" maxlength="30" clearable style="width: 240px"/>
|
||||
</el-form-item>
|
||||
</el-form-item>
|
||||
<el-form-item label="查验附件" prop="inspectAttachmentList">
|
||||
<el-upload
|
||||
ref="upload"
|
||||
|
|
@ -79,9 +89,9 @@
|
|||
>上传附件
|
||||
</el-button>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
<div style="width: 100%;height: 450px;padding: 10px;border-radius: 10px;margin-bottom: 10px;background: #FFF;">
|
||||
<div style="width: 100%;display: flex;justify-content: space-between;align-items: center;margin-bottom: 10px;">
|
||||
<div>
|
||||
|
|
@ -113,19 +123,19 @@
|
|||
<span>{{ (scope.row.unitPrice/100).toFixed(2) }}</span>
|
||||
<!-- <el-input v-model="scope.row.unitPrice" placeholder="请输入" maxlength="10" clearable @input="(v)=>(scope.row.unitPrice=v.replace(/[^\d.]/g, '').replace(/^(\d*\.\d{2}).*$/, '$1'))"/> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="订货数量" align="center" prop="orderNum" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.orderNum}}</span>
|
||||
<!-- <el-input v-model.number="scope.row.orderNum" placeholder="请输入" maxlength="10" clearable @input="(v)=>(scope.row.orderNum=v.replace(/[^\d.]/g, '').replace(/^(\d*\.\d{2}).*$/, '$1'))"/> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="已验收数量" align="center" prop="totalQualifiedNum" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.totalQualifiedNum}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table-column>
|
||||
|
||||
<!-- <el-table-column label="总金额(元)" align="center" prop="" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ (scope.row.orderNum*scope.row.unitPrice/100).toFixed(2) }}</span>
|
||||
|
|
@ -134,21 +144,21 @@
|
|||
<el-table-column label="送货数量" align="center" prop="deliveryNum" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.deliveryNum" placeholder="请输入" maxlength="10" v-if="scope.row.deliveryNum>=0" clearable @change="patternValue(scope.row)"/>
|
||||
<span v-else>{{ scope.row.deliveryNum }}</span>
|
||||
<span v-else>{{ scope.row.deliveryNum }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="验收合格数量" align="center" prop="qualifiedNum" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.qualifiedNum" placeholder="请输入" maxlength="10" v-if="scope.row.deliveryNum>=0" clearable @change="patternValue2(scope.row)"/>
|
||||
<span v-else>{{ scope.row.deliveryNum }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.remark" placeholder="请输入" v-if="scope.row.deliveryNum>=0" maxlength="20" clearable/>
|
||||
<span v-else>{{ scope.row.remark }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -157,7 +167,7 @@
|
|||
<el-button type="success" plain @click="confirmSubmit" :loading="loadingBtn">提交</el-button>
|
||||
<el-button @click="jumpList">返回</el-button>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- 选择菜品 -->
|
||||
<el-dialog title="选择货品" :visible.sync="openDialog" width="65%" append-to-body >
|
||||
<div style="width: 100%;height:620px;">
|
||||
|
|
@ -165,7 +175,7 @@
|
|||
<el-form-item label="货品类别" prop="materialTypeIds">
|
||||
<el-cascader v-model="queryParams.materialTypeIds"
|
||||
:options="materialTreeOptions" :filterable="true" style="width: 240px" :show-all-levels="false"
|
||||
:props="{
|
||||
:props="{
|
||||
multiple: true,
|
||||
emitPath: false,// 若设置 false,则只返回该节点的值,只返回最后选择的id
|
||||
checkStrictly: false,//来设置父子节点取消选中关联,从而达到选择任意一级选项的目的
|
||||
|
|
@ -192,21 +202,21 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="图片" align="center" prop="" :show-overflow-tooltip="true" /> -->
|
||||
<el-table-column label="货品编码" align="center" prop="materialCode" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="货品名称" align="center" prop="materialName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="货品类别" align="center" prop="materialTypeName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="计量单位" align="center" prop="unitName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="货品编码" align="center" prop="materialCode" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="货品名称" align="center" prop="materialName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="货品类别" align="center" prop="materialTypeName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="计量单位" align="center" prop="unitName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="货品规格" align="center" prop="size" :show-overflow-tooltip="true">
|
||||
<!-- <template slot-scope="scope">
|
||||
<span v-if="scope.row.salesMode==1">按份</span>
|
||||
<span v-if="scope.row.salesMode==2">称重</span>
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="单价(元)" align="center" prop="unitPrice" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ (scope.row.unitPrice/100).toFixed(2)||"" }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
|
|
@ -214,21 +224,21 @@
|
|||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
/>
|
||||
</div>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="confirmChosen">确 定</el-button>
|
||||
<el-button @click="openDialog=false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 导入 -->
|
||||
<el-dialog title="导入采购订单" :visible.sync="openImportDialog" width="60%" append-to-body >
|
||||
<div style="width: 100%;height:600px;">
|
||||
<el-form :model="queryParams2" ref="queryForm2" size="small" :inline="true" label-width="100px">
|
||||
<el-form :model="queryParams2" ref="queryForm2" size="small" :inline="true" label-width="100px">
|
||||
<el-form-item label="采购单号" prop="orderGoodsCode">
|
||||
<el-input v-model="queryParams2.orderGoodsCode" placeholder="请输入采购单号" maxlength="20" clearable style="width: 240px"/>
|
||||
</el-form-item>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery2">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery2">重置</el-button>
|
||||
|
|
@ -241,21 +251,21 @@
|
|||
<template slot-scope="scope">
|
||||
<span>{{(queryParams2.pageNum - 1) * queryParams2.pageSize + scope.$index + 1}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="采购单号" align="center" prop="orderGoodsCode" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="采购订单标题" align="center" prop="orderTitle" :show-overflow-tooltip="true"/>
|
||||
</el-table-column>
|
||||
<el-table-column label="采购单号" align="center" prop="orderGoodsCode" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="采购订单标题" align="center" prop="orderTitle" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="采购总金额(元" align="center" prop="orderAmount" :show-overflow-tooltip="true" width="120">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ (scope.row.orderAmount/100).toFixed(2) }}</span>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="供应商" align="center" prop="supplierName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="创建人" align="center" prop="createBy" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="供应商" align="center" prop="supplierName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="创建人" align="center" prop="createBy" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text"
|
||||
@click="confirmImport(scope.row)" v-if="scope.row.orderStatus==2"
|
||||
>导入</el-button>
|
||||
@click="confirmImport(scope.row)" v-if="scope.row.orderStatus==2"
|
||||
>导入</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
|
@ -265,20 +275,21 @@
|
|||
:page.sync="queryParams2.pageNum"
|
||||
:limit.sync="queryParams2.pageSize"
|
||||
@pagination="getList2"
|
||||
/>
|
||||
/>
|
||||
</div>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="openImportDialog=false">确 定</el-button>
|
||||
<el-button @click="openImportDialog=false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
import { fetchUsers } from "@/api/foodManage/purchaseManage";
|
||||
import { imgUpLoadTwo } from '@/api/system/upload'
|
||||
import { systemAreaTreeApi,getCanteenByAreaApi,getStallByCanteenApi } from "@/api/base/stall";
|
||||
import { systemMaterialTreeApi,getMaterialListApi,supplierPageApi,drpWareHousePageApi } from "@/api/foodManage/purchaseManage";
|
||||
import { systemAreaTreeApi,getCanteenByAreaApi,getStallByCanteenApi } from "@/api/base/stall";
|
||||
import { systemMaterialTreeApi,getMaterialListApi,supplierPageApi,drpWareHousePageApi } from "@/api/foodManage/purchaseManage";
|
||||
import { getPurchaseInspectInfoApi,addPurchaseInspectApi,editPurchaseInspectApi } from "@/api/foodManage/purchaseManage";
|
||||
import { purchaseOrderPageApi,getPurchaseOrderInfoApi } from "@/api/foodManage/purchaseManage";
|
||||
|
||||
|
|
@ -287,29 +298,31 @@ export default {
|
|||
dicts: [],
|
||||
data() {
|
||||
return {
|
||||
contractPersonOptions: [], // 下拉框选项
|
||||
contractPerson: '', // 绑定的值
|
||||
purchaseInspectionRowData:{},//页面传参
|
||||
loading:false,
|
||||
loadingBtn:false,
|
||||
baseInfo: {
|
||||
baseInfo: {
|
||||
contractTitle:undefined,
|
||||
contractType:undefined,
|
||||
areaId:undefined,
|
||||
inspectAttachmentList:[],
|
||||
areaId:undefined,
|
||||
inspectAttachmentList:[],
|
||||
},
|
||||
// 表单校验
|
||||
baseRules: {
|
||||
deliveryDate: [
|
||||
{ required: true, message: "送货日期不能为空", trigger: "change" }
|
||||
],
|
||||
],
|
||||
areaId: [
|
||||
{ required: true, message: "所属区域不能为空", trigger: "change" }
|
||||
],
|
||||
],
|
||||
deliverySupplierId: [
|
||||
{ required: true, message: "送货供应商不能为空", trigger: "change" }
|
||||
],
|
||||
deliveryWarehouseId: [
|
||||
{ required: true, message: "送货仓库不能为空", trigger: "change" }
|
||||
],
|
||||
],
|
||||
deliveryMan: [
|
||||
{ required: true, message: "送货人不能为空", trigger: "blur" }
|
||||
],
|
||||
|
|
@ -340,7 +353,7 @@ export default {
|
|||
supplierOptions:[],
|
||||
wareHouseOptions:[],
|
||||
stallOptions:[],
|
||||
pickerOptions: {
|
||||
pickerOptions: {
|
||||
disabledDate(v) {
|
||||
return v.getTime() < (new Date().getTime() - 86400000);// - 86400000是否包括当天
|
||||
}
|
||||
|
|
@ -349,39 +362,41 @@ export default {
|
|||
materialList:[],//货品信息-表格数据
|
||||
batchIds:[],//货品信息-表格数据-多选
|
||||
openDialog:false,
|
||||
materialTreeOptions:[],
|
||||
materialTreeOptions:[],
|
||||
queryParams: { // 货品弹窗-货品表格-查询参数
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
pageSize: 10,
|
||||
},
|
||||
total: 0, // 总条数
|
||||
tableListData: [],//货品弹窗-货品表格数据
|
||||
batchChosenMaterial:[],//货品弹窗-货品表格-选中的货品数组
|
||||
noMaterial:false,
|
||||
noMaterial:false,
|
||||
//导入功能
|
||||
openImportDialog:false,
|
||||
queryParams2: { // 货品弹窗-货品表格-查询参数
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 10,
|
||||
orderGoodsCode:null
|
||||
},
|
||||
},
|
||||
loading2:false,
|
||||
total2: 0, // 总条数
|
||||
tableListData2: [],//导入弹窗-表格数据
|
||||
importRow:{},//导入弹窗-表格数据-选中数据
|
||||
materialDetailsData: [],//导入弹窗-明细数据
|
||||
|
||||
|
||||
};
|
||||
},
|
||||
created() {
|
||||
if(this.$route.query.purchaseInspectionRowData){
|
||||
|
||||
if(this.$route.query.purchaseInspectionRowData){
|
||||
this.purchaseInspectionRowData = JSON.parse(this.$route.query.purchaseInspectionRowData)
|
||||
setTimeout(()=>{
|
||||
this.getContractInfo()
|
||||
this.getContractInfo()
|
||||
},500)
|
||||
}
|
||||
this.getAreaTreeData()
|
||||
this.getMaterialTree()
|
||||
this.fetchUsers();
|
||||
this.getAreaTreeData()
|
||||
this.getMaterialTree()
|
||||
this.attachmentList=[]
|
||||
},
|
||||
watch:{
|
||||
|
|
@ -396,43 +411,60 @@ export default {
|
|||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
methods: {
|
||||
fetchUsers() {
|
||||
let param = {
|
||||
pageNum:1,
|
||||
pageSize: 1000,
|
||||
roleIds: 130, // 过滤角色
|
||||
}
|
||||
fetchUsers(param).then((response) => {
|
||||
console.log(response);
|
||||
if (response.rows) {
|
||||
// 从接口返回的数据中提取用户选项
|
||||
this.contractPersonOptions = response.rows.map(user => ({
|
||||
value: user.userId, // 下拉框绑定的值
|
||||
label: user.userName, // 下拉框显示的文本
|
||||
}));
|
||||
}
|
||||
});
|
||||
},
|
||||
// 返回列表页
|
||||
jumpList() {
|
||||
const obj = { path: "foodManage/purchaseManage/inspectionEdit" };
|
||||
this.$tab.closeOpenPage(obj);
|
||||
this.$router.replace({ path: "/foodManage/purchaseManage/purchaseInspection" }); // 要打开的页面
|
||||
this.$router.replace({ path: "/foodManage/purchaseManage/purchaseInspection" }); // 要打开的页面
|
||||
},
|
||||
getContractInfo(){
|
||||
console.log(this.purchaseInspectionRowData)
|
||||
console.log(this.purchaseInspectionRowData)
|
||||
let param = {
|
||||
inspectGoodsId:this.purchaseInspectionRowData.inspectGoodsId
|
||||
}
|
||||
//查询查询食堂下拉结构
|
||||
getPurchaseInspectInfoApi(param).then((response) => {
|
||||
this.baseInfo = response.data;
|
||||
this.materialList = this.baseInfo.inspectGoodsDetails;
|
||||
this.materialList = this.baseInfo.inspectGoodsDetails;
|
||||
if(this.baseInfo.inspectAttachmentList.length>0){
|
||||
this.baseInfo.inspectAttachmentList.forEach(item=>{
|
||||
this.attachmentList.push({name:item,url:item})
|
||||
})
|
||||
}
|
||||
}
|
||||
supplierPageApi({ isPaging:1,areaIdList:[this.baseInfo.areaId] }).then((response) => {
|
||||
this.supplierOptions = response.rows||[];
|
||||
this.$set(this.baseInfo,'deliverySupplierId',this.baseInfo.deliverySupplierId)
|
||||
});
|
||||
this.$set(this.baseInfo,'deliverySupplierId',this.baseInfo.deliverySupplierId)
|
||||
});
|
||||
drpWareHousePageApi({ areaId:this.baseInfo.areaId }).then((response) => {
|
||||
this.wareHouseOptions = response.rows||[];
|
||||
this.$set(this.baseInfo,'deliveryWarehouseId',this.baseInfo.deliveryWarehouseId)
|
||||
});
|
||||
});
|
||||
this.$set(this.baseInfo,'deliveryWarehouseId',this.baseInfo.deliveryWarehouseId)
|
||||
});
|
||||
});
|
||||
},
|
||||
//区域树
|
||||
getAreaTreeData() {
|
||||
systemAreaTreeApi({}).then((response) => {
|
||||
this.treeAreaOptions = response.data;
|
||||
this.treeAreaOptions = response.data;
|
||||
if(this.treeAreaOptions.length>0){
|
||||
this.$set(this.baseInfo,"areaId",this.getFirstChild(this.treeAreaOptions[0]).id)
|
||||
this.$set(this.baseInfo,"areaId",this.getFirstChild(this.treeAreaOptions[0]).id)
|
||||
this.handleAreaChange()
|
||||
}
|
||||
});
|
||||
|
|
@ -445,27 +477,27 @@ export default {
|
|||
}
|
||||
},
|
||||
//选中区域-查询食堂
|
||||
handleAreaChange(e){
|
||||
handleAreaChange(e){
|
||||
this.getSupplierData()
|
||||
this.getWareHouseData()
|
||||
},
|
||||
},
|
||||
/** 查询供应商下拉结构 */
|
||||
getSupplierData() {
|
||||
getSupplierData() {
|
||||
supplierPageApi({ isPaging:1,areaIdList:[this.baseInfo.areaId] }).then((response) => {
|
||||
this.supplierOptions = response.rows||[];
|
||||
if(this.supplierOptions.length>0){
|
||||
this.$set(this.baseInfo,"deliverySupplierId",this.supplierOptions[0].supplierId)
|
||||
this.supplierOptions = response.rows||[];
|
||||
if(this.supplierOptions.length>0){
|
||||
this.$set(this.baseInfo,"deliverySupplierId",this.supplierOptions[0].supplierId)
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
/** 查询供应商下拉结构 */
|
||||
getWareHouseData() {
|
||||
getWareHouseData() {
|
||||
drpWareHousePageApi({ areaId:this.baseInfo.areaId }).then((response) => {
|
||||
this.wareHouseOptions = response.rows||[];
|
||||
if(this.wareHouseOptions.length>0){
|
||||
this.$set(this.baseInfo,"deliveryWarehouseId",this.wareHouseOptions[0].warehouseId)
|
||||
this.wareHouseOptions = response.rows||[];
|
||||
if(this.wareHouseOptions.length>0){
|
||||
this.$set(this.baseInfo,"deliveryWarehouseId",this.wareHouseOptions[0].warehouseId)
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 查询货品类别下拉树结构 */
|
||||
getMaterialTree() {
|
||||
|
|
@ -473,28 +505,28 @@ export default {
|
|||
// goodsType:1
|
||||
}
|
||||
systemMaterialTreeApi(param).then((response) => {
|
||||
this.materialTreeOptions = response.data;
|
||||
this.materialTreeOptions = response.data;
|
||||
});
|
||||
},
|
||||
},
|
||||
//选择日期范围
|
||||
changeDateRange(e){
|
||||
//this.formatDate(e[0])
|
||||
changeDateRange(e){
|
||||
//this.formatDate(e[0])
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.batchIds = selection.map(item => item.materialId)
|
||||
},
|
||||
//删除货品
|
||||
delMaterial(){
|
||||
delMaterial(){
|
||||
this.batchIds.forEach(ID=>{
|
||||
let index = this.materialList.findIndex(v=>v.materialId==ID)
|
||||
if(index>-1){
|
||||
this.materialList.splice(index,1)
|
||||
}
|
||||
})
|
||||
setTimeout(()=>{
|
||||
this.$refs.multipleTable.clearSelection()
|
||||
},300)
|
||||
setTimeout(()=>{
|
||||
this.$refs.multipleTable.clearSelection()
|
||||
},300)
|
||||
},
|
||||
//添加货品
|
||||
addMaterial(){
|
||||
|
|
@ -502,23 +534,23 @@ export default {
|
|||
this.openDialog=true
|
||||
this.resetQuery()
|
||||
setTimeout(()=>{
|
||||
this.$refs.multipleTable1.clearSelection()
|
||||
},300)
|
||||
this.$refs.multipleTable1.clearSelection()
|
||||
},300)
|
||||
}else{
|
||||
this.$modal.msgError("请先选择区域");
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
resetQuery() {
|
||||
this.queryParams = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 10,
|
||||
}
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
|
|
@ -531,7 +563,7 @@ export default {
|
|||
"pageNum": this.queryParams.pageNum,
|
||||
"areaId": this.queryParams.areaId,
|
||||
"materialName": this.queryParams.materialName,
|
||||
"materialCode": this.queryParams.materialCode,
|
||||
"materialCode": this.queryParams.materialCode,
|
||||
"materialTypeIds": this.queryParams.materialTypeIds,
|
||||
}
|
||||
getMaterialListApi(param).then(response => {
|
||||
|
|
@ -543,8 +575,8 @@ export default {
|
|||
handleSelectionChange2(selection) {
|
||||
this.batchChosenMaterial = selection;
|
||||
this.batchChosenMaterial.forEach(item=>{
|
||||
this.$set(item,"orderNum",0)
|
||||
this.$set(item,"unitPrice",item.unitPrice)
|
||||
this.$set(item,"orderNum",0)
|
||||
this.$set(item,"unitPrice",item.unitPrice)
|
||||
})
|
||||
},
|
||||
confirmChosen(){
|
||||
|
|
@ -552,14 +584,14 @@ export default {
|
|||
this.loading = true
|
||||
this.materialList = this.batchChosenMaterial
|
||||
// this.batchChosenMaterial.forEach(item=>{
|
||||
// let obj = Object.assign({}, item)
|
||||
// let obj = Object.assign({}, item)
|
||||
// this.materialList.push(obj)
|
||||
// })
|
||||
setTimeout(()=>{
|
||||
this.loading = false
|
||||
this.openDialog=false
|
||||
},500)
|
||||
}
|
||||
},500)
|
||||
}
|
||||
},
|
||||
//保存草稿
|
||||
confirmSave(){
|
||||
|
|
@ -567,16 +599,16 @@ export default {
|
|||
if (valid) {
|
||||
setTimeout(()=>{
|
||||
let param = Object.assign({},this.baseInfo);
|
||||
param.deliveryDate = this.formatDate(this.baseInfo.deliveryDate)
|
||||
param.deliveryTotalNum = 0;//送货总数量
|
||||
param.inspectQualifiedNum = 0;//验货合格总数量
|
||||
param.deliveryDate = this.formatDate(this.baseInfo.deliveryDate)
|
||||
param.deliveryTotalNum = 0;//送货总数量
|
||||
param.inspectQualifiedNum = 0;//验货合格总数量
|
||||
param.status=1
|
||||
param.inspectGoodsDetails = []
|
||||
param.inspectAttachment = ""
|
||||
param.inspectGoodsDetails = []
|
||||
param.inspectAttachment = ""
|
||||
if(this.attachmentList.length>0){
|
||||
let arr = this.attachmentList.map(item=>item.url)
|
||||
param.inspectAttachment = arr.join(',')
|
||||
console.log(param)
|
||||
console.log(param)
|
||||
}
|
||||
this.noMaterial = false;
|
||||
if(this.materialList.length>0){
|
||||
|
|
@ -584,11 +616,11 @@ export default {
|
|||
if(item.orderNum>item.totalQualifiedNum){
|
||||
if(Number(item.deliveryNum)==0 || Number(item.qualifiedNum)==0){
|
||||
this.noMaterial = true
|
||||
}else{
|
||||
let obj = Object.assign({}, item)
|
||||
param.deliveryTotalNum = param.deliveryTotalNum+Number(obj.deliveryNum)//送货总数量
|
||||
param.inspectQualifiedNum = param.inspectQualifiedNum+Number(obj.qualifiedNum)//验货合格总数量
|
||||
param.inspectGoodsDetails.push(obj)
|
||||
}else{
|
||||
let obj = Object.assign({}, item)
|
||||
param.deliveryTotalNum = param.deliveryTotalNum+Number(obj.deliveryNum)//送货总数量
|
||||
param.inspectQualifiedNum = param.inspectQualifiedNum+Number(obj.qualifiedNum)//验货合格总数量
|
||||
param.inspectGoodsDetails.push(obj)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
@ -598,33 +630,33 @@ export default {
|
|||
}else{
|
||||
this.noMaterial = true;
|
||||
if(this.materialList.length>0){
|
||||
this.noMaterial = false;
|
||||
}
|
||||
this.noMaterial = false;
|
||||
}
|
||||
console.log(param)
|
||||
if(this.noMaterial){
|
||||
this.$modal.msgError("请添加货品!");
|
||||
}else{
|
||||
this.loadingBtn=true;
|
||||
if (this.baseInfo.inspectGoodsId != undefined) {
|
||||
if (this.baseInfo.inspectGoodsId != undefined) {
|
||||
editPurchaseInspectApi(param).then((response) => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.loadingBtn=false
|
||||
this.jumpList()
|
||||
this.jumpList()
|
||||
}).catch(() => {
|
||||
this.loadingBtn=false
|
||||
});
|
||||
} else {
|
||||
});
|
||||
} else {
|
||||
addPurchaseInspectApi(param).then((response) => {
|
||||
this.$modal.msgSuccess("保存成功");
|
||||
this.loadingBtn=false
|
||||
this.jumpList()
|
||||
this.jumpList()
|
||||
}).catch(() => {
|
||||
this.loadingBtn=false
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
},500)
|
||||
}
|
||||
});
|
||||
|
|
@ -632,82 +664,82 @@ export default {
|
|||
// 提交按钮
|
||||
confirmSubmit(){
|
||||
this.$refs["baseInfo"].validate(valid => {
|
||||
if (valid) {
|
||||
if (valid) {
|
||||
setTimeout(()=>{
|
||||
let param = Object.assign({},this.baseInfo);
|
||||
param.deliveryDate = this.formatDate(this.baseInfo.deliveryDate)
|
||||
param.deliveryTotalNum = 0;//送货总数量
|
||||
param.inspectQualifiedNum = 0;//验货合格总数量
|
||||
param.deliveryDate = this.formatDate(this.baseInfo.deliveryDate)
|
||||
param.deliveryTotalNum = 0;//送货总数量
|
||||
param.inspectQualifiedNum = 0;//验货合格总数量
|
||||
param.status=2
|
||||
param.inspectGoodsDetails = []
|
||||
param.inspectAttachment = ""
|
||||
param.inspectGoodsDetails = []
|
||||
param.inspectAttachment = ""
|
||||
if(this.attachmentList.length>0){
|
||||
let arr = this.attachmentList.map(item=>item.url)
|
||||
param.inspectAttachment = arr.join(',')
|
||||
console.log(param)
|
||||
console.log(param)
|
||||
}
|
||||
this.noMaterial = false;
|
||||
if(this.materialList.length>0){
|
||||
if(this.materialList.length>0){
|
||||
this.materialList.forEach(item=>{
|
||||
if(item.orderNum>item.totalQualifiedNum){
|
||||
if(item.orderNum>item.totalQualifiedNum){
|
||||
if(Number(item.deliveryNum)==0 || Number(item.qualifiedNum)==0){
|
||||
this.noMaterial = true
|
||||
}else{
|
||||
let obj = Object.assign({}, item)
|
||||
param.deliveryTotalNum = param.deliveryTotalNum+Number(obj.deliveryNum)//送货总数量
|
||||
param.inspectQualifiedNum = param.inspectQualifiedNum+Number(obj.qualifiedNum)//验货合格总数量
|
||||
param.inspectGoodsDetails.push(obj)
|
||||
}
|
||||
let obj = Object.assign({}, item)
|
||||
param.deliveryTotalNum = param.deliveryTotalNum+Number(obj.deliveryNum)//送货总数量
|
||||
param.inspectQualifiedNum = param.inspectQualifiedNum+Number(obj.qualifiedNum)//验货合格总数量
|
||||
param.inspectGoodsDetails.push(obj)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
if(this.noMaterial){
|
||||
this.$modal.msgError("请输入表格数据!");
|
||||
}else{
|
||||
this.noMaterial = true;
|
||||
if(this.materialList.length>0){
|
||||
this.noMaterial = false;
|
||||
}
|
||||
this.noMaterial = false;
|
||||
}
|
||||
console.log(param)
|
||||
if(this.noMaterial){
|
||||
this.$modal.msgError("请添加货品!");
|
||||
}else{
|
||||
this.loadingBtn=true;
|
||||
if (this.baseInfo.inspectGoodsId != undefined) {
|
||||
if (this.baseInfo.inspectGoodsId != undefined) {
|
||||
editPurchaseInspectApi(param).then((response) => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.loadingBtn=false
|
||||
this.jumpList()
|
||||
this.jumpList()
|
||||
}).catch(() => {
|
||||
this.loadingBtn=false
|
||||
});
|
||||
});
|
||||
} else {
|
||||
addPurchaseInspectApi(param).then((response) => {
|
||||
this.$modal.msgSuccess("保存成功");
|
||||
this.loadingBtn=false
|
||||
this.jumpList()
|
||||
this.jumpList()
|
||||
}).catch(() => {
|
||||
this.loadingBtn=false
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
},500)
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
//导入
|
||||
importPurchaseOrder(){
|
||||
if(this.baseInfo.areaId!=undefined||this.baseInfo.deliveryWarehouseId!=undefined||this.baseInfo.deliverySupplierId!=undefined){
|
||||
this.openImportDialog=true
|
||||
this.openImportDialog=true
|
||||
this.resetQuery2()
|
||||
// setTimeout(()=>{
|
||||
// this.$refs.multipleTable2.clearSelection()
|
||||
// },300)
|
||||
// this.$refs.multipleTable2.clearSelection()
|
||||
// },300)
|
||||
}else{
|
||||
this.$modal.msgError("请先选择区域,仓库,供应商");
|
||||
}
|
||||
}
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery2() {
|
||||
|
|
@ -715,10 +747,10 @@ export default {
|
|||
this.getList2();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery2() {
|
||||
resetQuery2() {
|
||||
this.queryParams2 = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 10,
|
||||
}
|
||||
this.resetForm("queryForm2");
|
||||
this.handleQuery2();
|
||||
|
|
@ -733,62 +765,62 @@ export default {
|
|||
"orderStatus":2,
|
||||
"isInspect":2,
|
||||
"areaId": this.baseInfo.areaId,
|
||||
"warehouseId": this.baseInfo.deliveryWarehouseId,
|
||||
"supplierId": this.baseInfo.deliverySupplierId,
|
||||
}
|
||||
"warehouseId": this.baseInfo.deliveryWarehouseId,
|
||||
"supplierId": this.baseInfo.deliverySupplierId,
|
||||
}
|
||||
purchaseOrderPageApi(param).then(response => {
|
||||
this.tableListData2 = response.rows;
|
||||
this.total2 = Number(response.total);
|
||||
this.loading2 = false;
|
||||
});
|
||||
},
|
||||
confirmImport(row){
|
||||
},
|
||||
confirmImport(row){
|
||||
console.log(row)
|
||||
this.importRow = row;
|
||||
this.importRow = row;
|
||||
let param = {
|
||||
orderGoodsId:this.importRow.orderGoodsId
|
||||
}
|
||||
getPurchaseOrderInfoApi(param).then((response) => {
|
||||
this.materialDetailsData = response.data.orderGoodsDetailList||[];
|
||||
this.$modal.confirm('是否确认导入采购订单?').then(()=>{
|
||||
}
|
||||
getPurchaseOrderInfoApi(param).then((response) => {
|
||||
this.materialDetailsData = response.data.orderGoodsDetailList||[];
|
||||
this.$modal.confirm('是否确认导入采购订单?').then(()=>{
|
||||
if(this.materialDetailsData.length>0){
|
||||
this.materialList = this.materialDetailsData;
|
||||
this.materialList = this.materialDetailsData;
|
||||
this.materialList.forEach(item=>{
|
||||
this.$set(item,"unitPrice",Number(item.singlePrice))
|
||||
this.$set(item,"orderNum",item.orderNum)
|
||||
this.$set(item,"orderNum",item.orderNum)
|
||||
if(item.totalQualifiedNum&&item.totalQualifiedNum>0){
|
||||
this.$set(item,"deliveryNum",Number(item.orderNum)-Number(item.totalQualifiedNum))
|
||||
this.$set(item,"qualifiedNum",Number(item.orderNum)-Number(item.totalQualifiedNum))
|
||||
this.$set(item,"deliveryNum",Number(item.orderNum)-Number(item.totalQualifiedNum))
|
||||
this.$set(item,"qualifiedNum",Number(item.orderNum)-Number(item.totalQualifiedNum))
|
||||
}else{
|
||||
this.$set(item,"deliveryNum",Number(item.orderNum))
|
||||
this.$set(item,"qualifiedNum",Number(item.orderNum))
|
||||
this.$set(item,"deliveryNum",Number(item.orderNum))
|
||||
this.$set(item,"qualifiedNum",Number(item.orderNum))
|
||||
}
|
||||
})
|
||||
// this.materialList = [];
|
||||
// this.materialList = [];
|
||||
// this.materialDetailsData.forEach(item=>{
|
||||
// if(item.totalQualifiedNum<item.orderNum){
|
||||
// let obj = Object.assign({},item)
|
||||
// this.$set(obj,"unitPrice",Number(obj.singlePrice))
|
||||
// this.$set(obj,"orderNum",obj.orderNum)
|
||||
// this.$set(obj,"orderNum",obj.orderNum)
|
||||
// if(obj.totalQualifiedNum&&obj.totalQualifiedNum>0){
|
||||
// this.$set(obj,"deliveryNum",obj.orderNum-obj.totalQualifiedNum)
|
||||
// this.$set(obj,"deliveryNum",obj.orderNum-obj.totalQualifiedNum)
|
||||
// }else{
|
||||
// this.$set(obj,"deliveryNum",obj.orderNum)
|
||||
// this.$set(obj,"deliveryNum",obj.orderNum)
|
||||
// }
|
||||
// this.materialList.push(obj)
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
this.baseInfo.relateOrderGoodsId = this.importRow.orderGoodsCode;
|
||||
this.baseInfo.relateOrderGoodsId = this.importRow.orderGoodsCode;
|
||||
this.$set(this.baseInfo,"remark","导入采购订单")
|
||||
setTimeout(()=>{
|
||||
setTimeout(()=>{
|
||||
this.openImportDialog=false
|
||||
},500)
|
||||
},500)
|
||||
}else{
|
||||
this.$modal.msgError("采购订单明细无货品!");
|
||||
}
|
||||
}).catch(() => {});
|
||||
}
|
||||
}).catch(() => {});
|
||||
});
|
||||
},
|
||||
},
|
||||
//附件上传
|
||||
fileUpLoad(param){
|
||||
param.type = 'canteen'
|
||||
|
|
@ -796,19 +828,19 @@ export default {
|
|||
if (res.code == 200) {
|
||||
console.log(this.attachmentList)
|
||||
console.log(this.baseInfo.inspectAttachmentList)
|
||||
this.attachmentList.push(res.data)
|
||||
this.attachmentList.push(res.data)
|
||||
if(!this.baseInfo.inspectAttachmentList){
|
||||
this.baseInfo.inspectAttachmentList=[res.data.url]
|
||||
}else{
|
||||
this.baseInfo.inspectAttachmentList.push(res.data.url)
|
||||
}
|
||||
this.baseInfo.inspectAttachmentList.push(res.data.url)
|
||||
}
|
||||
} else {
|
||||
this.$modal.msgError(res.msg);
|
||||
}
|
||||
}).catch((error) => {
|
||||
}).catch((error) => {
|
||||
this.$modal.msgError(error)
|
||||
})
|
||||
},
|
||||
},
|
||||
handleRemoveFile(file, fileList){
|
||||
let sum = 0
|
||||
this.attachmentList.forEach((item, index) => {
|
||||
|
|
@ -816,9 +848,9 @@ export default {
|
|||
sum = index
|
||||
}
|
||||
})
|
||||
this.attachmentList.splice(sum, 1)
|
||||
this.baseInfo.inspectAttachmentList.splice(sum, 1)
|
||||
},
|
||||
this.attachmentList.splice(sum, 1)
|
||||
this.baseInfo.inspectAttachmentList.splice(sum, 1)
|
||||
},
|
||||
patternValue(row){
|
||||
console.log(row)
|
||||
if(!row.deliveryNum||row.deliveryNum==""){
|
||||
|
|
@ -828,33 +860,33 @@ export default {
|
|||
row.deliveryNum = row.deliveryNum.replace(/[^\d.]/g, '').replace(/^(\d*\.\d{2}).*$/, '$1')
|
||||
row.qualifiedNum = row.deliveryNum.replace(/[^\d.]/g, '').replace(/^(\d*\.\d{2}).*$/, '$1')
|
||||
}
|
||||
if(row.totalQualifiedNum&&row.totalQualifiedNum>0){
|
||||
if(row.totalQualifiedNum&&row.totalQualifiedNum>0){
|
||||
setTimeout(()=>{
|
||||
if(Number(row.deliveryNum)>(Number(row.orderNum)-Number(row.totalQualifiedNum))){
|
||||
if(Number(row.deliveryNum)>(Number(row.orderNum)-Number(row.totalQualifiedNum))){
|
||||
row.deliveryNum = Number(row.orderNum)-Number(row.totalQualifiedNum)
|
||||
row.qualifiedNum = Number(row.orderNum)-Number(row.totalQualifiedNum)
|
||||
}
|
||||
},200)
|
||||
}else{
|
||||
}else{
|
||||
setTimeout(()=>{
|
||||
if(Number(row.deliveryNum)>Number(row.orderNum)){
|
||||
row.deliveryNum = Number(row.orderNum)
|
||||
row.qualifiedNum = Number(row.orderNum)
|
||||
}
|
||||
},200)
|
||||
}
|
||||
}
|
||||
},
|
||||
patternValue2(row){
|
||||
if(!row.qualifiedNum||row.qualifiedNum==""){
|
||||
row.qualifiedNum=0
|
||||
}else{
|
||||
row.qualifiedNum = row.qualifiedNum.replace(/[^\d.]/g, '').replace(/^(\d*\.\d{2}).*$/, '$1')
|
||||
}else{
|
||||
row.qualifiedNum = row.qualifiedNum.replace(/[^\d.]/g, '').replace(/^(\d*\.\d{2}).*$/, '$1')
|
||||
}
|
||||
setTimeout(()=>{
|
||||
if(Number(row.qualifiedNum)>Number(row.deliveryNum)){
|
||||
if(Number(row.qualifiedNum)>Number(row.deliveryNum)){
|
||||
row.qualifiedNum = Number(row.deliveryNum)
|
||||
}
|
||||
},200)
|
||||
},200)
|
||||
},
|
||||
//日期
|
||||
formatDate(date) {
|
||||
|
|
@ -876,7 +908,7 @@ export default {
|
|||
const minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()
|
||||
const seconds = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
@ -918,10 +950,10 @@ export default {
|
|||
align-items: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
.dish-name:hover{
|
||||
.dish-name:hover{
|
||||
background-color:rgba(0, 0, 0, 0.1);
|
||||
color: #4b80fd;
|
||||
}
|
||||
}
|
||||
|
||||
.dialog-center{
|
||||
width: 10%;
|
||||
|
|
@ -973,4 +1005,4 @@ export default {
|
|||
border: 1px solid #fff;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px">
|
||||
<el-form-item label="所属区域" prop="areaId">
|
||||
<el-cascader v-model="queryParams.areaId"
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
</el-form-item>
|
||||
<el-form-item label="负责人" prop="manager">
|
||||
<el-input v-model="queryParams.manager" placeholder="请输入负责人" maxlength="20" clearable style="width: 220px"/>
|
||||
</el-form-item>
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库类别" prop="categoryId">
|
||||
<el-select v-model="queryParams.categoryId" placeholder="仓库类别" clearable style="width: 240px" >
|
||||
<el-option
|
||||
|
|
@ -29,9 +29,9 @@
|
|||
<el-form-item label="仓库类型" prop="warehouseType">
|
||||
<el-select v-model="queryParams.warehouseType" placeholder="仓库类型" clearable style="width: 240px">
|
||||
<el-option label="原料" value="1"></el-option>
|
||||
<el-option label="商品" value="2"></el-option>
|
||||
<el-option label="商品" value="2"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
|
|
@ -72,9 +72,9 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="所属区域" align="center" prop="areaName" :show-overflow-tooltip="true" ></el-table-column>
|
||||
<el-table-column label="所属食堂" align="center" prop="canteenName" :show-overflow-tooltip="true" ></el-table-column>
|
||||
<el-table-column label="仓库地址" align="center" prop="address" :show-overflow-tooltip="true" ></el-table-column>
|
||||
<el-table-column label="负责人" align="center" prop="manager" :show-overflow-tooltip="true" ></el-table-column>
|
||||
<el-table-column label="手机号" align="center" prop="managerPhone" :show-overflow-tooltip="true" ></el-table-column>
|
||||
<el-table-column label="仓库地址" align="center" prop="address" :show-overflow-tooltip="true" ></el-table-column>
|
||||
<el-table-column label="负责人" align="center" prop="manager" :show-overflow-tooltip="true" ></el-table-column>
|
||||
<el-table-column label="手机号" align="center" prop="managerPhone" :show-overflow-tooltip="true" ></el-table-column>
|
||||
<el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
|
|
@ -130,8 +130,8 @@
|
|||
:label="item.canteenName"
|
||||
:value="item.canteenId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="仓库名称" prop="warehouseName">
|
||||
|
|
@ -158,7 +158,7 @@
|
|||
<el-form-item label="仓库类型" prop="warehouseType">
|
||||
<el-select v-model="form.warehouseType" placeholder="仓库类型" clearable style="width: 100%;">
|
||||
<el-option label="原料" value="1"></el-option>
|
||||
<el-option label="商品" value="2"></el-option>
|
||||
<el-option label="商品" value="2"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
|
@ -168,10 +168,21 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="负责人" prop="manager">
|
||||
<!-- <el-form-item label="负责人" prop="manager">
|
||||
<el-input v-model="form.manager" placeholder="请输入负责人" maxlength="20" style="width: 100%;"/>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="负责人" prop="manager">
|
||||
<el-select v-model="contractPerson" placeholder="请选择负责人" clearable style="width: 240px">
|
||||
<el-option
|
||||
v-for="option in contractPersonOptions"
|
||||
:key="option.value"
|
||||
:label="option.label"
|
||||
:value="option.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="负责人电话" prop="managerPhone">
|
||||
<el-input v-model="form.managerPhone" placeholder="请输入负责人电话" maxlength="11" style="width: 100%;"/>
|
||||
|
|
@ -183,18 +194,21 @@
|
|||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { systemAreaTreeApi,getCanteenByAreaApi } from "@/api/base/stall";
|
||||
import { fetchUsers } from "@/api/foodManage/purchaseManage";
|
||||
import { getWareHousePageApi,addWareHouseApi,editWareHouseApi,delWareHouseApi } from "@/api/foodManage/stockManage";
|
||||
export default {
|
||||
name: "",
|
||||
dicts: ['warehouse_category'],
|
||||
data() {
|
||||
return {
|
||||
contractPersonOptions: [], // 下拉框选项
|
||||
contractPerson: '', // 绑定的值
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
|
|
@ -225,7 +239,7 @@ export default {
|
|||
pageSize: 10,
|
||||
},
|
||||
form: {
|
||||
areaId:null,
|
||||
areaId:null,
|
||||
},//详情
|
||||
rules: {
|
||||
areaId: [
|
||||
|
|
@ -247,11 +261,12 @@ export default {
|
|||
trigger: 'blur',
|
||||
}
|
||||
],
|
||||
|
||||
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.fetchUsers();
|
||||
this.getList()
|
||||
this.getAreaTreeData();
|
||||
},
|
||||
|
|
@ -262,12 +277,12 @@ export default {
|
|||
this.treeAreaOptions = response.data;
|
||||
});
|
||||
},
|
||||
handleAreaChange(e){
|
||||
handleAreaChange(e){
|
||||
let param= {
|
||||
areaId:e
|
||||
}
|
||||
getCanteenByAreaApi(param).then((response) => {
|
||||
this.canteenOptions=response.rows||[]
|
||||
this.canteenOptions=response.rows||[]
|
||||
});
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
|
|
@ -307,7 +322,7 @@ export default {
|
|||
reset() {
|
||||
this.form = {};
|
||||
this.resetForm("form");
|
||||
},
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
|
|
@ -320,13 +335,14 @@ export default {
|
|||
areaId:row.areaId
|
||||
}
|
||||
getCanteenByAreaApi(param).then((response) => {
|
||||
this.canteenOptions=response.rows||[]
|
||||
this.canteenOptions=response.rows||[]
|
||||
});
|
||||
this.open = true;
|
||||
this.title = "修改";
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function() {
|
||||
this.form.manager = this.contractPerson; // 将选择的负责人传给 form.manager
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.warehouseId != undefined) {
|
||||
|
|
@ -345,6 +361,23 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
fetchUsers() {
|
||||
let param = {
|
||||
pageNum:1,
|
||||
pageSize: 1000,
|
||||
roleIds: 130, // 过滤角色
|
||||
}
|
||||
fetchUsers(param).then((response) => {
|
||||
console.log(response);
|
||||
if (response.rows) {
|
||||
// 从接口返回的数据中提取用户选项
|
||||
this.contractPersonOptions = response.rows.map(user => ({
|
||||
value: user.userId, // 下拉框绑定的值
|
||||
label: user.userName, // 下拉框显示的文本
|
||||
}));
|
||||
}
|
||||
});
|
||||
},
|
||||
handleStock(row){
|
||||
this.$router.push({ path: "/foodManage/stockManage/materialStockDetail",query: {stockRowData:JSON.stringify(row)} });
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue