123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277 |
- import { apiFlowDetail, apiSealAdd, apiSearchCustome, apiSearchContract,apiSearchAllCustome,getBelongCompany } from "@/api/approve/seal.js";
- import { uploadFiles } from "@/utils/uploadFile.js";
- import { preViewFile } from "../utils/util.js";
- export const sealMixin = {
- computed: {
- typeLength() {
- if (this.type.length > 0) {
- return true;
- } else {
- return false;
- }
- },
- },
- watch: {
- showCustome() {
- this.searchCustomeVal = "";
- this.searchCustomeStatus = true;
- this.searchCustomeList = [];
- this.searchContractList = [];
- },
- showType() {
- if (!this.showType) {
- this.temType = JSON.parse(JSON.stringify(this.type));
- }
- },
- },
- data() {
- return {
- showPurpose: false,
- purposeArr: ["销售合同", "代付合同", "总对总协议", "渠道合同", "付款通知函", "招投标", "战略合作协议"],
- purpose: "",
- showType: false,
- typeArr: ["合同章", "公章", "法人章","电子合同章"],
- type: [],
- temType: [],
- showServiceType: false,
- ServiceTypeArr: ["新签合同", "续约合同", "补充协议",'代付合同'],
- ServiceType: "",
- showCustome: false,
- customeName: "",
- fileNum: "",
- remark: "",
- CreditCode: "",
- UseCompanyName: "",
- ContractId: 0,
-
-
-
-
-
-
- fileList:[],
- processData: null,
- radioVal: "系统合同",
- searchCustomeVal: "",
- searchCustomeStatus: true,
- searchCustomeList: [],
- searchContractList: [],
- allCustome:{
- index:1,
- list:[],
- finished:false,
- loading:false
- },
- temCustomeName:'',
-
-
- showBelongCompanyPop:false,
- belongCompany:'',
- belongCompanyOptions:[]
- };
- },
- methods: {
- async getBelongCompanyOptions(type='') {
- const res = await getBelongCompany()
- if(res.code !==200 ) return
- this.belongCompanyOptions = res.data || []
- if(type==='add'){
- this.belongCompany=this.belongCompanyOptions.length?this.belongCompanyOptions[0]:''
- }
- },
-
- handleDeleteCheckFile(file) {
- this.fileList = this.fileList.filter(item => item.url!= file.url)
- },
-
- handlePreviewFiles(e) {
- if (e.type === "pdf" || e.type === "word") {
- preViewFile(e.url);
- } else {
- uni.previewImage({
- urls: [e.url],
- });
- }
- },
-
- async handleUpload() {
- const res = await uploadFiles({ type: "all" });
- const reg = /\.(pdf)$/;
- const reg2 = /\.doc|\.docx$/;
- if (reg.test(res[0])) {
- this.fileList.push({
- type: "pdf",
- url: res[0],
- img: require("../static/pdf.png"),
- });
- } else if (reg2.test(res[0])) {
- this.fileList.push({
- type: "word",
- url: res[0],
- img: require("../static/word.png"),
- });
- } else {
- this.fileList.push({
- type: "img",
- url: res[0],
- img: res[0],
- });
- }
- },
-
-
- onSearchValChange(e) {
- this.searchCustomeVal = e.detail;
- },
-
- async onSearch() {
- if (!this.searchCustomeVal) {
- uni.showToast({
- title: "请输入搜索关键字",
- icon: "none",
- });
- return;
- }
- this.searchContractList = [];
- this.searchCustomeList = [];
- const res = await apiSearchCustome({ Keyword: this.searchCustomeVal });
- if (res.code === 200) {
- this.searchCustomeList = res.data;
- if (res.data.length === 0) {
- this.searchCustomeStatus = false;
- } else {
- this.searchCustomeStatus = true;
- }
- }
- },
-
- async getContract(e) {
- const res = await apiSearchContract({ Keyword: e });
- if (res.code === 200) {
- if (res.data.List) {
- this.searchContractList = res.data.List;
- } else {
- uni.showToast({
- title: "此客户无合同,请重新选择",
- icon: "none",
- });
- }
- }
- },
-
-
- handleComfirmBelongCmpany(e) {
- this.belongCompany = e.detail.value;
- this.showBelongCompanyPop = false;
- },
-
- handlePurposeConfirm(e) {
- this.purpose = e.detail.value;
- this.showPurpose = false;
- },
-
- handleTypeConfirm(e) {
- this.type = JSON.parse(JSON.stringify(this.temType));
- this.showType = false;
- this.getProcessData();
- },
-
- onChangeType(e) {
- this.temType = e.detail;
- },
-
- handleServiceTypeConfirm(e) {
- this.ServiceType = e.detail.value;
- this.showServiceType = false;
- },
-
- async getProcessData() {
- if(this.type.length===0) return
- let id = 0;
- if (this.type.includes("公章") || this.type.includes("法人章")) {
- id = 6;
- } else {
- id = 5;
- }
- let res = await apiFlowDetail({ FlowId: id });
- if (res.code === 200) {
- this.processData = res.data || null;
- }
- },
- handleAllCutomeInput(e){
- this.temCustomeName=e.detail.value
- this.allCustome.index=1
- this.allCustome.list=[]
- this.allCustome.finished=false
- this.allCustome.loading=false
- if(this.temCustomeName){
- this.getSearchAllCustome()
- }
- },
-
- async getSearchAllCustome(){
- this.allCustome.loading=true
- const res=await apiSearchAllCustome({
- PageSize:20,
- CurrentIndex:this.allCustome.index,
- Keyword:this.temCustomeName,
- })
- this.allCustome.loading=false
- if(res.code===200){
- if(res.data){
- this.allCustome.list=[...this.allCustome.list,...res.data]
- }else{
- this.allCustome.finished=true
- }
- }
- },
-
- handleScrollToLower(){
- if(this.allCustome.loading||this.allCustome.finished) return
- this.allCustome.index++
- this.getSearchAllCustome()
- },
- chooseAllCustomeItem(e){
- this.customeName=e.CompanyName
- this.allCustome.index=1
- this.allCustome.list=[]
- this.allCustome.finished=false
- this.allCustome.loading=false
-
- },
-
- handleClickPage(){
- if(this.allCustome.list.length>0){
- this.allCustome.index=1
- this.allCustome.list=[]
- this.allCustome.finished=false
- this.allCustome.loading=false
- }
- },
- },
- };
|