提交 e425e0e8 编写于 作者: 张磊's avatar 张磊

Merge branch 'testing/finance' into 'release'

Testing/finance

See merge request com.pica.cloud.education.frontend/pica.cloud.web-education-admin!427
此差异已折叠。
......@@ -142,5 +142,24 @@ export const getBusinessCategory = () => {
});
};
export const getContractList = (projectId) => {
return fetch({
headers,
url: getBaseUrl(`store/contract/options/queryByProjectId/${projectId}`),
method: "get",
description: "查询合同",
});
};
export const getCooperationProjectList = () => {
return fetch({
headers,
url: getBaseUrl(
`store/cooperation/project/options/query`
),
method: "get",
description: "查询合作项目",
});
};
......@@ -111,7 +111,7 @@
</el-progress>
<el-button class="dl-video" icon="el-icon-delete" circle @click="deleteVideo" v-if="videoList.length == 1"></el-button>
</el-form-item>
<el-form-item label="业务类型" prop="businessCategoryId">
<!-- <el-form-item label="业务类型" prop="businessCategoryId">
<el-select
v-model="formData3.businessCategoryId"
placeholder="请选择业务类型"
......@@ -124,7 +124,7 @@
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-form-item> -->
<el-form-item label="商品类型" prop="goodsType">
<el-select
v-model="formData3.goodsType"
......@@ -140,7 +140,38 @@
></el-option>
</el-select>
</el-form-item>
<!-- 新增项目合同名称 -->
<el-form-item label="项目-合同名称" prop="cooperationProjectId">
<el-select
v-model="formData3.cooperationProjectId"
placeholder="请选择"
size="small"
:disabled="isEdit && isProject"
@change="getContract"
@clear="projectClear"
clearable
filterable>
<el-option
v-for="(item,index) in cooperationProjectList"
:key="item.projectName+'-'+index"
:label="item.projectName"
:value="item.cooperationProjectId"
></el-option>
</el-select>
<el-select
v-model="formData3.contractId"
placeholder="请选择"
size="small"
clearable
:disabled="isEdit && isContract">
<el-option
v-for="(item,index) in contractList"
:key="item.contractName+'-'+index"
:label="item.contractName"
:value="item.contractId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="是否支持售后" prop="expressLimitFlag" v-if="storeType < 3">
<el-radio-group v-model="formData3.expressLimitFlag" :disabled="!hasRepoFlag">
......@@ -870,7 +901,7 @@
import { openLoading, closeLoading, signFigures } from "../../utils/utils";
import { isEmptyUtils } from "@/utils/index";
import { doUpload, getFilePath, createFilePath } from "../../utils/qiniu-util";
import { updateGoods ,updateStock,dosageAll,getDeparts,getGoodsList, getGoodDetails, updateGoodsV2, getHospitalInfoByStoreId, getCheckPackageIdList, getTypeCodeList,getBusinessCategory } from '@/utils/goods';
import { updateGoods ,updateStock,dosageAll,getDeparts,getGoodsList, getGoodDetails, updateGoodsV2, getHospitalInfoByStoreId, getCheckPackageIdList, getTypeCodeList,getContractList, getCooperationProjectList} from '@/utils/goods';
import { getStoreAdressRepot } from "@/utils/shop";
import Cropper from '@/components/common/cropper.vue'
import { originRules1, originRules2, originRules, originRules3 } from './rules';
......@@ -1011,9 +1042,13 @@
videoModel:{
videoFullPath: ''
},
businessCategoryList:[],
// businessCategoryList:[],
sumFile: 0,
uploadProgress:0, // 上传视频进度条
cooperationProjectList: [], // 合作项目
contractList: [], // 合同
isProject: false, // 是否选择合作项目
isContract: false, // 是否选择合同
}
},
computed: {
......@@ -1045,8 +1080,9 @@
this.curmbThird = this.title;
this.formData.storeId = Number(storeId) || '';
this.getTypeCodeList();
this.getBusinessCategory();
// this.getBusinessCategory();
this.getLever(0,1)
this.getCooperationProjectList();
dosageAll().then((res)=>{
this.doseAll = res.data
if (!this.doseAll) {
......@@ -1078,14 +1114,40 @@
}
},
methods: {
// 获取业务类型
getBusinessCategory(){
getBusinessCategory().then((res) => {
if (res.code == '000000') {
this.businessCategoryList=res.data
// 获取合同
getContractList(projectId) {
getContractList(projectId || 0).then(res => {
if(res.code == '000000') {
this.contractList = res.data;
console.log(this.contractList, 'this.contractList');
}
}).catch((err)=>{})
})
},
// 获取合作项目
getCooperationProjectList() {
getCooperationProjectList().then(res => {
if(res.code == '000000') {
this.cooperationProjectList = res.data;
}
})
},
getContract(projectId) {
this.formData3.contractId = '';
this.contractList = [];
this.getContractList(projectId);
},
projectClear() {
this.formData3.contractId = '';
this.contractList = [];
},
// 获取业务类型
// getBusinessCategory(){
// getBusinessCategory().then((res) => {
// if (res.code == '000000') {
// this.businessCategoryList=res.data
// }
// }).catch((err)=>{})
// },
// 判断imgurl是否有效
checkImgExists(imgurl) {
return new Promise(function(resolve, reject) {
......@@ -1135,12 +1197,14 @@
};
const { goodsInfo, medicalService, buyLimitDtoList, hasRepoFlag} = res.data;
const { goodsName, goodsDescription, goodsType,businessCategoryId, expressLimitFlag,goodsHeaderImages=[], goodsVideoList=[] } = goodsInfo;
const { goodsName, goodsDescription, goodsType, expressLimitFlag,goodsHeaderImages=[], goodsVideoList=[], contractId, cooperationProjectId } = goodsInfo;
this.isProject = Boolean(cooperationProjectId);
if(this.isProject) {this.getContractList(cooperationProjectId) }
this.isContract = Boolean(contractId);
this.formData = {...this.formData, ...goodsInfo};
this.formData2 = medicalService;
this.formData = { ...this.formData, ...this.formData2 };
this.formData3 = { goodsName, goodsDescription, goodsHeaderImages, goodsVideoList, goodsType,businessCategoryId, expressLimitFlag };
this.formData3 = { goodsName, goodsDescription, goodsHeaderImages, goodsVideoList, goodsType, expressLimitFlag, cooperationProjectId, contractId };
this.buyLimitDtoList = buyLimitDtoList;
this.hasRepoFlag = hasRepoFlag;
this.$set(this.formData2, 'suitableArr', this.formData.suitable.split(','));
......@@ -1192,12 +1256,15 @@
});
}
const {goodsList, hasRepoFlag } = res.data;
const { goodsName, goodsDescription, goodsType, businessCategoryId,expressLimitFlag, goodsHeaderImages=[], goodsVideoList=[] } = goodsList[0];
const { goodsName, goodsDescription, goodsType,expressLimitFlag, goodsHeaderImages=[], goodsVideoList=[],contractId, cooperationProjectId } = goodsList[0];
const goodDet = goodsList[0];
goodDet.otc1 = goodDet.otc ? '1' : '0';
this.isProject = Boolean(cooperationProjectId);
if(this.isProject) {this.getContractList(cooperationProjectId)}
this.isContract = Boolean(contractId);
this.formData1 = goodDet;
this.formData = goodDet;
this.formData3 = { goodsName, goodsDescription, goodsHeaderImages, goodsVideoList, goodsType,businessCategoryId, expressLimitFlag };
this.formData3 = { goodsName, goodsDescription, goodsHeaderImages, goodsVideoList, goodsType, expressLimitFlag,contractId, cooperationProjectId };
this.hasRepoFlag = hasRepoFlag;
this.buyLimitDtoList = this.formData.buyLimitDtoList;
this.formData.optPrice = this.formData.costPrice/100;
......@@ -1241,7 +1308,6 @@
};
this.barAndGoodsFlag = this.formData1.medicalCategoryId ? true : false;
}
console.log(this.formData);
},
getImges(d,type){
let a = [];
......@@ -1494,6 +1560,13 @@
this.formData.specificationImages = this.fileIntrList;
this.formData.buyLimitDtoList = this.buyLimitDtoList;
this.isgoodsImages = this.formData.goodsImages.length == 0 ? false :true;
const {cooperationProjectId, contractId} = this.formData3;
if ((cooperationProjectId && !contractId) || (!cooperationProjectId && contractId)) {
return this.$message({
message: '请选择项目-合同名称',
type: 'warning'
});
}
// 如果是【药品】类型的商品
// if(this.isMedic){
......
......@@ -66,7 +66,7 @@ const form = {
mostCount: -1,
incrType: 1,
saleType: 1,
minWhole: 0,
minWhole: 1,
expressLimitFlag: 0, //是否支持退货退款
};
......@@ -76,8 +76,10 @@ const form3 = {
goodsHeaderImages: [],
goodsVideoList: [],
goodsType: "",
businessCategoryId:"",
// businessCategoryId: "",
expressLimitFlag: 0, //是否支持退货退款
cooperationProjectId: '', // 合作项目id
contractId: '', // 合同id
};
......
此差异已折叠。
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册