Browse Source

[fix]采购模块:供应商资料页面优化

dev
zhangsiqi 10 months ago
parent
commit
eb3888958a
  1. 6
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSupplierController.java
  2. 52
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSupplier.java
  3. 2
      ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSupplierService.java
  4. 8
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSupplierServiceImpl.java
  5. 39
      ruoyi-admin/src/main/resources/mapper/system/SysSupplierMapper.xml
  6. 105
      ruoyi-admin/src/main/resources/templates/system/supplier/add.html
  7. 158
      ruoyi-admin/src/main/resources/templates/system/supplier/edit.html
  8. 342
      ruoyi-admin/src/main/resources/templates/system/supplier/supplier.html

6
ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSupplierController.java

@ -6,6 +6,7 @@ import com.alibaba.excel.util.MapUtils;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.ck.utils.Result;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
@ -192,4 +193,9 @@ public class SysSupplierController extends BaseController
excelWriter.fill(map, writeSheet);
}
}
@PostMapping("/getId")
@ResponseBody
public Result getId() throws Exception {
return Result.getSuccessResult(sysSupplierService.getId());
}
}

52
ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSupplier.java

@ -17,7 +17,16 @@ public class SysSupplier extends BaseEntity
/** 供应商id */
private Long supplierId;
/*审核状态*/
private String auditStatus;
/*使用状态*/
private String useStatus;
/*供应商类型*/
private String supplierType;
/*供应商资质*/
private String supplierQualification;
/*采购员*/
private String purchaseBuyer;
/** 供应商编号 */
@Excel(name = "供应商编号")
private String supplierCode;
@ -146,6 +155,47 @@ public class SysSupplier extends BaseEntity
private String updateInfoTime;
public String getAuditStatus() {
return auditStatus;
}
public void setAuditStatus(String auditStatus) {
this.auditStatus = auditStatus;
}
public String getUseStatus() {
return useStatus;
}
public void setUseStatus(String useStatus) {
this.useStatus = useStatus;
}
public String getSupplierType() {
return supplierType;
}
public void setSupplierType(String supplierType) {
this.supplierType = supplierType;
}
public String getSupplierQualification() {
return supplierQualification;
}
public void setSupplierQualification(String supplierQualification) {
this.supplierQualification = supplierQualification;
}
public String getPurchaseBuyer() {
return purchaseBuyer;
}
public void setPurchaseBuyer(String purchaseBuyer) {
this.purchaseBuyer = purchaseBuyer;
}
public String getFirstAddTime() {
return firstAddTime;
}

2
ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSupplierService.java

@ -66,4 +66,6 @@ public interface ISysSupplierService
* 新增物料信息的时候查关联应商信息
*/
public List<SysSupplier> selectSysSupperWithMaterial();
Object getId();
}

8
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSupplierServiceImpl.java

@ -1,5 +1,6 @@
package com.ruoyi.system.service.impl;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.system.domain.SysSupplier;
import com.ruoyi.system.mapper.SysSupplierMapper;
@ -21,6 +22,8 @@ public class SysSupplierServiceImpl implements ISysSupplierService
@Autowired
private SysSupplierMapper sysSupplierMapper;
@Autowired
private RedisCache redisCache;
/**
* 查询供应商资料
*
@ -106,4 +109,9 @@ public class SysSupplierServiceImpl implements ISysSupplierService
List<SysSupplier> sysSuppliers = sysSupplierMapper.selectSysSupplierWithMaterial();
return sysSuppliers;
}
@Override
public Object getId() {
return redisCache.generateBillNo("GYS");
}
}

39
ruoyi-admin/src/main/resources/mapper/system/SysSupplierMapper.xml

@ -3,9 +3,13 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.SysSupplierMapper">
<resultMap type="SysSupplier" id="SysSupplierResult">
<result property="supplierId" column="supplier_id" />
<result property="useStatus" column="use_status" />
<result property="auditStatus" column="audit_status" />
<result property="supplierQualification" column="supplier_qualification" />
<result property="purchaseBuyer" column="purchase_buyer" />
<result property="supplierType" column="supplier_type" />
<result property="supplierCode" column="supplier_code" />
<result property="supplierName" column="supplier_name" />
<result property="exportSales" column="export_sales" />
@ -42,7 +46,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectSysSupplierVo">
select supplier_id, supplier_code, supplier_name, export_sales, enterprise_name, enterprise_nature, customer_address, manufacturer_category, postal_code, business_scope, customer_country, established_time, legal_representative, customer_contact, contact_number, customer_fax, customer_email, website, payment_terms, supplier_days, actual_payment_days, settlement_bank, exchange_settlement_account, deposit_bank, bank_account, rmb_registered_capital, Industry_code, merchandiser, merchandiser_telephone, financial_contact, confirm_tax, tax_rate, first_add_time, update_info_time from sys_supplier
select supplier_id, supplier_code, supplier_name, export_sales,
supplier_type, use_status, audit_status, supplier_qualification, purchase_buyer,
enterprise_name, enterprise_nature, customer_address, manufacturer_category,
postal_code, business_scope, customer_country, established_time,
legal_representative, customer_contact, contact_number, customer_fax,
customer_email, website, payment_terms, supplier_days, actual_payment_days,
settlement_bank, exchange_settlement_account, deposit_bank, bank_account,
rmb_registered_capital, Industry_code, merchandiser, merchandiser_telephone,
financial_contact, confirm_tax, tax_rate, first_add_time, update_info_time
from sys_supplier
</sql>
<select id="selectSysSupplierList" parameterType="SysSupplier" resultMap="SysSupplierResult">
@ -50,6 +63,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where>
<if test="supplierCode != null and supplierCode != ''"> and supplier_code like concat('%', #{supplierCode}, '%')</if>
<if test="supplierName != null and supplierName != ''"> and supplier_name like concat('%', #{supplierName}, '%')</if>
<if test="supplierType != null and supplierType != ''"> and supplier_type = #{supplierType}</if>
<if test="useStatus != null and useStatus != ''"> and use_status = #{useStatus}</if>
<if test="auditStatus != null and auditStatus != ''"> and audit_status = #{auditStatus}</if>
<if test="purchaseBuyer != null and purchaseBuyer != ''"> and purchase_buyer = #{purchaseBuyer}</if>
<if test="exportSales != null and exportSales != ''"> and export_sales = #{exportSales}</if>
<if test="enterpriseName != null and enterpriseName != ''"> and enterprise_name like concat('%', #{enterpriseName}, '%')</if>
<if test="customerContact != null and customerContact != ''"> and customer_contact like concat('%', #{customerContact}, '%')</if>
@ -72,6 +89,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="insertSysSupplier" parameterType="SysSupplier" useGeneratedKeys="true" keyProperty="supplierId">
insert into sys_supplier
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="supplierType !=null and suoolierType != ''">supplier_type,</if>
<if test="purchaseBuyer != null and purchaseBuyer != ''">purchase_buyer,</if>
<if test="supplierQualification != null and supplierQualification != ''">supplier_qualification,</if>
<if test="supplierCode != null and supplierCode != ''">supplier_code,</if>
<if test="supplierName != null and supplierName != ''">supplier_name,</if>
<if test="exportSales != null and exportSales != ''">export_sales,</if>
@ -103,9 +123,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="financialContact != null">financial_contact,</if>
<if test="confirmTax != null">confirm_tax,</if>
<if test="taxRate != null">tax_rate,</if>
first_add_time,
audit_status,use_status,first_add_time,
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="supplierType !=null and suoolierType != ''">#{supplierType},</if>
<if test="useStatus != null and useStatus != ''">#{useStatus},</if>
<if test="auditStatus != null and auditStatus != ''">#{auditStatus},</if>
<if test="purchaseBuyer != null and purchaseBuyer != ''">#{purchaseBuyer},</if>
<if test="supplierQualification != null and supplierQualification != ''">#{supplierQualification},</if>
<if test="supplierCode != null and supplierCode != ''">#{supplierCode},</if>
<if test="supplierName != null and supplierName != ''">#{supplierName},</if>
<if test="exportSales != null and exportSales != ''">#{exportSales},</if>
@ -137,13 +163,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="financialContact != null">#{financialContact},</if>
<if test="confirmTax != null">#{confirmTax},</if>
<if test="taxRate != null">#{taxRate},</if>
now(),
'1','1',CONCAT_WS(',',NOW(),update_info_time),
</trim>
</insert>
<update id="updateSysSupplier" parameterType="SysSupplier">
update sys_supplier
<trim prefix="SET" suffixOverrides=",">
<if test="supplierType !=null and suoolierType != ''">supplier_type = #{supplierType},</if>
<if test="useStatus != null and useStatus != ''">use_status = #{useStatus},</if>
<if test="auditStatus != null and auditStatus != ''">audit_status = #{auditStatus},</if>
<if test="purchaseBuyer != null and purchaseBuyer != ''">purchase_buyer = #{purchaseBuyer},</if>
<if test="supplierQualification != null and supplierQualification != ''">supplier_qualification = #{supplierQualification},</if>
<if test="supplierCode != null and supplierCode != ''">supplier_code = #{supplierCode},</if>
<if test="supplierName != null and supplierName != ''">supplier_name = #{supplierName},</if>
<if test="exportSales != null and exportSales != ''">export_sales = #{exportSales},</if>

105
ruoyi-admin/src/main/resources/templates/system/supplier/add.html

@ -2,6 +2,8 @@
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增供应商资料')" />
<th:block th:include="include :: select2-css" />
<link th:href="@{/ajax/libs/element-ui/element-ui.css}" rel="stylesheet"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
@ -32,6 +34,16 @@
<input name="enterpriseName" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">供应商类型:</label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_supplier_type')}">
<input type="radio" th:id="${'supplierType_' + dict.dictCode}"
name="supplierType" th:value="${dict.dictValue}" th:checked="${dict.default}" required>
<label th:for="${'confirmTax_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">企业性质:</label>
<div class="col-sm-8">
@ -72,10 +84,13 @@
</select>
</div>
</div>
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label">成立日期:</label>
<div class="col-sm-8">
<input name="establishedTime" class="form-control" type="text">
<div class="input-group date">
<input name="establishedTime" class="form-control" placeholder="yyyy-mm-dd" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="form-group">
@ -118,9 +133,6 @@
<label class="col-sm-3 control-label">付款条件:</label>
<div class="col-sm-8">
<input name="paymentTerms" class="form-control" type="text">
<!-- <select name="paymentTerms" class="form-control m-b" th:with="type=${@dict.getType('sys_paymentTerms')}">-->
<!-- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>-->
<!-- </select>-->
</div>
</div>
<div class="form-group">
@ -184,9 +196,9 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">财务联系人</label>
<label class="col-sm-3 control-label">采购员</label>
<div class="col-sm-8">
<input name="financialContact" class="form-control" type="text">
<select id="purchaseBuyer_add" name="purchaseBuyer" class="form-control" ></select>
</div>
</div>
<div class="form-group">
@ -201,23 +213,98 @@
<div class="form-group">
<label class="col-sm-3 control-label">税率:</label>
<div class="col-sm-8">
<input name="taxRate" class="form-control" type="text">
<input name="taxRate" class="form-control" type="text" placeholder="%">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">证件:</label>
<div class="col-sm-10">
<el-upload
:action="fileUploadUrl"
:on-success="uploadSuccess"
:on-remove="uploadRemove"
:file-list="fileList"
list-type="picture"
accept=".jpg,.png"
multiple>
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件,第一张图片为主图</div>
</el-upload>
</div>
<input id="fileIdStr" type="text" name="fileIdStr" hidden>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">供应商:</label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_supplier_qualification')}">
<input required type="radio" th:id="${'supplierQualification_' + dict.dictCode}"
name="supplierQualification" th:value="${dict.dictValue}" th:checked="${dict.default}">
<label th:for="${'confirmTax_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js"/>
<th:block th:include="include :: bootstrap-table-editable-js"/>
<th:block th:include="include :: datetimepicker-js"/>
<th:block th:include="include :: bootstrap-fileinput-js"/>
<script th:src="@{/ajax/libs/vue/vue.js}"></script>
<script th:src="@{/ajax/libs/element-ui/element-ui.js}"></script>
<script th:inline="javascript">
var prefix = ctx + "system/supplier"
var prefix = ctx + "system/supplier";
var userName = [[${@permission.getPrincipalProperty('userName')}]];
$("#form-supplier-add").validate({
focusCleanup: true
});
$(function () {
$.ajax({
url: prefix + "/getId",
type: "post",
dateType: "json",
success: function (resp) {
if (resp.code === 0) {
$("input[name='supplierCode']").val(resp.data);
} else {
$.modal.msgError("失败啦");
}
},
error: function () {
$.modal.msgError("后台出错啦!");
}
});
$.ajax({
url: ctx + 'system/user/list',
type: 'post',
data:{
userName: '业务'
},
success: function (res) {
if (res.rows.length > 0) {
var usertData = res.rows;
for (let i in usertData) {
$("#purchaseBuyer_add").append(
"<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>");
}
$("purchaseBuyer_add").val(userName).trigger("change");
} else {
$.modal.msgError(res.msg);
}
}
});
})
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-supplier-add').serialize());
}
}
$("input[name='establishedTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
</script>
</body>
</html>

158
ruoyi-admin/src/main/resources/templates/system/supplier/edit.html

@ -6,215 +6,277 @@
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-supplier-edit" th:object="${sysSupplier}">
<input name="supplierId" th:field="*{supplierId}" type="hidden">
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label is-required">供应商编号:</label>
<div class="col-sm-8">
<input name="supplierCode" th:field="*{supplierCode}" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label is-required">供应商名称:</label>
<div class="col-sm-8">
<input name="supplierName" th:field="*{supplierName}" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label is-required">内外销:</label>
<div class="col-sm-8">
<select name="exportSales" class="form-control m-b" th:with="type=${@dict.getType('sys_export_sales')}" required>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{exportSales}"></option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label">企业名称:</label>
<div class="col-sm-8">
<input name="enterpriseName" th:field="*{enterpriseName}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label is-required">供应商类型:</label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_supplier_type')}">
<input type="radio" th:id="${'supplierType_' + dict.dictCode}"
name="supplierType" th:value="${dict.dictValue}" th:checked="${dict.default}" required>
<label th:for="${'supplierType_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">企业性质:</label>
<div class="col-sm-8">
<select name="enterpriseNature" class="form-control m-b" th:with="type=${@dict.getType('sys_enterprise_nature')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{enterpriseNature}"></option>
<select name="enterpriseNature" th:field="*{enterpriseNature}" class="form-control m-b" th:with="type=${@dict.getType('sys_enterprise_nature')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label is-required">企业地址:</label>
<div class="col-sm-8">
<input name="customerAddress" th:field="*{customerAddress}" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label">厂商类别:</label>
<div class="col-sm-8">
<input name="manufacturerCategory" th:field="*{manufacturerCategory}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label">邮编:</label>
<div class="col-sm-8">
<input name="postalCode" th:field="*{postalCode}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label">经营范围:</label>
<div class="col-sm-8">
<input name="businessScope" th:field="*{businessScope}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label">国家:</label>
<div class="col-sm-8">
<select name="customerCountry" class="form-control m-b" th:with="type=${@dict.getType('sys_country')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{customerCountry}"></option>
<select name="customerCountry" th:field="*{customerCountry}" class="form-control m-b" th:with="type=${@dict.getType('sys_country')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label">成立日期:</label>
<div class="col-sm-8">
<input name="establishedTime" th:field="*{establishedTime}" class="form-control" type="text">
<div class="input-group date">
<input name="establishedTime" th:field="*{establishedTime}" class="form-control" placeholder="yyyy-mm-dd" type="text">
<span class="input-group-addon" disabled><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label">法人代表:</label>
<div class="col-sm-8">
<input name="legalRepresentative" th:field="*{legalRepresentative}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label is-required">主联系人:</label>
<div class="col-sm-8">
<input name="customerContact" th:field="*{customerContact}" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label is-required">联系电话:</label>
<div class="col-sm-8">
<input name="contactNumber" th:field="*{contactNumber}" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label">传真:</label>
<div class="col-sm-8">
<input name="customerFax" th:field="*{customerFax}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label">Email:</label>
<div class="col-sm-8">
<input name="customerEmail" th:field="*{customerEmail}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label">网站:</label>
<div class="col-sm-8">
<input name="website" th:field="*{website}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label">付款条件:</label>
<div class="col-sm-8">
<input name="paymentTerms" class="form-control" type="text">
<!-- <select name="paymentTerms" class="form-control m-b" th:with="type=${@dict.getType('sys_paymentTerms')}">-->
<!-- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{paymentTerms}"></option>-->
<!-- </select>-->
<input name="paymentTerms" th:field="*{paymentTerms}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label">天数:</label>
<div class="col-sm-8">
<input name="supplierDays" th:field="*{supplierDays}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label">实际付款天数:</label>
<div class="col-sm-8">
<input name="actualPaymentDays" th:field="*{actualPaymentDays}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label">结汇银行:</label>
<div class="col-sm-8">
<input name="settlementBank" th:field="*{settlementBank}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label">结汇账号:</label>
<div class="col-sm-8">
<input name="exchangeSettlementAccount" th:field="*{exchangeSettlementAccount}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label">开户银行:</label>
<div class="col-sm-8">
<input name="depositBank" th:field="*{depositBank}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label">开户银行账号:</label>
<div class="col-sm-8">
<input name="bankAccount" th:field="*{bankAccount}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label">RMB注册资金:</label>
<div class="col-sm-8">
<input name="rmbRegisteredCapital" th:field="*{rmbRegisteredCapital}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label">行业代码:</label>
<div class="col-sm-8">
<input name="industryCode" th:field="*{industryCode}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label">跟单员:</label>
<div class="col-sm-8">
<input name="merchandiser" th:field="*{merchandiser}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label">跟单电话:</label>
<div class="col-sm-8">
<input name="merchandiserTelephone" th:field="*{merchandiserTelephone}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">财务联系人</label>
<div class="form-group">
<label class="col-sm-3 control-label">采购员</label>
<div class="col-sm-8">
<input name="financialContact" th:field="*{financialContact}" class="form-control" type="text">
<select id="purchaseBuyer_add" th:field="${purchaseBuyer}" name="purchaseBuyer" class="form-control" ></select>
</div>
</div>
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label">是否含税:</label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_confirm_tax')}">
<input type="radio" th:id="${'confirmTax_' + dict.dictCode}" name="confirmTax" th:value="${dict.dictValue}" th:field="*{confirmTax}">
<input type="radio" th:id="${'confirmTax_' + dict.dictCode}" name="confirmTax" th:value="${dict.dictValue}" th:checked="${dict.default}">
<label th:for="${'confirmTax_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label">税率:</label>
<div class="col-sm-8">
<input name="taxRate" th:field="*{taxRate}" class="form-control" type="text">
<input name="taxRate" th:field="*{taxRate}" class="form-control" type="text" placeholder="%">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">证件:</label>
<div class="col-sm-10">
<el-upload
:action="fileUploadUrl"
:on-success="uploadSuccess"
:on-remove="uploadRemove"
:file-list="fileList"
list-type="picture"
accept=".jpg,.png"
multiple>
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件,第一张图片为主图</div>
</el-upload>
</div>
<input id="fileIdStr" type="text" name="fileIdStr" hidden>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">供应商:</label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_supplier_qualification')}">
<input required type="radio" th:id="${'supplierQualification_' + dict.dictCode}"
name="supplierQualification" th:value="${dict.dictValue}" th:checked="${dict.default}">
<label th:for="${'confirmTax_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js"/>
<th:block th:include="include :: bootstrap-table-editable-js"/>
<th:block th:include="include :: datetimepicker-js"/>
<th:block th:include="include :: bootstrap-fileinput-js"/>
<script th:src="@{/ajax/libs/vue/vue.js}"></script>
<script th:src="@{/ajax/libs/element-ui/element-ui.js}"></script>
<script th:inline="javascript">
var prefix = ctx + "system/supplier";
var sysSupplier = [[${supplier}]];
$("#form-supplier-edit").validate({
focusCleanup: true
});
$(function(){
$.ajax({
url: ctx + 'system/user/list',
type: 'post',
success: function (res) {
if (res.rows.length > 0) {
var usertData = res.rows;
for (let i in usertData) {
$("#form-supplier-edit select[name='purchaseBuyer']").append(
"<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>");
}
$("#form-supplier-edit select[name='purchaseBuyer']").val(sysSupplier.purchaseBuyer).trigger("change");
} else {
$.modal.msgError(res.msg);
}
}
});
$("input[name='confirmFax']").val(sysSupplier.confirmFax);
$("input[name='supplierType']").val(sysSupplier.supplierType);
$("input[name='supplierQualification']").val(sysSupplier.supplierQualification);
})
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-supplier-edit').serialize());

342
ruoyi-admin/src/main/resources/templates/system/supplier/supplier.html

@ -12,7 +12,7 @@
<div class="select-list">
<ul>
<li>
<label>供应商编号</label>
<label>供应商ID</label>
<input type="text" name="supplierCode"/>
</li>
<li>
@ -20,23 +20,29 @@
<input type="text" name="supplierName"/>
</li>
<li>
<label>内外销:</label>
<select name="exportSales" th:with="type=${@dict.getType('sys_export_sales')}">
<label>审核状态:</label>
<select name="auditStatus" th:with="type=${@dict.getType('auditStatus')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<label>供应商类型:</label>
<select name="supplierType" th:with="type=${@dict.getType('supplier_status')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<label>企业名称:</label>
<input type="text" name="enterpriseName"/>
</li>
<li>
<label>主联系人:</label>
<input type="text" name="customerContact"/>
<label>使用状态:</label>
<select name="useStatus" th:with="type=${@dict.getType('useStatus')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<label>跟单员:</label>
<input type="text" name="merchandiser"/>
<label>采购员:</label>
<select name="purchaseBuyer" ></select>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
@ -51,18 +57,6 @@
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:supplier:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:supplier:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:supplier:remove">
<i class="fa fa-remove"></i> 删除
</a>
<!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:supplier:export">-->
<!-- <i class="fa fa-download"></i> 导出-->
<!-- </a>-->
<!-- <a class="btn btn-warning single disabled" onclick="exportSupplierInfo()" shiro:hasPermission="system:supplier:export">-->
<!-- <i class="fa fa-download"></i> 导出-->
<!-- </a>-->
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" style="white-space:nowrap"></table>
@ -75,9 +69,13 @@
var removeFlag = [[${@permission.hasPermi('system:supplier:remove')}]];
var exportSalesDatas = [[${@dict.getType('sys_export_sales')}]];
var enterpriseNatureDatas = [[${@dict.getType('sys_enterprise_nature')}]];
var supplierqualificationDatas = [[${@dict.getType('sys_supplier_qualification')}]];
var supplierTypeDatas = [[${@dict.getType('sys_supplier_type')}]];
var customerCountryDatas = [[${@dict.getType('sys_country')}]];
var paymentTermsDatas = [[${@dict.getType('sys_paymentTerms')}]];
var confirmTaxDatas = [[${@dict.getType('sys_confirm_tax')}]];
var auditStatusDatas = [[${@dict.getType('auditStatus')}]];
var useStatusDatas = [[${@dict.getType('useStatus')}]];
var prefix = ctx + "system/supplier";
$(function() {
@ -90,195 +88,129 @@
pageList: [10, 25, "all"],
clickToSelect: true,
modalName: "供应商资料",
columns: [{
checkbox: true
},
{
field: 'supplierId',
title: '供应商id',
visible: false
},
{
field: 'supplierCode',
title: '供应商编号'
},
{
field: 'supplierName',
title: '供应商名称'
},
{
field: 'exportSales',
title: '内外销',
formatter: function(value, row, index) {
return $.table.selectDictLabel(exportSalesDatas, value);
}
},
{
field: 'enterpriseName',
title: '企业名称'
},
{
field: 'enterpriseNature',
title: '企业性质',
formatter: function(value, row, index) {
return $.table.selectDictLabel(enterpriseNatureDatas, value);
}
},
{
field: 'customerAddress',
title: '企业地址'
},
{
field: 'manufacturerCategory',
title: '厂商类别'
},
{
field: 'postalCode',
title: '邮编'
},
{
field: 'businessScope',
title: '经营范围'
},
{
field: 'customerCountry',
title: '国家',
formatter: function(value, row, index) {
return $.table.selectDictLabel(customerCountryDatas, value);
}
},
{
field: 'establishedTime',
title: '成立日期'
},
{
field: 'legalRepresentative',
title: '法人代表'
},
{
field: 'customerContact',
title: '主联系人'
},
{
field: 'contactNumber',
title: '联系电话'
},
{
field: 'customerFax',
title: '传真'
},
{
field: 'customerEmail',
title: 'Email'
},
{
field: 'website',
title: '网站'
},
{
field: 'paymentTerms',
title: '付款条件',
formatter: function(value, row, index) {
return $.table.selectDictLabel(paymentTermsDatas, value);
}
},
{
field: 'supplierDays',
title: '天数'
},
{
field: 'actualPaymentDays',
title: '实际付款天数'
},
{
field: 'settlementBank',
title: '结汇银行',
visible: false
},
{
field: 'exchangeSettlementAccount',
title: '结汇账号',
visible: false
},
{
field: 'depositBank',
title: '开户银行'
},
{
field: 'bankAccount',
title: '开户银行账号'
},
{
field: 'rmbRegisteredCapital',
title: 'RMB注册资金'
},
{
field: 'industryCode',
title: '行业代码'
},
{
field: 'merchandiser',
title: '跟单员'
},
{
field: 'merchandiserTelephone',
title: '跟单电话'
},
{
field: 'financialContact',
title: '财务联系人'
},
{
field: 'confirmTax',
title: '是否含税',
formatter: function(value, row, index) {
return $.table.selectDictLabel(confirmTaxDatas, value);
}
},
{
field: 'taxRate',
title: '税率'
},
{
field: 'firstAddTime',
title: '录入时间',
formatter: function (value, row, index) {
if (value == null) {
return " ";
} else {
return value;
fixedColumns:true,
fixedRightNumber:1,
columns: [{checkbox: true},
{title: '供应商id',field: 'supplierId',visible: false},
{title: '审核状态',field: 'auditStatus',formatter: function(value, row, index) {
return $.table.selectDictLabel(auditStatusDatas, value);
}},
{title: '使用状态',field: 'useStatus',formatter: function(value, row, index) {
return $.table.selectDictLabel(useStatusDatas, value);
}},
{ title: '供应商编号',field: 'supplierCode'},
{title: '供应商名称',field: 'supplierName'},
{title: '供应商类型',field: 'supplierType',formatter: function(value, row, index) {
return $.table.selectDictLabel(supplierTypeDatas, value);
}},
{title: '供应商资质',field: 'supplierQualification',formatter: function(value, row, index) {
return $.table.selectDictLabel(supplierqualificationDatas, value);
} },
{title: '企业性质',field: 'enterpriseNature',visible: false},
{title: '企业名称',field: 'enterpriseName',},
{title: '邮编',field: 'postalCode'},
{ title: '经营范围',field: 'businessScope'},
{
field: 'customerCountry',
title: '国家',
formatter: function(value, row, index) {
return $.table.selectDictLabel(customerCountryDatas, value);
}
}
},
{
field: 'updateInfoTime',
title: '上次修改时间',
formatter: function (value, row, index) {
if (value == null) {
return " ";
} else {
var vArr = value.split(',')
return vArr[0];
},
{title: '成立日期',field: 'establishedTime'},
{ title: '法人代表',field: 'legalRepresentative'},
{title: '主联系人',field: 'customerContact'},
{title: '联系电话',field: 'contactNumber'},
{title: '传真',field: 'customerFax'},
{ title: 'Email',field: 'customerEmail'},
{ title: '网站',field: 'website'},
{title: '付款条件',field: 'paymentTerms'},
{title: '采购员',field: 'purchaseBuyer',visible: false},
{title: '天数',field: 'supplierDays'},
{ title: '实际付款天数',field: 'actualPaymentDays',visible: false},
{title: '结汇银行',field: 'settlementBank',visible: false},
{ title: '结汇账号',field: 'exchangeSettlementAccount',visible: false},
{title: '开户银行',field: 'depositBank'},
{title: '开户银行账号',field: 'bankAccount' },
{title: 'RMB注册资金',field: 'rmbRegisteredCapital'},
{title: '行业代码',field: 'industryCode'},
{title: '跟单员', field: 'merchandiser',visible: false},
{ title: '跟单电话',field: 'merchandiserTelephone',visible: false},
{title: '采购员',field: 'purchaseBuyer',},
{
field: 'confirmTax',
title: '是否含税',
formatter: function(value, row, index) {
return $.table.selectDictLabel(confirmTaxDatas, value);
}
},
{title: '税率', field: 'taxRate'},
{
field: 'firstAddTime',
title: '录入时间',
formatter: function (value, row, index) {
if (value == null) {
return " ";
} else {
return value;
}
}
},
{
field: 'updateInfoTime',
title: '上次修改时间',
formatter: function (value, row, index) {
if (value == null) {
return " ";
} else {
var vArr = value.split(',')
return vArr[0];
}
}
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
if(row.auditStatus=="1" && row.useStatus=="1" && !row.cancelInstanceId) {
// 作废
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="$.operate.cancel(\'' + row.supplierId + '\')"><i class="fa fa-remove"></i> 作废</a>');
// 编辑
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.supplierId + '\')"><i class="fa fa-edit"></i> 编辑</a> ');
// 已作废
}else{
actions.push('<a class="btn btn-default btn-xs" href="javascript:void(0)" disabled><i class="fa fa-edit"></i> 编辑</a> ');
}
// 有流程实例id
if(row.useStatus=="2" && !row.restoreInstanceId){
// 恢复
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.restore(\'' + row.supplierId + '\')"><i class="fa fa-window-restore"></i> 恢复</a> ');
}
// 有流程实例id
if (row.instanceId) {
// 有待办人展示审批按钮,
if (row.todoUserId) {
var todoUserIdList = row.todoUserId.split(",");
if(todoUserIdList.includes(loginName)){
var nodeName = row.taskName=='驳回调整'?' 调整申请':' 审批';
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="showVerifyDialog(\'' + prefix + '\',\'' + row.taskId + '\', \'' + row.taskName+"-"+ row.instanceTypeName +"申请" + '\')"><i class="fa fa-edit"></i> '+nodeName+'</a> ');
}
}
// 审批历史
actions.push('<a class="btn btn-warning btn-xs" href="javascript:void(0)" onclick="showHistoryDialog(\'' + row.instanceId + '\')"><i class="fa fa-list"></i> 审批历史</a> ');
// 进度查看
actions.push('<a class="btn btn-info btn-xs" href="javascript:void(0)" onclick="showProcessImgDialog(\'' + row.instanceId + '\')"><i class="fa fa-image"></i> 进度查看</a> ');
}
// 详情
actions.push('<a class="btn btn-primary btn-xs" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.salesOrderId + '\')"><i class="fa fa-eye"></i> 详情</a> ');
return actions.join('');
}
}
}
// {
// title: '操作',
// align: 'center',
// formatter: function(value, row, index) {
// var actions = [];
// actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.supplierId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
// actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.supplierId + '\')"><i class="fa fa-remove"></i>删除</a>');
// return actions.join('');
// }
// }
]
};
$.table.init(options);
});
//导出
function exportSupplierInfo() {
// rows为选中行的id

Loading…
Cancel
Save