提交 e0ef2c11 编写于 作者: shuang.zhou's avatar shuang.zhou

新增商品页改造

上级 11195270
此差异已折叠。
......@@ -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: "查询合作项目",
});
};
......@@ -140,6 +140,37 @@
></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"
filterable>
<el-option
v-for="(item,index) in cooperationProjectList"
:key="item.projectName+'-'+index"
:label="item.projectName"
:value="item.cooperationProjectId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="合同名称" prop="contractId">
<el-select
v-model="formData3.contractId"
placeholder="请选择"
size="small"
: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">
......@@ -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,getBusinessCategory,getContractList, getCooperationProjectList} from '@/utils/goods';
import { getStoreAdressRepot } from "@/utils/shop";
import Cropper from '@/components/common/cropper.vue'
import { originRules1, originRules2, originRules, originRules3 } from './rules';
......@@ -1014,6 +1045,10 @@
businessCategoryList:[],
sumFile: 0,
uploadProgress:0, // 上传视频进度条
cooperationProjectList: [], // 合作项目
contractList: [], // 合同
isProject: false, // 是否选择合作项目
isContract: false, // 是否选择合同
}
},
computed: {
......@@ -1047,6 +1082,8 @@
this.getTypeCodeList();
this.getBusinessCategory();
this.getLever(0,1)
this.getCooperationProjectList();
this.getContractList();
dosageAll().then((res)=>{
this.doseAll = res.data
if (!this.doseAll) {
......@@ -1078,6 +1115,25 @@
}
},
methods: {
// 获取合同
getContractList(projectId) {
getContractList(projectId || 0).then(res => {
if(res.code == '000000') {
this.contractList = res.data;
}
})
},
// 获取合作项目
getCooperationProjectList() {
getCooperationProjectList().then(res => {
if(res.code == '000000') {
this.cooperationProjectList = res.data;
}
})
},
getContract(projectId) {
this.getContractList(projectId);
},
// 获取业务类型
getBusinessCategory(){
getBusinessCategory().then((res) => {
......@@ -1135,12 +1191,13 @@
};
const { goodsInfo, medicalService, buyLimitDtoList, hasRepoFlag} = res.data;
const { goodsName, goodsDescription, goodsType,businessCategoryId, expressLimitFlag,goodsHeaderImages=[], goodsVideoList=[] } = goodsInfo;
const { goodsName, goodsDescription, goodsType,businessCategoryId, expressLimitFlag,goodsHeaderImages=[], goodsVideoList=[], contractId, cooperationProjectId } = goodsInfo;
this.isProject = cooperationProjectId;
this.isContract = 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,businessCategoryId, expressLimitFlag, cooperationProjectId, contractId };
this.buyLimitDtoList = buyLimitDtoList;
this.hasRepoFlag = hasRepoFlag;
this.$set(this.formData2, 'suitableArr', this.formData.suitable.split(','));
......@@ -1192,12 +1249,14 @@
});
}
const {goodsList, hasRepoFlag } = res.data;
const { goodsName, goodsDescription, goodsType, businessCategoryId,expressLimitFlag, goodsHeaderImages=[], goodsVideoList=[] } = goodsList[0];
const { goodsName, goodsDescription, goodsType, businessCategoryId,expressLimitFlag, goodsHeaderImages=[], goodsVideoList=[],contractId, cooperationProjectId } = goodsList[0];
const goodDet = goodsList[0];
goodDet.otc1 = goodDet.otc ? '1' : '0';
this.isProject = cooperationProjectId;
this.isContract = contractId;
this.formData1 = goodDet;
this.formData = goodDet;
this.formData3 = { goodsName, goodsDescription, goodsHeaderImages, goodsVideoList, goodsType,businessCategoryId, expressLimitFlag };
this.formData3 = { goodsName, goodsDescription, goodsHeaderImages, goodsVideoList, goodsType,businessCategoryId, expressLimitFlag,contractId, cooperationProjectId };
this.hasRepoFlag = hasRepoFlag;
this.buyLimitDtoList = this.formData.buyLimitDtoList;
this.formData.optPrice = this.formData.costPrice/100;
......
......@@ -76,8 +76,10 @@ const form3 = {
goodsHeaderImages: [],
goodsVideoList: [],
goodsType: "",
businessCategoryId:"",
businessCategoryId: "",
expressLimitFlag: 0, //是否支持退货退款
cooperationProjectId: '', // 合作项目id
contractId: '', // 合同id
};
......
此差异已折叠。
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册