modify:修改供应商管理-采购列表数据,修改合同附件的上传下载和删除
| | |
| | | // import request from "@/common/untils/request.js" |
| | | import axios from "axios" |
| | | import request from "@/common/untils/request.js" |
| | | // import axios from "axios" |
| | | |
| | | // 负责人 |
| | | export const getMemberListFromGrpc = async (data) => { |
| | | return await axios.get(`/api/m/getMemberListFromGrpc`, { |
| | | // export const getMemberListFromGrpc = async (data) => { |
| | | // return await axios.get(`/api/m/getMemberListFromGrpc`, { |
| | | // params: data |
| | | // }) |
| | | // } |
| | | export function getMemberListFromGrpc(data) { |
| | | return request({ |
| | | url: "/api/m/getMemberListFromGrpc", |
| | | method: "get", |
| | | params: data |
| | | }) |
| | | } |
| | | } |
| | |
| | | import request from "@/common/untils/request.js" |
| | | import axios from "axios" |
| | | // import axios from "axios" |
| | | |
| | | // 服务商列表 |
| | | export function getSupplierList(data) { |
| | |
| | | } |
| | | |
| | | // 上传合同 |
| | | export const createContract = async (data) => { |
| | | return await axios.post(`/api/con/createContract`, data, { |
| | | headers: { "Content-Type": "application/x-www-form-urlencoded;charset=utf-8" } |
| | | // export const createContract = async (data) => { |
| | | // return await axios.post(`/api/con/createContract`, data, { |
| | | // headers: { "Content-Type": "application/x-www-form-urlencoded;charset=utf-8" } |
| | | // }) |
| | | // } |
| | | export function createContract(data) { |
| | | return request({ |
| | | url: "/api/con/createContract", |
| | | method: "post", |
| | | data |
| | | }) |
| | | } |
| | | // 删除合同 |
| | |
| | | // 下载合同 |
| | | export function downloadContract(data) { |
| | | return request({ |
| | | url: "/api/con/downloadContract", |
| | | url: "/api/downloadContract", |
| | | method: "get", |
| | | params: data |
| | | }) |
| | |
| | | :disabled="editConfig.isDisabled" |
| | | v-model="editConfig.infomation.phone" |
| | | placeholder="请填写" |
| | | maxlength="11" |
| | | show-word-limit |
| | | clearable |
| | | ></el-input> |
| | | </el-form-item> |
| | |
| | | :show-download="false" |
| | | :amount-view="false" |
| | | :show-action-btn="false" |
| | | :placeholder="'请输入供应商/物料/采购单等'" |
| | | :placeholder="'请输入供应商名称/物料名称/采购单名称'" |
| | | @searchClick="onFilterSearch" |
| | | /> |
| | | </div> |
| | |
| | | <el-button v-if="scope.row.status===1" type="text" size="small" @click="btnCancel(scope.row)" style="margin-right: 5px" |
| | | >取消</el-button |
| | | > |
| | | <el-button v-if="scope.row.status===1" type="text" size="small" @click="btnDelete(scope.row)" style="margin-right: 5px" |
| | | <!-- <el-button v-if="scope.row.status===1" type="text" size="small" @click="btnDelete(scope.row)" style="margin-right: 5px" |
| | | >删除</el-button |
| | | > |
| | | > --> |
| | | <!-- <el-button v-if="scope.row.status< 4" @click="submitClick(scope.row)" type="text" size="small">提交</el-button> --> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | pagerOptions:{ |
| | | pageSize:15, |
| | | currPage:1, |
| | | } |
| | | }, |
| | | } |
| | | }, |
| | | created() { |
| | | console.log(this.$route.params,"路由参数") |
| | | if(this.$route.params.supplierId){ |
| | | this.editConfig.visible = true |
| | | this.editConfig.infomation.supplierId=this.$route.params.supplierId |
| | | this.editConfig.infomation.supplierName=this.$route.params.supplierName |
| | | } |
| | | this.setTable() |
| | | this.getData() |
| | | this.getSupplierData() |
| | |
| | | <div @click="addAnnexClick"> |
| | | <el-upload |
| | | class="upload-demo" |
| | | action="https://jsonplaceholder.typicode.com/posts/" |
| | | :headers="headers" |
| | | action="" |
| | | :limit="1" |
| | | :before-upload="beforeAvatarUpload" |
| | | :on-exceed="handleExceed" |
| | |
| | | createContract, |
| | | updateSupplier, |
| | | getIndustryList, |
| | | getSupplierTypeList |
| | | getSupplierTypeList, |
| | | // downloadContract |
| | | // previewContract |
| | | } from "@/api/supplierManage/supplier" |
| | | import EditDropdownDialog from "@/views/other/commonDialog/EditDropdownDialog" |
| | | import { getMemberListFromGrpc } from "@/api/common/other" |
| | | import download from "downloadjs" |
| | | // import { renderAsync } from "docx-preview" |
| | | // import axios from "axios" |
| | | import axios from "axios" |
| | | export default { |
| | | name: "AddSupplierDialog", |
| | | props: { |
| | |
| | | } |
| | | }, |
| | | components: { EditDropdownDialog }, |
| | | computed: {}, |
| | | computed: { |
| | | headers() { |
| | | const authorization = "Bearer "+document.cookie.replace(/(?:(?:^|.*;\s*)token\s*=\s*([^;]*).*$)|^.*$/, "$1")|| '' |
| | | return { authorization } |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | dialogWidth: "50%", |
| | |
| | | pageSize: 100 |
| | | }).then((res) => { |
| | | console.log(res) |
| | | this.memberOptions = res.data.data.list |
| | | this.memberOptions = res.data.list |
| | | }) |
| | | }, |
| | | // 供应商类型 |
| | |
| | | fd.append("name", file.name) |
| | | // 调用接口 |
| | | createContract(fd).then((res) => { |
| | | if (res.status == 200) { |
| | | console.log(res.data.data) |
| | | if (res.code == 200) { |
| | | this.file_name = file.name |
| | | this.file_id = res.data.data.id |
| | | this.file_id = res.data.id |
| | | } |
| | | }) |
| | | } |
| | |
| | | }, |
| | | // 下载合同 |
| | | downloadClick() { |
| | | let url = "/api/con/downloadContract?id=" + this.file_id |
| | | let url = "/api/downloadContract?id=" + this.file_id |
| | | download(url, "", "") |
| | | }, |
| | | // 删除合同 |
| | |
| | | // }) |
| | | }, |
| | | // 预览合同 |
| | | async previewClick() { |
| | | this.previewUrl = "/api/con/previewContract?id=" + this.file_id |
| | | if (this.file_name.includes("pdf")) { |
| | | window.open(this.previewUrl, "_blank") |
| | | } else { |
| | | let routeUrl = this.$router.resolve({ |
| | | path: "/PreviewFile", |
| | | query: { |
| | | //要传的参数 |
| | | previewUrl: this.previewUrl |
| | | } |
| | | }) |
| | | window.open(routeUrl.href, "_blank") |
| | | } |
| | | // async previewClick() { |
| | | // this.previewUrl = "/api/con/previewContract?id=" + this.file_id |
| | | // if (this.file_name.includes("pdf")) { |
| | | // window.open(this.previewUrl, "_blank") |
| | | // } else { |
| | | // let routeUrl = this.$router.resolve({ |
| | | // path: "/PreviewFile", |
| | | // query: { |
| | | // //要传的参数 |
| | | // previewUrl: this.previewUrl |
| | | // } |
| | | // }) |
| | | // window.open(routeUrl.href, "_blank") |
| | | // } |
| | | // } |
| | | async previewClick() { |
| | | this.previewUrl = "/api/previewContract?id=" + this.file_id |
| | | if (this.file_name.includes("pdf")) { |
| | | console.log("是pdf文件") |
| | | await axios.get(this.previewUrl, { headers: { "Authorization":"Bearer "+ document.cookie.replace(/(?:(?:^|.*;\s*)token\s*=\s*([^;]*).*$)|^.*$/, "$1")} }) |
| | | .then(response => { |
| | | window.open(this.previewUrl, "_blank") |
| | | console.log("response",response,this.previewUrl) |
| | | }) |
| | | .catch(error => { |
| | | console.error(error); |
| | | }); |
| | | } else { |
| | | console.log(this.previewUrl,"看看是啥子") |
| | | let routeUrl = this.$router.resolve({ |
| | | path: "/PreviewFile", |
| | | query: { |
| | | //要传的参数 |
| | | previewUrl: this.previewUrl |
| | | } |
| | | }) |
| | | window.open(routeUrl.href, "_blank") |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | </ul> |
| | | <div class="business_scope"> |
| | | <div class="content-title">{{ "合同附件" }}</div> |
| | | <div class="content-data"> |
| | | <div class="content-data" @click="downLoadFiles"> |
| | | {{ detailConfig.infomation.contract.fileName ? detailConfig.infomation.contract.fileName : "--" }} |
| | | </div> |
| | | </div> |
| | |
| | | <span style="margin-left: 10px">产品信息</span> |
| | | </div> |
| | | <div v-show="isBasicExpand" class="basic-info-content"> |
| | | <el-button type="primary" size="mini" @click="toPurchaseBtn"><i class="el-icon-plus"></i> 新建</el-button> |
| | | <TableCommonView |
| | | style="margin-top: 2px" |
| | | class="content-table" |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import download from "downloadjs" |
| | | export default { |
| | | name: "DetailSupplier", |
| | | props: { |
| | |
| | | noContactDays: 0, |
| | | newContactDays: "", |
| | | tableList:{}, |
| | | showCol: ['产品名称', '产品编码', '计量单位', '规格型号', '数量', '销售单价','价税合计','描述'], |
| | | showCol: ['采购单号', '采购单名称', '单据类型', '供应商名称', '采购数量', '收货仓库','经办人','制单人'], |
| | | tableColumn: [ |
| | | { label: "产品名称", prop: "name", min: 160, }, |
| | | { label: "产品编码", prop: "number", min: 130, }, |
| | | { label: "计量单位", prop: "unit", min: 130 }, |
| | | { label: "规格型号", prop: "specifications", min: 130 }, |
| | | { label: "数量", prop: "amount", min: 130 }, |
| | | { label: "销售单价", prop: "price", min: 130 }, |
| | | { label: "价税合计", prop: "total", min: 130 }, |
| | | { label: "描述", prop: "remark", min: 130 }, |
| | | { label: "单据类型", prop: "orderType", min: 130 }, |
| | | { label: "采购单号", prop: "number", min: 150, isCommonClick: true ,default:true}, |
| | | { label: "采购单名称", prop: "name", min: 130, isCommonClick: true }, |
| | | { label: "供应商名称", prop: "supplierName", min: 130 }, |
| | | { label: "采购数量", prop: "quantity", min: 130 }, |
| | | { label: "收货仓库", prop: "warehouse", min: 130 }, |
| | | { label: "经办人", prop: "handledBy", min: 130 }, |
| | | { label: "制单人", prop: "creator", min: 130 } |
| | | ], |
| | | } |
| | | }, |
| | | created() { |
| | | console.log(this.detailConfig,"抽屉组件") |
| | | console.log(this.commonDetail,"抽屉组件props") |
| | | this.setData(this.detailConfig.infomation) |
| | | this.addConfig = { |
| | | id_name: "sales_leads_id", |
| | |
| | | // console.log(totalDays) |
| | | |
| | | return totalDays // 相差的天数 |
| | | }, |
| | | toPurchaseBtn(){ |
| | | this.$router.push({ |
| | | name: 'purchase', |
| | | params: { |
| | | supplierId:this.commonDetail.infomation.ID, |
| | | supplierName:this.commonDetail.infomation.name |
| | | } |
| | | }); |
| | | }, |
| | | // 下载合同附件 |
| | | downLoadFiles(){ |
| | | let url = "/api/downloadContract?id=" + this.commonDetail.infomation.fileId |
| | | download(url, "", "") |
| | | } |
| | | } |
| | | } |