移动端

This commit is contained in:
JIAL 2024-06-14 15:12:48 +08:00
parent 16c372dd67
commit 8f1df9b9e9
24 changed files with 1523 additions and 92 deletions

View File

@ -1,5 +1,5 @@
#for tests only !
#Tue Jun 04 13:59:05 CST 2024
#Fri Jun 14 15:11:13 CST 2024
jco.destination.pool_capacity=10
jco.client.lang=ZH
jco.client.ashost=172.19.0.120
@ -7,5 +7,5 @@ jco.client.saprouter=
jco.client.user=RFC
jco.client.sysnr=00
jco.destination.peak_limit=10
jco.client.passwd=g]8^b-oV5)bg?0=#[a~}U*AcfC4BmB/D}?F8E5.6%iG`lg]L
jco.client.passwd=654321
jco.client.client=300

View File

@ -3,6 +3,7 @@ package com.ruoyi.web.controller.hainanOrder;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.hainanOrder.domain.HNCustomer;
import com.ruoyi.hainanOrder.domain.HNMaterial;
import com.ruoyi.hainanOrder.domain.HNParams;
import com.ruoyi.hainanOrder.service.HaiNanOrderService;
import org.springframework.beans.factory.annotation.Autowired;
@ -40,9 +41,15 @@ public class HaiNanOrderController extends BaseController {
}
@PostMapping("materialList")
public AjaxResult materialList(@RequestBody HNParams HNParams) {
public TableDataInfo materialList(@RequestParam("matnr") String matnr, @RequestParam("maktx3") String maktx3,
@RequestParam("maktx") String maktx, @RequestParam("maktx4") String maktx4,
@RequestParam("diany") String diany, @RequestParam("maktx5") String maktx5,
@RequestParam("maktx2") String maktx2) {
return null;
startPage();
List<HNMaterial> materialList = haiNanOrderService.materialList(matnr, maktx3, maktx, maktx4, diany, maktx5, maktx2);
return getDataTable(materialList);
}
@PostMapping("customList")
@ -56,4 +63,10 @@ public class HaiNanOrderController extends BaseController {
// return null;
}
@PostMapping("contractList")
public TableDataInfo contractList(@RequestParam("kunnr") String kunnr,
@RequestParam("name1") String name1) {
return null;
}
}

View File

@ -0,0 +1,34 @@
package com.ruoyi.web.controller.mobile.quoteMobile;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.mobile.quoteMobile.service.QuoteMobileService;
import com.ruoyi.quot.domain.Quot;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @ClassName QuoteMobileController
* @Description TODO
* @Author JIAL
* @Date 2024/6/12 10:07
* @Version 1.0
*/
@RestController
@RequestMapping("/quoteMobile/quote")
public class QuoteMobileController extends BaseController {
@Autowired
QuoteMobileService quoteMobileService;
@PostMapping("list")
public AjaxResult quoteList(Quot quot) {
List<Quot> quotList = quoteMobileService.quoteList(quot);
return AjaxResult.success(quotList) ;
}
}

View File

@ -1,6 +1,7 @@
package com.ruoyi.web.utils.SapFunction;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.contract.damain.Contract;
import com.ruoyi.customer.domain.Bank;
import com.ruoyi.customer.domain.BankCode;
import com.ruoyi.customer.domain.Customer;
@ -300,6 +301,44 @@ public class SapRfcUtils {
return countrys;
}
/**
* @title getContract
* @description 获取合同数据
* @author JIAL
* @param: param
* @updateTime 2024/6/11 16:09
* @return: java.util.List<com.ruoyi.web.utils.SapFunction.RfcResult>
*/
public static List<Contract> getContract(Object param) {
JCoFunction function = null;
Contract contract = null;
List<Contract> contractList = new ArrayList<>();
JCoDestination destination = ConnectToSAP.connect();
try {
function = destination.getRepository().getFunctionTemplate("ZYC_HTCX").getFunction();
if (function == null)
throw new RuntimeException("RFC_SYSTEM_INFO not found in SAP.");
JCoParameterList input = function.getImportParameterList();
input.setValue("HTH", StringUtils.isNotNull(param)?param:"X");//输入参数
input.setValue("KHNAME", StringUtils.isNotNull(param)?param:"X");//输入参数
input.setValue("CTRQB", StringUtils.isNotNull(param)?param:"X");//输入参数
input.setValue("FLAG40", StringUtils.isNotNull(param)?param:"X");//输入参数
input.setValue("FLAG40", StringUtils.isNotNull(param)?param:"X");//输入参数
function.execute(destination);
JCoTable table = function.getTableParameterList().getTable("OUTHT");
for(int i = 0; i<table.getNumRows(); i++){
table.setRow(i);
// rfcResult = new RfcResult();
// rfcResult.setValue(table.getString("TAXKD"));
// rfcResult.setLabel(table.getString("VTEXT"));
// countrys.add(rfcResult);
}
}catch (Exception e) {
e.printStackTrace();
}
return contractList;
}
/**
* 获取客户税分类数据
* @param param 不传查询全部

View File

@ -0,0 +1,92 @@
package com.ruoyi.contract.damain;
/**
* @ClassName Contract
* @Description TODO
* @Author JIAL
* @Date 2024/6/11 17:08
* @Version 1.0
*/
public class Contract {
String htbh2; //合同编号
String ZSDYWYBM; //业务员编码
String ZSDYWYMS; //业务员名称
String ZSDKUNNR; //客户编码
String ZSDNAME; //客户名称
String XM; //项目
String ZSDBZ02; //备注
String HTZE; //合同金额
String ZSDHTCJSJ; //创建日期
public String getHtbh2() {
return htbh2;
}
public void setHtbh2(String htbh2) {
this.htbh2 = htbh2;
}
public String getZSDYWYBM() {
return ZSDYWYBM;
}
public void setZSDYWYBM(String ZSDYWYBM) {
this.ZSDYWYBM = ZSDYWYBM;
}
public String getZSDYWYMS() {
return ZSDYWYMS;
}
public void setZSDYWYMS(String ZSDYWYMS) {
this.ZSDYWYMS = ZSDYWYMS;
}
public String getZSDKUNNR() {
return ZSDKUNNR;
}
public void setZSDKUNNR(String ZSDKUNNR) {
this.ZSDKUNNR = ZSDKUNNR;
}
public String getZSDNAME() {
return ZSDNAME;
}
public void setZSDNAME(String ZSDNAME) {
this.ZSDNAME = ZSDNAME;
}
public String getXM() {
return XM;
}
public void setXM(String XM) {
this.XM = XM;
}
public String getZSDBZ02() {
return ZSDBZ02;
}
public void setZSDBZ02(String ZSDBZ02) {
this.ZSDBZ02 = ZSDBZ02;
}
public String getHTZE() {
return HTZE;
}
public void setHTZE(String HTZE) {
this.HTZE = HTZE;
}
public String getZSDHTCJSJ() {
return ZSDHTCJSJ;
}
public void setZSDHTCJSJ(String ZSDHTCJSJ) {
this.ZSDHTCJSJ = ZSDHTCJSJ;
}
}

View File

@ -0,0 +1,92 @@
package com.ruoyi.hainanOrder.domain;
/**
* @ClassName HNMaterial
* @Description TODO
* @Author JIAL
* @Date 2024/6/4 16:30
* @Version 1.0
*/
public class HNMaterial {
String id;
String matnr;
String maktx;
String kmein;
String vtext;
String yxh;
String kbetr;
String dwjz;
String fdyq;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getMatnr() {
return matnr;
}
public void setMatnr(String matnr) {
this.matnr = matnr;
}
public String getMaktx() {
return maktx;
}
public void setMaktx(String maktx) {
this.maktx = maktx;
}
public String getKmein() {
return kmein;
}
public void setKmein(String kmein) {
this.kmein = kmein;
}
public String getVtext() {
return vtext;
}
public void setVtext(String vtext) {
this.vtext = vtext;
}
public String getYxh() {
return yxh;
}
public void setYxh(String yxh) {
this.yxh = yxh;
}
public String getKbetr() {
return kbetr;
}
public void setKbetr(String kbetr) {
this.kbetr = kbetr;
}
public String getDwjz() {
return dwjz;
}
public void setDwjz(String dwjz) {
this.dwjz = dwjz;
}
public String getFdyq() {
return fdyq;
}
public void setFdyq(String fdyq) {
this.fdyq = fdyq;
}
}

View File

@ -1,9 +1,12 @@
package com.ruoyi.hainanOrder.mapper;
import com.ruoyi.hainanOrder.domain.HNCustomer;
import com.ruoyi.hainanOrder.domain.HNMaterial;
import com.ruoyi.hainanOrder.domain.HNParams;
import com.ruoyi.hainanOrder.domain.HaiNanOrder;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
@ -19,4 +22,9 @@ public interface HaiNanOrderMapper {
List<HNCustomer> customList(@Param("kunnr") String kunnr,
@Param("name1")String name1);
List<HNMaterial> materialList(@Param("matnr") String matnr, @Param("maktx3") String maktx3,
@Param("maktx") String maktx, @Param("maktx4") String maktx4,
@Param("diany") String diany, @Param("maktx5") String maktx5,
@Param("maktx2") String maktx2);
}

View File

@ -1,6 +1,9 @@
package com.ruoyi.hainanOrder.service;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.hainanOrder.domain.HNCustomer;
import com.ruoyi.hainanOrder.domain.HNMaterial;
import com.ruoyi.hainanOrder.domain.HNParams;
import com.ruoyi.hainanOrder.domain.HaiNanOrder;
@ -36,4 +39,20 @@ public interface HaiNanOrderService {
*/
List<HNCustomer> customList(String kunnr, String name1);
/**
* @title materialList
* @description 获取物料列表
* @author JIAL
* @param: matnr
* @param: maktx3
* @param: maktx
* @param: maktx4
* @param: diany
* @param: maktx5
* @param: maktx2
* @updateTime 2024/6/4 16:37
* @return: java.util.List<com.ruoyi.hainanOrder.domain.HNMaterial>
*/
List<HNMaterial> materialList(String matnr, String maktx3, String maktx,
String maktx4, String diany, String maktx5, String maktx2);
}

View File

@ -3,6 +3,7 @@ package com.ruoyi.hainanOrder.service.impl;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.hainanOrder.domain.HNCustomer;
import com.ruoyi.hainanOrder.domain.HNMaterial;
import com.ruoyi.hainanOrder.domain.HaiNanOrder;
import com.ruoyi.hainanOrder.domain.HNParams;
import com.ruoyi.hainanOrder.mapper.HaiNanOrderMapper;
@ -25,7 +26,7 @@ public class HaiNanOrderServiceImpl implements HaiNanOrderService {
HaiNanOrderMapper haiNanOrderMapper;
@Override
@DataSource(DataSourceType.ORDER)
@DataSource(DataSourceType.MASTER)
public List<HaiNanOrder> orderList(HNParams HNParams) {
return haiNanOrderMapper.orderList(HNParams);
}
@ -35,4 +36,11 @@ public class HaiNanOrderServiceImpl implements HaiNanOrderService {
public List<HNCustomer> customList(String kunnr, String name1) {
return haiNanOrderMapper.customList(kunnr, name1);
}
@Override
@DataSource(DataSourceType.MASTER)
public List<HNMaterial> materialList(String matnr, String maktx3, String maktx,
String maktx4, String diany, String maktx5, String maktx2) {
return haiNanOrderMapper.materialList(matnr, maktx3, maktx, maktx4, diany, maktx5, maktx2);
}
}

View File

@ -0,0 +1,17 @@
package com.ruoyi.mobile.quoteMobile.domain;
/**
* @ClassName MQuote
* @Description TODO
* @Author JIAL
* @Date 2024/6/12 10:26
* @Version 1.0
*/
public class MQuote {
String quot_customer_name; //客户
String quot_project; //项目名称
String quot_approval_status; //提交状态
String quot_inquiry_date; //询价日期
String quot_quotation_date; //报价日期
String create_time; //创建日期
}

View File

@ -0,0 +1,16 @@
package com.ruoyi.mobile.quoteMobile.mapper;
import com.ruoyi.quot.domain.Quot;
import java.util.List;
/**
* @ClassName QuoteMobileMapper
* @Description TODO
* @Author JIAL
* @Date 2024/6/12 10:11
* @Version 1.0
*/
public interface QuoteMobileMapper {
List<Quot> quoteList();
}

View File

@ -0,0 +1,26 @@
package com.ruoyi.mobile.quoteMobile.service;
import com.ruoyi.hainanOrder.domain.HNParams;
import com.ruoyi.hainanOrder.domain.HaiNanOrder;
import com.ruoyi.quot.domain.Quot;
import java.util.List;
/**
* @ClassName QuoteMobileService
* @Description TODO
* @Author JIAL
* @Date 2024/6/12 10:10
* @Version 1.0
*/
public interface QuoteMobileService {
/**
* @title quoteList
* @description 获取报价列表
* @author JIAL
* @updateTime 2024/6/12 11:10
* @return: java.util.List<com.ruoyi.quot.domain.Quot>
*/
List<Quot> quoteList(Quot quot);
}

View File

@ -0,0 +1,29 @@
package com.ruoyi.mobile.quoteMobile.service.impl;
import com.ruoyi.mobile.quoteMobile.mapper.QuoteMobileMapper;
import com.ruoyi.mobile.quoteMobile.service.QuoteMobileService;
import com.ruoyi.quot.domain.Quot;
import com.ruoyi.quot.mapper.QuotMapper;
import org.apache.ibatis.jdbc.Null;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @ClassName QuoteMobileServiceImpl
* @Description TODO
* @Author JIAL
* @Date 2024/6/12 10:11
* @Version 1.0
*/
@Service
public class QuoteMobileServiceImpl implements QuoteMobileService {
@Autowired
QuotMapper quotMapper;
@Override
public List<Quot> quoteList(Quot quot) {
return quotMapper.selectQuotList(quot);
}
}

View File

@ -98,7 +98,7 @@
LEFT JOIN sapuser s on s.sapid=a.kunnr1
<!--LEFT JOIN sapusertp s1 on s1.sapid=a.kunnr1 -->
LEFT JOIN sapuser sb on sb.sapid=a.kunnrgwds
LEFT JOIN sys_user tuser2 ON tuser2.id =a.create_by
LEFT JOIN sys_user tuser2 ON tuser2.user_name =a.create_by
</sql>
<sql id="customerOrderTpJoins">
@ -169,4 +169,33 @@
</where>
GROUP BY kunnr,name1,name2
</select>
<select id="materialList" resultType="HNMaterial">
select wl.id,wl.matnr,wl.maktx,wl.meins kmein,wl.vtext,a.原型号 as yxh,case when A.当前厂价=0 then null else A.当前厂价 end as kbetr,wl.dwjz,wl.mrbs fdyq from material wl left join
Redbook.RedBook.dbo.sdmdm1 A
on A.matnr='0000000000'+wl.matnr
<where>
and wl.matnr like '3%' and wl.sfyx='0' and (wl.mstav is null or wl.mstav='')
<if test="matnr !=null and matnr!= ''" >
and wl.matnr like '%${matnr}%'
</if>
<if test="maktx !=null and maktx!= ''" >
and (wl.maktx like '%${maktx}%' or wl.yxh like '%${maktx}%')
</if>
<if test="maktx3 !=null and maktx3!= ''" >
and wl.maktx like '${maktx3}%'
</if>
<if test="maktx4 !=null and maktx4!= ''" >
and wl.maktx like '%${maktx4}%'
</if>
<if test="maktx5 !=null and maktx5!= ''" >
and wl.maktx like '%${maktx5}%'
</if>
<if test="diany !=null and diany!= ''" >
and wl.diany like '%${diany}%'
</if>
and wl.maktx not like '%删%'
</where>
</select>
</mapper>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.mobile.quoteMobile.mapper.QuoteMobileMapper">
</mapper>

View File

@ -13,7 +13,7 @@ export function getMaterialList(query) {
return request({
url: '/orderManage_Hn/order/materialList',
method: 'post',
data: query
params: query
})
}
@ -25,4 +25,12 @@ export function getCustomList(query) {
})
}
export function getContractList(query) {
return request({
url: '/orderManage_Hn/order/contractList',
method: 'post',
params: query
})
}

View File

@ -0,0 +1,10 @@
import request from '@/utils/request'
//查询报价列表
export function getQuoteList(param) {
return request({
url: '/quoteMobile/quote/list',
method: 'post',
params: param
})
}

View File

@ -99,7 +99,6 @@ export const constantRoutes = [
path: '/hainanOrder/index',
component: Layout,
hidden: true,
permissions: ['hainanOrder:operation:list'],
children: [
{
path: '',
@ -108,8 +107,34 @@ export const constantRoutes = [
meta: { title: '海南订单新建', activeMenu: '/hainanOrder/operation' }
}
]
},
{
path: '/quoteMobile/index',
component: Layout,
hidden: true,
children: [
{
path: '',
component: () => import('@/views/mobile/quoteMobile/index'),
name: 'quoteMobile',
meta: { title: '报价单列表', activeMenu: '/mobile/quoteMobile' }
}
]
},
{
path: '/quoteMobile/add',
component: Layout,
hidden: true,
children: [
{
path: '',
component: () => import('@/views/mobile/quoteMobile/operation/add'),
name: 'quoteMobile',
meta: { title: '新建报价单', activeMenu: '/mobile/quoteMobile/operation' }
}
]
},
]
// 动态路由,基于用户权限动态去加载
export const dynamicRoutes = [

View File

@ -1,6 +1,6 @@
<template>
<!------------------------ dialog控件 ------------------------------------>
<el-dialog class="materialDialogTable" :visible.sync="visible" width="1100px" @close="closeDialog">
<el-dialog class="materialDialogTable" :visible.sync="visible" width="1150px" @close="closeDialog">
<div slot="title" style="margin: 0px; padding: 0px">
<el-form :model="queryParams" ref="queryParams" size="small" :inline="true">
<el-form-item>
@ -43,7 +43,7 @@
</el-form>
</div>
<div style="display: flex; flex-direction: row;">
<div style="width: 700px">
<div style="width: 800px">
<el-table
:data="materialDialogData"
@selection-change="handleSelectionChange"
@ -56,7 +56,7 @@
border>
<el-table-column
type="selection"
width="55">
width="40">
</el-table-column>
<el-table-column
label="序号"
@ -64,32 +64,32 @@
width="55">
</el-table-column>
<el-table-column
width="120"
width="100"
prop="matnr"
label="物料">
</el-table-column>
<el-table-column
width="120"
width="250"
prop="maktx"
label="物料描述">
</el-table-column>
<el-table-column
width="120"
width="100"
prop="kbetr"
label="价格">
</el-table-column>
<el-table-column
width="125"
width="100"
prop="vtext"
label="物料类型">
</el-table-column>
<el-table-column
width="120"
width="55"
prop="kmein"
label="计量单位">
</el-table-column>
<el-table-column
width="102"
width="100"
prop="dwjz"
label="单位净重">
</el-table-column>
@ -108,7 +108,7 @@
:key="index"
class="selected-item"
>
{{ selectedItem.model }} , {{ selectedItem.specification }} , {{ selectedItem.voltLevel }}
{{ selectedItem.maktx }}
<el-button @click="removeSelectedItem(selectedItem)" type="text" class="remove-btn">&#10006;</el-button>
</div>
</div>
@ -191,6 +191,9 @@ export default {
/**-------------------确认选择-----------------**/
confirmSelection() {
this.$emit('confirm-selection', this.selectedMaterialItems);
this.selectedMaterialItems = [];
this.$refs.materialDialogData.clearSelection();
this.closeDialog();
},
closeDialog() {
this.$emit('update:visible', false);

View File

@ -0,0 +1,156 @@
<template>
<el-dialog
:width="width || '900px'"
:height="height || '650px'"
:visible.sync="open"
:show-close="false" append-to-body>
<div slot="title" style="margin: 0px; padding: 0px">
<el-form :model="queryParams" ref="queryForm" size="mini" label-width="100px">
<el-form-item label="公司编码" prop="Code">
<el-input v-model="queryParams.Code" placeholder="请输入公司编码" clearable :style="{width: '100%'}">
</el-input>
</el-form-item>
<el-form-item label="公司名称" prop="Name">
<el-input v-model="queryParams.Name" placeholder="请输入公司名称" clearable :style="{width: '100%'}">
</el-input>
</el-form-item>
<el-form-item >
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"> 搜索 </el-button>
</el-form-item>
</el-form>
</div>
<el-table v-loading="loading" ref="table" :data="pagedData" @selection-change="handleSelectionChange" height="300">
<el-table-column type="selection" width="55" align="center" />
<el-table-column align="center">
<template slot-scope="scope">
<div class="table-cell">
<div class="table-cell-field">{{ scope.row.value }}</div>
<div class="table-cell-field">{{ scope.row.label }}</div>
</div>
</template>
</el-table-column>
<!-- <el-table-column label="公司编码" align="center" prop="value" />-->
<!-- <el-table-column label="公司名称" align="center" prop="label" />-->
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="currentPage"
:limit.sync="pageSize"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="confirm" :disabled="single"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { listCustomer } from "@/api/common/sapRfc";// sap-rfc
export default {
name: "CustomerSelect",
props: {
width: {
type: String,
default: "900px",
},
height: {
type: String,
default: '650px'
},
open: {
type: Boolean,
default:false,
}
},
data() {
return {
//
loading: false,
//
single: true,
//
multiple: true,
//
queryParams: {
Code: null,
Name: null
},
//
total: 0,
pageSize: 10,
currentPage: 1,
customerList: [],
//
checkedCustomer: null,
}
},
methods: {
/** 切换每页显示条数 */
handleSizeChange(val) {
this.pageSize = val;
this.currentPage = 1;
},
/** 页码选择 */
handleCurrentChange(val) {
this.currentPage = val;
},
/** 查询客户管理列表 */
getList() {
this.loading = true;
listCustomer(this.queryParams).then(response => {
this.customerList = response.data;
this.total = response.data.length;
this.currentPage = 1;
this.loading = false;
});
},
/** 搜索按钮操作 */
handleQuery() {
if(this.queryParams.Code || this.queryParams.Name){
this.queryParams.pageNum = 1;
this.getList();
}else{
this.$message.warning("请输入查询条件!");
return;
}
},
//
handleSelectionChange(selection) {
this.checkedCustomer = selection[0];
this.single = selection.length!==1
this.multiple = !selection.length
},
//
cancel() {
this.customerList = [];
this.total = 0;
this.resetForm("queryForm");
this.$emit('cancel');
},
//
confirm() {
this.customerList = [];
this.total = 0;
this.resetForm("queryForm");
this.$emit("submit", this.checkedCustomer); //usernamenickname
},
},
computed: {
//
pagedData() {
const startIndex = (this.currentPage - 1) * this.pageSize;
const endIndex = startIndex + this.pageSize;
return this.customerList.slice(startIndex, endIndex);
},
},
}
</script>
<style scoped>
</style>

View File

@ -3,9 +3,9 @@
<el-form :model="addOrderParam" ref="addOrderParam" size="small" :inline="true" v-show="showSearch" label-width="160px">
<el-row :gutter="8">
<el-col :span="12">
<el-form-item label="售达方" prop="soldToParty">
<el-form-item label="售达方" prop="kunnr">
<div class="flex-container">
<el-input v-model="addOrderParam.kunnr" placeholder="客户编号" :style="{ width: inputWidth_1 }"></el-input>
<el-input :disabled="true" v-model="addOrderParam.kunnr" placeholder="客户编号" :style="{ width: inputWidth_1 }"></el-input>
<el-button type="text" size="small" @click="openCustomDialog" class="flex-button">+选择客户</el-button>
</div>
</el-form-item>
@ -13,6 +13,7 @@
<el-col :span="12">
<el-form-item label="售达方描述" prop="soldPartyDesc">
<el-input
:disabled="true"
:style="{ width: inputWidth_1 }"
v-model="addOrderParam.kna1"
placeholder="客户描述"
@ -25,24 +26,24 @@
<el-col :span="12">
<el-form-item label="合同号">
<div class="flex-container">
<el-select :style="{ width: inputWidth_2 }" v-model="addOrderParam.auart" placeholder="销售凭证类型" clearable>
<el-select :style="{ width: inputWidth_2 }" v-model="addOrderParam.hasHt" clearable>
<el-option
v-for="dict in dict.type.sales_voucher_type"
v-for="dict in hasHtDict"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
<el-input :style="{ width: inputWidth_2 }" v-model="addOrderParam.kunnr" placeholder="合同号" ></el-input>
<el-button type="text" size="small" class="flex-button">+选择合同</el-button>
<el-input :style="{ width: inputWidth_2 }" :disabled="addOrderParam.hasHt === 0" v-model="addOrderParam.bstkd" placeholder="合同号" ></el-input>
<el-button :disabled="addOrderParam.hasHt === 0" type="text" size="small" @click="openContractDialog" class="flex-button">+选择合同</el-button>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="业务员编码及姓名">
<div class="flex-container">
<el-input :style="{ width: inputWidth_2 }" v-model="addOrderParam.kunnr" placeholder="客户编号" ></el-input>
<el-input :style="{ width: inputWidth_2 }" v-model="addOrderParam.kunnr" placeholder="客户编号" ></el-input>
<el-input :disabled="true" :style="{ width: inputWidth_2 }" v-model="addOrderParam.kunnr1" placeholder="客户编号" ></el-input>
<el-input :disabled="true" :style="{ width: inputWidth_2 }" v-model="addOrderParam.sapname" placeholder="客户编号" ></el-input>
</div>
</el-form-item>
</el-col>
@ -50,12 +51,13 @@
<el-form-item label="销售组织描述" prop="vkorg">
<el-input
:disabled="true"
v-model="addOrderParam.vkorg"
placeholder="销售组织描述"
clearable
/>
</el-form-item>
<el-form-item label="销售凭证类型" prop="zsdshdz">
<el-form-item label="销售凭证类型" prop="auart">
<el-select v-model="addOrderParam.auart" placeholder="销售凭证类型" clearable>
<el-option
v-for="dict in dict.type.sales_voucher_type"
@ -83,6 +85,7 @@
</el-form-item>
<el-form-item label="定价日期" prop="prsdt">
<el-input
:disabled="true"
v-model="addOrderParam.prsdt"
placeholder="定价日期"
clearable
@ -140,10 +143,10 @@
</el-form-item>
<el-form-item label="订单编号" prop="orderNumber">
<el-input
:disabled="true"
v-model="addOrderParam.orderNumber"
placeholder="订单编号"
clearable
/>
</el-form-item>
<el-row :gutter="8">
@ -152,28 +155,26 @@
<div class="flex-container">
<el-input
:style="{ width: inputWidth_1 }"
v-model="addOrderParam.kna1"
placeholder="客户描述"
v-model="addOrderParam.zsdshdz"
placeholder="送货地址"
clearable
/>
<el-button type="text" size="small" class="flex-button">+门店地址</el-button>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注信息" prop="orderNumber">
<el-form-item label="备注信息" prop="remarks">
<el-input
type="textarea"
:style="{ width: inputWidth_1 }"
:rows="2"
placeholder="请输入内容"
v-model="addOrderParam.orderNumber">
v-model="addOrderParam.remarks">
</el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
@ -225,22 +226,73 @@
<right-toolbar :showSearch.sync="showSearch" ></right-toolbar>
</el-row>
<el-table width="100%" :data="orderList" :row-class-name="rowOrderIndex" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table width="100%" class="materialTable" :data="orderList" :row-class-name="rowOrderIndex" :cell-style="cellStyle">
<el-table-column label="序号" align="center" prop="index" width="80"/>
<el-table-column label="物料编号" width="100" align="center" prop="kna1" />
<el-table-column label="物料描述" width="100" align="center" prop="vdatu" />
<el-table-column label="订单数量" width="150" align="center" prop="orderid" />
<el-table-column label="开票价" width="150" align="center" prop="zsdywlxmb" />
<el-table-column label="销售单位" width="150" align="center" prop="zsdshdz" />
<el-table-column label="单位净重(KG/KM)" width="150" align="center" prop="bstkd" />
<el-table-column label="厂价" width="150" align="center" prop="pzh" />
<el-table-column label="开票价/厂价" width="150" align="center" prop="totalPrice3" />
<el-table-column label="分段要求" width="150" align="center" prop="remarks" />
<el-table-column label="备注" width="150" align="center" prop="state" />
<el-table-column label="客户采购订单号" width="150" align="center" prop="tabindex" />
<el-table-column label="客户采购订单行项目" width="150" align="center" prop="tabindex" />
<el-table-column label="是否远程监造" width="150" align="center" prop="tabindex" />
<el-table-column label="物料编号" width="100" align="center" prop="matnr" />
<el-table-column label="物料描述" width="250" align="center" prop="maktx" />
<el-table-column label="订单数量" width="150" align="center" prop="kwmeng" >
<template v-slot="scope">
<el-input v-model="scope.row.kwmeng" >
</el-input>
</template>
</el-table-column>
<el-table-column label="开票价" width="150" align="center" prop="zsdhtj" >
<template v-slot="scope">
<el-input v-model="scope.row.zsdhtj" >
</el-input>
</template>
</el-table-column>
<el-table-column label="销售单位" width="150" align="center" prop="vrkme" />
<el-table-column label="单位净重(KG/KM)" width="150" align="center" prop="dwjz" />
<el-table-column label="厂价" width="150" align="center" prop="changjia" />
<el-table-column label="开票价/厂价" width="150" align="center" prop="kpjbl" >
<template v-slot="scope">
<el-input v-model="scope.row.kpjbl" c>
</el-input>
</template>
</el-table-column>
<el-table-column label="分段要求" width="150" align="center" prop="fdyq" >
<template v-slot="scope">
<el-select v-model="scope.row.fdyq" placeholder="分段要求" clearable>
<el-option
v-for="dict in fdyqDict"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column label="备注" width="250" align="center" prop="zsdsobz" >
<template v-slot="scope">
<el-input v-model="scope.row.zsdsobz" >
</el-input>
</template>
</el-table-column>
<el-table-column label="客户采购订单号" width="150" align="center" prop="bstkdE" >
<template v-slot="scope">
<el-input v-model="scope.row.bstkdE" >
</el-input>
</template>
</el-table-column>
<el-table-column label="客户采购订单行项目" width="150" align="center" prop="posexE" >
<template v-slot="scope">
<el-input v-model="scope.row.posexE" >
</el-input>
</template>
</el-table-column>
<el-table-column label="是否远程监造" width="150" align="center" prop="zsdycjz" >
<template v-slot="scope">
<el-select v-model="scope.row.zsdycjz" placeholder="是否远程监造" clearable>
<el-option
v-for="dict in zsdycjzDict"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" align="center" width="150">
<template slot-scope="scope">
<el-button
@ -257,7 +309,7 @@
</el-form>
<MaterialDialog
:visible.sync="dialogMaterialVisible"
@confirm-selection="handleConfirmSelection"
@confirm-selection="materialDialogConfirmSelection"
@query="queryMaterialList"
:materialDialogData="materialDialogData"
:total="materialDialogTotal"
@ -299,7 +351,9 @@
width="75"
prop="operation"
label="操作">
<el-button type="text" size="small">选择</el-button>
<template slot-scope="scope">
<el-button type="text" @click="chooseCustom(scope.row)" size="small">选择</el-button>
</template>
</el-table-column>
</el-table>
<pagination
@ -317,6 +371,96 @@
</el-button-group>
</div>
</el-dialog>
<el-dialog :visible.sync="contractVisible" width="1100px" @close="closeContractDialog">
<div slot="title" style="margin: 0px; padding: 0px">
<el-form :model="contractDialogParams" ref="contractDialogParams" size="small" :inline="true">
<el-form-item label="合同编号" prop="hetongid">
<el-input v-model="contractDialogParams.hetongid" placeholder="合同编号(选填)"></el-input>
</el-form-item>
<el-form-item label="客户名称" prop="customname">
<el-input v-model="contractDialogParams.customname" placeholder="客户名称(选填)"></el-input>
</el-form-item>
<el-form-item label="日期(起-止)" prop="dateRange">
<el-date-picker
v-model="contractDialogParams.dateRange"
style="width: 215px"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="queryContract">搜索</el-button>
</el-form-item>
</el-form>
</div>
<div>
<el-table
:data="contractDialogData"
ref="contractDialogData"
:header-cell-style="{ background: '#eef1f6', color: '#606266', 'text-align': 'center', 'padding': '0px'}"
:cell-style="{'text-align': 'center', 'padding': '5px 0px'}"
highlight-selection-row
border>
<el-table-column
label="序号"
type="index"
width="55">
</el-table-column>
<el-table-column
width="160"
prop="htqdrq"
label="合同日期">
</el-table-column>
<el-table-column
width="130"
prop="htbh2"
label="合同号">
</el-table-column>
<el-table-column
width="160"
prop="zsdywyms"
label="业务员">
</el-table-column>
<el-table-column
width="160"
prop="zsdname"
label="客户">
</el-table-column>
<el-table-column
width="160"
prop="zsdhtje"
label="合同金额">
</el-table-column>
<el-table-column
width="160"
prop="zsdbz02"
label="备注">
</el-table-column>
<el-table-column
width="75"
prop="operation"
label="操作">
<el-button type="text" size="small">选择</el-button>
</el-table-column>
</el-table>
<pagination
v-show="contractDialogTotal>0"
:total="contractDialogTotal"
:page.sync="contractDialogParams.pageNum"
:limit.sync="contractDialogParams.pageSize"
@pagination="queryContract"
/>
</div>
<div style="text-align: center; padding-top: 20px">
<el-button-group>
<el-button type="primary" size="small" style="margin-right: 80px" @click="confirmContractSelection">确认</el-button>
<el-button type="warning" size="small" @click="closeContractDialog">取消</el-button>
</el-button-group>
</div>
</el-dialog>
</div>
</template>
@ -328,7 +472,7 @@
}
</style>
<script>
import { getOrderList, getMaterialList, getCustomList} from "@/api/hainanOrder/order";
import { getMaterialList, getCustomList, getContractList } from "@/api/hainanOrder/order";
import MaterialDialog from '@/views/components/Tools/MaterialDialog/index.vue';
export default {
name: "AddOrder",
@ -353,6 +497,20 @@ export default {
{value: 3, label: '定做'},
{value: 4, label: '有货备库,无货定做'}
],
fdyqDict: [
{value: '0', label: '选择分段'},
{value: 2, label: '整根'},
{value: 3, label: '其他分段'},
{value: 1, label: "100米/卷"}
],
zsdycjzDict: [
{label: '否'},
{value: 'X', label: '是'}
],
hasHtDict: [
{value: 0, label: '无'},
{value: 1, label: '有'}
],
//
ids: [],
//
@ -372,12 +530,21 @@ export default {
name1: ''
},
addOrderParam: {
vkorg: '海南富诚',
kna1: null,
hasHt: '',
kunnr1: '',
bstkd: null,
auart: '',
sapname: '',
zsdshdz: null,
orderid: null,
pzh: null,
state: null,
vdatu: '',
vtweg: '',
prsdt: '',
zsdywlxmb: '',
isprint: '',
sfdz: '',
orderNumber: '',
dateRange: [],
remarks: null
},
@ -395,6 +562,18 @@ export default {
customDialogData: [
],
//
contractDialogParams: {
pageNum: 1,
pageSize: 10,
hetongid: '',
customname: '',
dateRange: []
},
contractVisible: false,
contractDialogData: [],
contractDialogTotal: 0,
};
},
created() {
@ -425,7 +604,10 @@ export default {
}
},
/**-------表格的cell样式----------**/
cellStyle({row, column, rowIndex, columnIndex}) {
return ' text-align : center; padding: 0px';
},
/** 序号 */
rowOrderIndex({ row, rowIndex }) {
row.index = rowIndex + 1;
@ -435,49 +617,22 @@ export default {
},
handleSelectionChange() {
},
handleUpdate() {
},
/**----------------传递数据-------------**/
handleConfirmSelection(selectedItems) {
this.selectedMaterials = selectedItems;
this.dialogMaterialVisible = false;
console.log(this.selectedMaterials)
materialDialogConfirmSelection(selectedItems) {
this.orderList.push(...selectedItems);
},
/**------------dialog中请求物料列表-------------**/
queryMaterialList(queryParams) {
this.materialDialogData = [
{
uid: '1',
prodCategory: '产品1',
model: '型号A',
specification: '规格1',
voltLevel: '110V',
measureUnit: '个'
},
{
uid: '2',
prodCategory: '产品2',
model: '型号B',
specification: '规格2',
voltLevel: '220V',
measureUnit: '台'
},
{
uid: '3',
prodCategory: '产品3',
model: '型号C',
specification: '规格3',
voltLevel: '380V',
measureUnit: '件'
},
//
];
this.materialDialogTotal = 10
getMaterialList(queryParams).then(response => {
this.materialDialogData = response.rows;
this.materialDialogTotal = response.total;
this.loading = false;
});
},
/**-----------------------选择客户Dialog函数-------------------------**/
closeCustomDialog() {
@ -498,12 +653,34 @@ export default {
this.loading = false;
});
},
chooseCustom(row) {
this.addOrderParam.kunnr = row.kunnr;
this.addOrderParam.kna1 = row.name1;
this.customVisible = false;
},
/**-----------------------选择合同------------------**/
closeContractDialog() {
this.contractVisible = false;
},
queryContract() {
getContractList(this.contractDialogParams).then(response => {
this.contractDialogData = response.rows;
this.contractDialogTotal = response.total;
this.loading = true;
});
},
confirmContractSelection() {
},
openContractDialog() {
this.contractVisible = true;
}
},
};
</script>
<style>
.flex-container {
display: flex;
align-items: center;
@ -517,6 +694,13 @@ export default {
padding-top: 10px !important;
}
.materialTable .el-input__inner {
margin: 5px;
height: 25px;
/*font-family: Roboto, serif;*/
font-size: 12px;
line-height: 14px;
}
.flex-input {
flex-grow: 1;

View File

@ -0,0 +1,146 @@
<template>
<div class="app-container">
<!-- Section 1 -->
<div class="app-card">
<h2 class="app-title">报价</h2>
<el-row :gutter="10">
<el-col :span="8" class="app-icon-container">
<el-card shadow="always" class="app-icon-card" >
<div class="app-icon" @click="handleClick('quoteMobile')">
<img src="https://via.placeholder.com/50" alt="App1">
</div>
<div class="app-name">报价单</div>
</el-card>
</el-col>
<!-- <el-col :span="8" class="app-icon-container">-->
<!-- <el-card shadow="always" class="app-icon-card" @click="handleClick('App2')">-->
<!-- <div class="app-icon">-->
<!-- <img src="https://via.placeholder.com/50" alt="App2">-->
<!-- </div>-->
<!-- <div class="app-name">App2</div>-->
<!-- </el-card>-->
<!-- </el-col>-->
<!-- Add more icons as needed for Section 1 -->
</el-row>
</div>
<!-- Section 2 -->
<!-- <div class="app-card">-->
<!-- <h2 class="app-title">Section 2</h2>-->
<!-- <el-row :gutter="10">-->
<!-- <el-col :span="8" class="app-icon-container">-->
<!-- <el-card shadow="always" class="app-icon-card" @click="handleClick('App10')">-->
<!-- <div class="app-icon">-->
<!-- <img src="https://via.placeholder.com/50" alt="App10">-->
<!-- </div>-->
<!-- <div class="app-name">App10</div>-->
<!-- </el-card>-->
<!-- </el-col>-->
<!-- <el-col :span="8" class="app-icon-container">-->
<!-- <el-card shadow="always" class="app-icon-card" @click="handleClick('App11')">-->
<!-- <div class="app-icon">-->
<!-- <img src="https://via.placeholder.com/50" alt="App11">-->
<!-- </div>-->
<!-- <div class="app-name">App11</div>-->
<!-- </el-card>-->
<!-- </el-col>-->
<!-- &lt;!&ndash; Add more icons as needed for Section 2 &ndash;&gt;-->
<!-- </el-row>-->
<!-- </div>-->
<!-- &lt;!&ndash; Section 3 &ndash;&gt;-->
<!-- <div class="app-card">-->
<!-- <h2 class="app-title">Section 3</h2>-->
<!-- <el-row :gutter="10">-->
<!-- <el-col :span="8" class="app-icon-container">-->
<!-- <el-card shadow="always" class="app-icon-card" @click="handleClick('App19')">-->
<!-- <div class="app-icon">-->
<!-- <img src="https://via.placeholder.com/50" alt="App19">-->
<!-- </div>-->
<!-- <div class="app-name">App19</div>-->
<!-- </el-card>-->
<!-- </el-col>-->
<!-- <el-col :span="8" class="app-icon-container">-->
<!-- <el-card shadow="always" class="app-icon-card" @click="handleClick('App20')">-->
<!-- <div class="app-icon">-->
<!-- <img src="https://via.placeholder.com/50" alt="App20">-->
<!-- </div>-->
<!-- <div class="app-name">App20</div>-->
<!-- </el-card>-->
<!-- </el-col>-->
<!-- &lt;!&ndash; Add more icons as needed for Section 3 &ndash;&gt;-->
<!-- </el-row>-->
<!-- </div>-->
</div>
</template>
<script>
export default {
name: "index",
data() {
return {
};
},
created() {
console.log("hello world")
},
methods: {
handleClick(appName) {
console.log(appName);
this.$router.push('/' + appName + '/index');
//
}
},
}
</script>
<style>
.app-container {
padding: 10px;
}
.app-card {
background-color: #e0f7fa;
border-radius: 15px;
padding: 20px;
margin-bottom: 20px;
}
.app-title {
margin-bottom: 15px;
font-size: 18px;
color: #333;
text-align: center;
}
.app-icon-container {
display: flex;
justify-content: center;
align-items: center;
}
.app-icon-card {
width: 80px;
height: 100px;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
cursor: pointer;
border-radius: 10px;
background-color: white;
}
.app-icon img {
width: 50px;
height: 50px;
}
.app-name {
margin-top: 5px;
font-size: 12px;
color: #333;
text-align: center;
}
</style>

View File

@ -0,0 +1,96 @@
<template>
<div>
<div class="search-container">
<el-input
v-model="queryParams.quotProject"
placeholder="请输入项目名称"
class="search-input"
clearable
>
<el-button slot="append" icon="el-icon-search" @click="handleSearch">搜索</el-button>
<el-button slot="append" icon="el-icon-plus" @click="handleAdd">新增</el-button>
</el-input>
</div>
<div v-if="quoteList.length === 0">内容为空</div>
<div v-for="(quote, index) in quoteList" :key="index">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>{{quote.quotCode}}</span>
<el-button style="float: right; padding: 3px 0" type="text" @click="handleEdit(quote.quotCode)">编辑</el-button>
</div>
<div class="text item">
<div v-if="false">订单号Id:{{quote.quotId}}</div>
<div>客户:{{quote.quotCustomerName}}</div>
<div>项目名称:{{quote.quotProject}}</div>
<div>提交状态:{{quote.quotApprovalStatus === '0' ? '待提交' : (quote.quotApprovalStatus === '1' ? '协助中' :
(quote.quotApprovalStatus === '2' ? '已完成' : '已驳回'))}}</div>
<div>询价日期:{{quote.quotInquiryDate}}</div>
<div>报价日期:{{quote.quotQuotationDate}}</div>
<div>创建时间:{{quote.createTime}}</div>
</div>
</el-card>
</div>
</div>
</template>
<script>
import { getQuoteList} from "@/api/mobile/quoteMobile/quoteMobile";
export default {
name: "index",
data() {
return {
quoteList: [],
queryParams: {
pageNum: 1,
pageSize: 10,
quotCode: null,
quotCustomerName: null,
quotProject: null,
quotApprovalStatus: null,
},
};
},
created() {
this.queryQuoteList();
},
methods: {
queryQuoteList() {
getQuoteList(this.queryParams).then(response => {
this.quoteList = response.data
console.log(this.quoteList);
});
},
handleSearch() {
console.log(this.queryParams)
getQuoteList(this.queryParams).then(response => {
this.quoteList = response.data
console.log(this.quoteList);
});
},
handleAdd() {
this.$router.push('/quoteMobile/add');
},
handleEdit(quotCode) {
console.log(quotCode)
}
},
}
</script>
<style>
.search-container {
display: flex;
justify-content: center;
margin-bottom: 10px;
margin-top: 10px;
}
.search-input {
width: 100%;
max-width: 600px;
border-radius: 25px;
}
</style>

View File

@ -0,0 +1,374 @@
<template>
<div class="container">
<el-form ref="elForm" :model="formData" :rules="rules" size="mini" label-width="100px">
<el-form-item v-if="false" label="报价单Id" prop="quotId">
<el-input v-model="formData.quotId" placeholder="报价单Id" readonly clearable
></el-input>
</el-form-item>
<el-form-item label="报价单单号" prop="quotCode">
<el-input v-model="formData.quotCode" placeholder="报价单单号(自动生成)" readonly clearable
></el-input>
</el-form-item>
<el-form-item label="客户" prop="quotCustomerName">
<el-input readonly v-model="formData.quotCustomerName" placeholder="请输入客户" >
<template slot="append">
<span @click="openCustomer">选择</span>
</template>
</el-input>
</el-form-item>
<el-form-item label="地址" prop="quotAddress">
<el-input v-model="formData.quotAddress" placeholder="请输入地址" clearable>
</el-input>
</el-form-item>
<el-form-item label="审核人" prop="quotCheckUserNickname">
<el-input readonly v-model="formData.quotCheckUserNickname" placeholder="审核人" clearable
></el-input>
</el-form-item>
<el-form-item label="提交状态" prop="quotApprovalStatus">
<el-input readonly v-model="formData.quotApprovalStatus" placeholder="保存后显示" clearable
></el-input>
</el-form-item>
<el-form-item label="项目名称" prop="quotProject">
<el-input v-model="formData.quotProject" placeholder="请输入项目名称" clearable >
</el-input>
</el-form-item>
<el-form-item label="报价要求" prop="quotQuotationRequire">
<el-input v-model="formData.quotQuotationRequire" placeholder="请输入报价要求" clearable
></el-input>
</el-form-item>
<el-form-item label="联系电话" prop="quotPhone">
<el-input v-model="formData.quotPhone" placeholder="请输入联系电话" clearable >
</el-input>
</el-form-item>
<el-divider content-position="left" class="customer_divider_text">询价附件(先保存)</el-divider>
<div v-hasPermi="['quot:quot:quotXjFile']">
<el-upload class="upload-demo"
ref="upload"
name="quotFile"
:action="uploadUrl"
:headers="headers"
:data="{ relation_id: this.formData.quotId,file_type: 'quotXjFile' }"
:on-success="handleAvatarSuccess"
:show-file-list="false"
:limit="1"
v-if="this.form.quotApprovalStatus == '0'">
<el-button size="small" type="primary" @click="uploadFile('quotXjFile')">上传文件</el-button>
</el-upload>
</div>
<el-table class="down" :data="quotXjFileList" border stripe style="width: 100%;margin-top: 10px;" height="200px">
<el-table-column prop="fileName" label="文件名称" ></el-table-column>
<el-table-column width="150px" label="操作">
<template slot-scope="scope">
<el-button :key="Math.random()" size="small" type="text">
<a @click="downloadFile(scope.row.fileUrl)">下载</a>
</el-button>
<el-button :key="Math.random()" size="small" type="text" v-if="form.quotApprovalStatus == '0'">
<a @click="deleteFile(scope.row.fileId,'quotXjFile')">删除</a>
</el-button>
</template>
</el-table-column>
</el-table>
<el-divider content-position="left" class="customer_divider_text">技术规范要求(询价附件)</el-divider>
<div v-hasPermi="['quot:quot:quotXjFile']">
<el-upload class="upload-demo"
ref="upload"
name="quotFile"
:action="uploadUrl"
:headers="headers"
:data="{ relation_id: this.formData.quotId,file_type: 'quotXjFile' }"
:on-success="handleAvatarSuccess"
:show-file-list="false"
:limit="1"
v-if="this.form.quotApprovalStatus == '0'">
<el-button size="small" type="primary" @click="uploadFile('quotXjFile')">上传文件</el-button>
</el-upload>
</div>
<el-table class="down" :data="quotXjFileList" border stripe style="width: 100%;margin-top: 10px;" height="200px">
<el-table-column prop="fileName" label="文件名称" ></el-table-column>
<el-table-column width="150px" label="操作">
<template slot-scope="scope">
<el-button :key="Math.random()" size="small" type="text">
<a @click="downloadFile(scope.row.fileUrl)">下载</a>
</el-button>
<el-button :key="Math.random()" size="small" type="text" v-if="form.quotApprovalStatus == '0'">
<a @click="deleteFile(scope.row.fileId,'quotXjFile')">删除</a>
</el-button>
</template>
</el-table-column>
</el-table>
<el-divider content-position="left" class="customer_divider_text">反馈附件</el-divider>
<div v-hasPermi="['quot:quot:quotXjFile']">
<el-upload class="upload-demo"
ref="upload"
name="quotFile"
:action="uploadUrl"
:headers="headers"
:data="{ relation_id: this.formData.quotId,file_type: 'quotXjFile' }"
:on-success="handleAvatarSuccess"
:show-file-list="false"
:limit="1"
v-if="this.form.quotApprovalStatus == '0'">
<el-button size="small" type="primary" @click="uploadFile('quotXjFile')">上传文件</el-button>
</el-upload>
</div>
<el-table class="down" :data="quotXjFileList" border stripe style="width: 100%;margin-top: 10px;" height="200px">
<el-table-column prop="fileName" label="文件名称" ></el-table-column>
<el-table-column width="150px" label="操作">
<template slot-scope="scope">
<el-button :key="Math.random()" size="small" type="text">
<a @click="downloadFile(scope.row.fileUrl)">下载</a>
</el-button>
<el-button :key="Math.random()" size="small" type="text" v-if="form.quotApprovalStatus == '0'">
<a @click="deleteFile(scope.row.fileId,'quotXjFile')">删除</a>
</el-button>
</template>
</el-table-column>
</el-table>
<el-form-item style="margin-top: 15px">
<el-button @click="saveForm">保存</el-button>
<el-button style="margin: 0px 15px 0px 20px" type="primary" @click="submitForm">提交</el-button>
<el-button @click="resetForm">重置</el-button>
</el-form-item>
</el-form>
<CustomerSelect :width="100 + '%'" ref="customerSelect" :open="customerOpen" @submit="submitCustomer" @cancel="customerOpen=false"></CustomerSelect>
</div>
</template>
<script>
import CustomerSelect from "@/views/components/Tools/Mobile/CustomerSelect/index.vue";
import { NumberAdd } from '@/utils/number';//
import { changQuotPrintStatus,listQuot, getQuot, getReturnUpdateQuot, delQuot, addQuot, updateQuot, quotFileList, quotFileDelete, commitQuot, commitJsQuot, commitHjQuot, commitJswQuot, commitOAQuot, feedbackQuot, madeQuot, rejectQuot } from "@/api/quot/quot";
import { getToken } from "@/utils/auth";
import { checkPermi,checkRole } from '@/utils/permission';//
export default {
components: {
//
'CustomerSelect': CustomerSelect,
},
props: [],
data() {
return {
//
form: {},
// -
quotXjFileList: [],
// -
quotFkFileList: [],
// -
quotJsgfFileList: [],
//-
uploadUrl: process.env.VUE_APP_BASE_API + "/quot/quot/quotFile",
//-
headers: {Authorization: "Bearer " + getToken()},
//
customerOpen:false,
formData: {
quotId: null,
quotCode: '',
quotCustomerName: '',
quotAddress: '',
quotCheckUserNickname: '',
quotProject: '',
quotQuotationRequire: '',
quotPhone: '',
quotQuotationFrom: '',
quotPrintUserName: '',
field115: null,
field116: null,
},
rules: {
quotAddress: [{
required: true,
message: '请输入地址',
trigger: 'blur'
}],
quotProject: [{
required: true,
message: '请输入项目名称',
trigger: 'blur'
}],
quotQuotationRequire: [{
required: true,
message: '请输入报价要求',
trigger: 'blur'
}],
quotPhone: [{
required: true,
message: '请输入联系电话',
trigger: 'blur'
}],
quotQuotationFrom: [{
required: true,
message: '请输入报价来源',
trigger: 'blur'
}],
},
field115Action: 'https://jsonplaceholder.typicode.com/posts/',
field115fileList: [],
field116Action: 'https://jsonplaceholder.typicode.com/posts/',
field116fileList: [],
}
},
computed: {},
watch: {},
created() {},
mounted() {},
methods: {
//
downloadFile(fileUrl){
window.open(fileUrl, "_blank");
},
//
deleteFile(fileId,activeName){
//let activeName = this.activeName;
quotFileDelete(fileId).then(response => {
if(activeName=='quotXjFile'){
this.getQuotXjFileList();
}else if(activeName=='quotJsInfo'){
this.getQuotJsgfFileList();
}else if(activeName=='quotFkFile'){
this.getQuotFkFileList();
}
});
},
//
uploadFile(activeName){
this.activeName = activeName
},
//
handleAvatarSuccess(res) {
let activeName = this.activeName;
//
if (res.code == 200) {
this.$modal.msgSuccess(res.msg);
if(activeName=='quotXjFile'){
this.getQuotXjFileList();
}else if(activeName=='quotJsInfo'){
this.getQuotJsgfFileList();
}else if(activeName=='quotFkFile'){
this.getQuotFkFileList();
}
} else {
this.$modal.msgError(res.msg);
}
this.$refs.upload.clearFiles(); //****
},
submitForm() {
this.$refs['elForm'].validate(valid => {
if (!valid) return
// TODO
})
},
resetForm() {
this.$refs['elForm'].resetFields()
},
field115BeforeUpload(file) {
let isRightSize = file.size / 1024 / 1024 < 2
if (!isRightSize) {
this.$message.error('文件大小超过 2MB')
}
return isRightSize
},
field116BeforeUpload(file) {
let isRightSize = file.size / 1024 / 1024 < 100
if (!isRightSize) {
this.$message.error('文件大小超过 100MB')
}
return isRightSize
},
//
openCustomer(){
this.customerOpen=true;
},
//
submitCustomer(customer){
this.formData.quotCustomerName = customer.label
this.customerOpen=false;
},
/** 修改按钮操作 */
handleUpdate(row) {
const quotId = row.quotId || this.ids
getQuot(quotId).then(response => {
this.setInfo(response);
});
},
/** 修改按钮操作-详细信息设置 */
setInfo(response){
console.log(response)
this.formData = response.data;
// this.$set(this.form, "quotJsxzGroup", (this.form.quotJsxzGroupValues==''||this.form.quotJsxzGroupValues==null)?[]:this.form.quotJsxzGroupValues.split(','));
// this.quotMaterialList = response.data.quotMaterialList;
// this.open = true;
// this.activeName = "quotInfo";
//
// const quotJsxzGroup = this.form.quotJsxzGroupValues;
// if(quotJsxzGroup){
// if(quotJsxzGroup.indexOf("TL")!==-1){
// this.showTl = true;
// this.getQuotJsqrFileList('quotJsqrTlFkFile');
// }
// if(quotJsxzGroup.indexOf("DY")!==-1){
// this.showDy = true;
// this.getQuotJsqrFileList('quotJsqrDyFkFile');
// }
// if(quotJsxzGroup.indexOf("ZY")!==-1){
// this.showZy = true;
// this.getQuotJsqrFileList('quotJsqrZyFkFile');
// }
// if(quotJsxzGroup.indexOf("QT")!==-1){
// this.showQt = true;
// this.getQuotJsqrFileList('quotJsqrQtFkFile');
// }
// }
// this.getQuotXjFileList();
// this.getQuotJsgfFileList();
// this.getQuotHjFileList();
// this.getQuotFkFileList();
},
/** 保存按钮 */
saveForm() {
this.$refs["elForm"].validate(valid => {
if (valid) {
if (this.formData.quotId != null) {
updateQuot(this.formData).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
});
} else {
addQuot(this.formData).then(response => {
this.$modal.msgSuccess("新增成功");
const row = {'quotId':response.data.quotId}
this.handleUpdate(row);
}) ;
}
}
});
},
},
}
</script>
<style>
.small-upload .el-upload {
width: 100px;
height: 100px;
}
.el-upload__tip {
line-height: 1.2;
}
.container {
margin: 20px;
}
</style>