加入下拉框负责人

This commit is contained in:
lizhenhua 2025-09-15 13:12:43 +08:00
parent 4935f52233
commit f6511be656
3 changed files with 224 additions and 183 deletions

View File

@ -20,6 +20,15 @@ export function getMaterialListApi(data) {
params: data
})
}
export function fetchUsers(data) {
return request({
url: '/system/user/list',
method: 'get',
headers: {
},
params: data
})
}
//查询供应商列表 isPaging 0不分页 2分页
export function supplierPageApi(data) {
return request({

View File

@ -236,7 +236,7 @@
if(item.phonenumber&&item.phonenumber!=""){
this.$set(item,"phonenumber",decryptWithSM4(item.phonenumber))
}
})
})
this.total = Number(response.total);
this.loading = false;
});

View File

@ -7,12 +7,12 @@
</el-form-item>
<el-form-item label="合同标题" prop="contractTitle">
<el-input v-model="baseInfo.contractTitle" placeholder="请输入合同标题" maxlength="20" clearable style="width: 240px"/>
</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="contractMaterialList.length>0"
:props="{
:props="{
emitPath: false,// falseid
checkStrictly: false,//
value:'id',label:'label'
@ -26,7 +26,7 @@
:label="item.canteenName"
:value="item.canteenId"
></el-option>
</el-select>
</el-select>
</el-form-item>
<el-form-item label="供应商" prop="supplierId">
<el-select v-model="baseInfo.supplierId" placeholder="请选择供应商" style="width: 240px;">
@ -35,7 +35,7 @@
:label="item.supplierName"
:value="item.supplierId"
></el-option>
</el-select>
</el-select>
</el-form-item>
<el-form-item label="签订日期" prop="contractSigningTime">
<el-date-picker
@ -44,7 +44,7 @@
format="yyyy-MM-dd" style="width: 240px;"
:picker-options="pickerOptions" @change="baseInfo.contractSigningTime=formatDate(baseInfo.contractSigningTime)">
</el-date-picker>
</el-form-item>
</el-form-item>
<el-form-item label="合同生效周期" prop="dateRange">
<el-date-picker
v-model="baseInfo.dateRange"
@ -85,16 +85,27 @@
<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 label="负责人" prop="contractPerson">
<!-- <el-form-item label="负责人" prop="contractPerson">
<el-input v-model="baseInfo.contractPerson" placeholder="请输入负责人" maxlength="20" clearable style="width: 240px"/>
</el-form-item>
</el-form-item> -->
<el-form-item label="负责人" prop="contractPerson">
<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="contractAttachmentList">
<el-upload
ref="upload"
:http-request="fileUpLoad"
action="#" :limit="5"
accept=".xlsx, .xls, .png, .jpg, .jpeg, .docx, .doc"
:show-file-list="true"
accept=".xlsx, .xls, .png, .jpg, .jpeg, .docx, .doc"
:show-file-list="true"
:file-list="attachmentList"
:on-remove="handleRemoveFile"
:before-upload="checkFileSize"
@ -102,13 +113,13 @@
<el-button
:disabled="attachmentList.length==5"
type="primary"
size="mini"
size="mini"
>上传附件
</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>
@ -125,36 +136,36 @@
<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="singlePrice" :show-overflow-tooltip="true">
<template slot-scope="scope">
<el-input v-model="scope.row.singlePrice" placeholder="请输入" maxlength="7" clearable @input="(v)=>(scope.row.singlePrice=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">
<el-input v-model.number="scope.row.orderNum" placeholder="请输入" maxlength="7" 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="" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ (scope.row.orderNum*scope.row.singlePrice).toFixed(4) }}</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="请输入" maxlength="20" clearable/>
</template>
</el-table-column>
</el-table-column>
</el-table>
</div>
</div>
@ -163,7 +174,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;">
@ -171,11 +182,11 @@
<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,// falseid
checkStrictly: false,//
value:'id',label:'categoryName'
value:'id',label:'categoryName'
}" collapse-tags>
</el-cascader>
</el-form-item>
@ -198,21 +209,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"
@ -220,21 +231,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>
@ -247,21 +258,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>
@ -271,37 +282,39 @@
: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 { imgUpLoadTwo } from '@/api/system/upload'
import { systemAreaTreeApi,getCanteenByAreaApi,getStallByCanteenApi } from "@/api/base/stall";
import { systemMaterialTreeApi,getMaterialListApi,supplierPageApi } from "@/api/foodManage/purchaseManage";
import { systemAreaTreeApi,getCanteenByAreaApi,getStallByCanteenApi } from "@/api/base/stall";
import { systemMaterialTreeApi,getMaterialListApi,supplierPageApi } from "@/api/foodManage/purchaseManage";
import { getPurchaseContractInfoApi,addPurchaseContractApi,editPurchaseContractApi,delPurchaseContractApi } from "@/api/foodManage/purchaseManage";
import { purchaseOrderPageApi,getPurchaseOrderInfoApi } from "@/api/foodManage/purchaseManage";
import { purchaseOrderPageApi,getPurchaseOrderInfoApi,fetchUsers } from "@/api/foodManage/purchaseManage";
export default {
name: "ContractEdit",
dicts: [],
data() {
return {
contractPersonOptions: [], //
contractPerson: '', //
contractRowData:{},//
loading:false,
loadingBtn:false,
baseInfo: {
baseInfo: {
contractTitle:undefined,
contractType:undefined,
areaId:undefined,
canteenId:undefined,
dateRange:[],
contractAttachmentList:[],
canteenId:undefined,
dateRange:[],
contractAttachmentList:[],
},
//
baseRules: {
@ -331,7 +344,7 @@ export default {
canteenOptions:[],
supplierOptions:[],
stallOptions:[],
pickerOptions: {
pickerOptions: {
disabledDate(v) {
return v.getTime() < (new Date().getTime() - 86400000);// - 86400000
}
@ -340,22 +353,22 @@ export default {
contractMaterialList:[],//-
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: [],//-
@ -364,10 +377,11 @@ export default {
};
},
created() {
this.getAreaTreeData()
this.getMaterialTree()
this.fetchUsers();
this.getAreaTreeData()
this.getMaterialTree()
this.attachmentList=[]
if(this.$route.query.contractRowData){
if(this.$route.query.contractRowData){
this.contractRowData = JSON.parse(this.$route.query.contractRowData)
this.getContractInfo()
}
@ -380,44 +394,62 @@ export default {
}else{
this.baseInfo={}
this.contractMaterialList=[]
this.attachmentList=[]
}
this.attachmentList=[]
}
},
},
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/contractDetail" };
this.$tab.closeOpenPage(obj);
this.$router.replace({ path: "/foodManage/purchaseManage/contractList" }); //
this.$router.replace({ path: "/foodManage/purchaseManage/contractList" }); //
},
getContractInfo(){
console.log(this.contractRowData)
console.log(this.contractRowData)
let param = {
contractId:this.contractRowData.contractId
}
//
getPurchaseContractInfoApi(param).then((response) => {
this.baseInfo = response.data;
this.$set(this.baseInfo,'dateRange',[this.baseInfo.contractStartTime,this.baseInfo.contractEndTime])
this.contractMaterialList = this.baseInfo.purchaseContractDetailList;
this.$set(this.baseInfo,'dateRange',[this.baseInfo.contractStartTime,this.baseInfo.contractEndTime])
this.contractMaterialList = this.baseInfo.purchaseContractDetailList;
this.contractMaterialList.forEach(item=>{
this.$set(item,"singlePrice",Number(item.singlePrice)/100)
this.$set(item,"singlePrice",Number(item.singlePrice)/100)
})
if(this.baseInfo.contractAttachmentList.length>0){
this.baseInfo.contractAttachmentList.forEach(item=>{
this.attachmentList.push({name:item,url:item})
})
}
}
getCanteenByAreaApi({areaId:this.baseInfo.areaId}).then((response) => {
this.canteenOptions=response.rows||[];
this.$set(this.baseInfo,"canteenId",this.baseInfo.canteenId)
});
supplierPageApi({ isPaging:1,areaIdList:[this.baseInfo.areaId] }).then((response) => {
this.supplierOptions = response.rows||[];
this.$set(this.baseInfo,'supplierId',this.baseInfo.supplierId)
});
});
this.$set(this.baseInfo,'supplierId',this.baseInfo.supplierId)
});
});
},
//
getAreaTreeData() {
@ -437,79 +469,79 @@ export default {
}
},
//-
handleAreaChange(e){
handleAreaChange(e){
this.getCanteenData()
this.getSupplierData()
},
},
/** 查询查询食堂下拉结构 */
getCanteenData() {
getCanteenData() {
let param= {
areaId:this.baseInfo.areaId
}
}
getCanteenByAreaApi(param).then((response) => {
this.canteenOptions=response.rows||[];
this.$set(this.baseInfo,"canteenId",null)
});
},
},
/** 查询供应商下拉结构 */
getSupplierData() {
getSupplierData() {
supplierPageApi({ isPaging:1,areaIdList:[this.baseInfo.areaId] }).then((response) => {
this.supplierOptions = response.rows||[];
this.$set(this.baseInfo,"supplierId",null)
});
},
});
},
/** 查询货品类别下拉树结构 */
getMaterialTree() {
let param = {
// 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.contractMaterialList.findIndex(v=>v.materialId==ID)
if(index>-1){
this.contractMaterialList.splice(index,1)
}
})
setTimeout(()=>{
this.$refs.multipleTable.clearSelection()
},300)
setTimeout(()=>{
this.$refs.multipleTable.clearSelection()
},300)
},
//
addMaterial(){
if(this.baseInfo.areaId!=undefined){
this.openDialog=true
this.resetQuery()
setTimeout(()=>{
this.$refs.multipleTable1.clearSelection()
},300)
setTimeout(()=>{
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();
@ -522,7 +554,7 @@ export default {
"pageNum": this.queryParams.pageNum,
"areaId": this.baseInfo.areaId,
"materialName": this.queryParams.materialName,
"materialCode": this.queryParams.materialCode,
"materialCode": this.queryParams.materialCode,
"materialTypeIds": this.queryParams.materialTypeIds,
}
getMaterialListApi(param).then(response => {
@ -534,14 +566,14 @@ export default {
handleSelectionChange2(selection) {
this.batchChosenMaterial = selection;
this.batchChosenMaterial.forEach(item=>{
this.$set(item,"orderNum",0)
this.$set(item,"singlePrice",item.unitPrice/100)
this.$set(item,"orderNum",0)
this.$set(item,"singlePrice",item.unitPrice/100)
})
},
confirmChosen(){
if(this.batchChosenMaterial.length>0){
this.loading = true;
let items = [...this.contractMaterialList,...this.batchChosenMaterial]
let items = [...this.contractMaterialList,...this.batchChosenMaterial]
let uniqueItems = items.filter((item, index, array) => {
return array.findIndex((t) => (t.materialId === item.materialId)) === index;
});
@ -549,32 +581,32 @@ export default {
setTimeout(()=>{
this.loading = false
this.openDialog=false
},500)
}
},500)
}
},
//稿
confirmSave(){
this.$refs["baseInfo"].validate(valid => {
if (valid) {
if (valid) {
let param = Object.assign({},this.baseInfo);
param.contractStartTime = this.formatDateTime(this.baseInfo.dateRange[0])
param.contractEndTime = this.formatDateTime(this.baseInfo.dateRange[1])
param.contractSigningTime = this.formatDate(this.baseInfo.contractSigningTime)
if(this.baseInfo.payMoneyDate){
param.payMoneyDate = this.formatDate(this.baseInfo.payMoneyDate)
}
param.payMoneyDate = this.formatDate(this.baseInfo.payMoneyDate)
}
param.contractAmount = 0;
param.commitStatus=1
param.purchaseContractDetailList = []
param.contractAttachment = ""
param.purchaseContractDetailList = []
param.contractAttachment = ""
if(this.attachmentList.length>0){
console.log(this.attachmentList)
console.log(this.attachmentList)
let arr = this.attachmentList.map(item=>item.url)
param.contractAttachment = arr.join(',')
console.log(param)
console.log(param)
}
this.noMaterial = false;
if(this.contractMaterialList.length>0){
if(this.contractMaterialList.length>0){
this.contractMaterialList.forEach(item=>{
if(item.singlePrice==0 || item.orderNum==0){
this.noMaterial = true
@ -583,16 +615,16 @@ export default {
obj.singlePrice = Number(obj.singlePrice)*100
param.contractAmount = param.contractAmount+(Number(obj.singlePrice)*Number(obj.orderNum))
param.purchaseContractDetailList.push(obj)
}
})
}
}
})
}
if(this.noMaterial){
this.$modal.msgError("请输入单价和数量!");
}else{
this.noMaterial = true;
if(this.contractMaterialList.length>0){
this.noMaterial = false;
}
this.noMaterial = false;
}
console.log(param)
if(this.noMaterial){
this.$modal.msgError("请添加货品!");
@ -602,48 +634,48 @@ export default {
editPurchaseContractApi(param).then((response) => {
this.$modal.msgSuccess("修改成功");
this.loadingBtn=false
this.jumpList()
this.jumpList()
}).catch(() => {
this.loadingBtn=false
});
});
} else {
addPurchaseContractApi(param).then((response) => {
this.$modal.msgSuccess("保存成功");
this.loadingBtn=false
this.jumpList()
this.jumpList()
}).catch(() => {
this.loadingBtn=false
});
});
}
}
}
}
}
}
});
},
//
confirmSubmit(){
this.$refs["baseInfo"].validate(valid => {
if (valid) {
if (valid) {
let param = Object.assign({},this.baseInfo);
param.contractStartTime = this.formatDateTime(this.baseInfo.dateRange[0])
param.contractEndTime = this.formatDateTime(this.baseInfo.dateRange[1])
param.contractSigningTime = this.formatDate(this.baseInfo.contractSigningTime)
if(this.baseInfo.payMoneyDate){
param.payMoneyDate = this.formatDate(this.baseInfo.payMoneyDate)
}
param.payMoneyDate = this.formatDate(this.baseInfo.payMoneyDate)
}
param.contractAmount = 0;
param.commitStatus=2
param.purchaseContractDetailList = []
param.contractAttachment = ""
param.purchaseContractDetailList = []
param.contractAttachment = ""
if(this.attachmentList.length>0){
console.log(this.attachmentList)
console.log(this.attachmentList)
let arr = this.attachmentList.map(item=>item.url)
param.contractAttachment = arr.join(',')
console.log(param)
console.log(param)
}
this.noMaterial = false;
if(this.contractMaterialList.length>0){
if(this.contractMaterialList.length>0){
this.contractMaterialList.forEach(item=>{
if(item.singlePrice==0 || item.orderNum==0){
this.noMaterial = true
@ -652,16 +684,16 @@ export default {
obj.singlePrice = Number(obj.singlePrice)*100
param.contractAmount = param.contractAmount+(Number(obj.singlePrice)*Number(obj.orderNum))
param.purchaseContractDetailList.push(obj)
}
})
}
}
})
}
if(this.noMaterial){
this.$modal.msgError("请输入单价和数量!");
}else{
this.noMaterial = true;
if(this.contractMaterialList.length>0){
this.noMaterial = false;
}
this.noMaterial = false;
}
console.log(param)
if(this.noMaterial){
this.$modal.msgError("请添加货品!");
@ -671,36 +703,36 @@ export default {
editPurchaseContractApi(param).then((response) => {
this.$modal.msgSuccess("修改成功");
this.loadingBtn=false
this.jumpList()
this.jumpList()
}).catch(() => {
this.loadingBtn=false
});
});
} else {
addPurchaseContractApi(param).then((response) => {
this.$modal.msgSuccess("保存成功");
this.loadingBtn=false
this.jumpList()
this.jumpList()
}).catch(() => {
this.loadingBtn=false
});
});
}
}
}
}
}
}
});
},
//
importPurchaseOrder(){
if(this.baseInfo.areaId!=undefined||this.baseInfo.deliveryWarehouseId!=undefined||this.baseInfo.supplierId!=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() {
@ -708,10 +740,10 @@ export default {
this.getList2();
},
/** 重置按钮操作 */
resetQuery2() {
resetQuery2() {
this.queryParams2 = {
pageNum: 1,
pageSize: 10,
pageSize: 10,
}
this.resetForm("queryForm2");
this.handleQuery2();
@ -726,59 +758,59 @@ export default {
"orderStatus":2,
// "isInspect":2,
"areaId": this.baseInfo.areaId,
// "warehouseId": this.baseInfo.deliveryWarehouseId,
"supplierId": this.baseInfo.supplierId,
}
// "warehouseId": this.baseInfo.deliveryWarehouseId,
"supplierId": this.baseInfo.supplierId,
}
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.contractMaterialList = this.materialDetailsData;
this.contractMaterialList = this.materialDetailsData;
this.contractMaterialList.forEach(item=>{
this.$set(item,"singlePrice",Number(item.singlePrice/100))
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.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'
imgUpLoadTwo(param).then((res) => {
if (res.code == 200) {
this.attachmentList.push(res.data)
this.baseInfo.contractAttachmentList.push(res.data.url)
this.attachmentList.push(res.data)
this.baseInfo.contractAttachmentList.push(res.data.url)
} else {
this.$modal.msgError(res.msg);
}
}).catch((error) => {
}).catch((error) => {
this.$modal.msgError(error)
})
},
@ -798,9 +830,9 @@ export default {
sum = index
}
})
this.attachmentList.splice(sum, 1)
this.baseInfo.contractAttachmentList.splice(sum, 1)
},
this.attachmentList.splice(sum, 1)
this.baseInfo.contractAttachmentList.splice(sum, 1)
},
//
formatDate(date) {
// YYYY-MM-DD
@ -821,7 +853,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>
@ -863,10 +895,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%;
@ -918,4 +950,4 @@ export default {
border: 1px solid #fff;
cursor: pointer;
}
</style>
</style>