update english
This commit is contained in:
parent
54fc44ebcc
commit
78c9471485
@ -40,39 +40,34 @@ public class CustomerController
|
||||
extends BaseQueryController<Customer> {
|
||||
|
||||
private static final String[] SEARCH_COLS = new String[] {
|
||||
Customer.ID,
|
||||
Customer.NAME,
|
||||
Customer.CITY,
|
||||
Customer.COUNTRY_CODE,
|
||||
Customer.STATE,
|
||||
Customer.REGION,
|
||||
Customer.MS,
|
||||
Customer.SALESPERSON,
|
||||
// Customer.NOTE,
|
||||
"customer.id",
|
||||
"customer.name",
|
||||
"customer.city",
|
||||
"customer.country_code",
|
||||
"customer.state",
|
||||
"customer.region",
|
||||
"customer.ms",
|
||||
"customer.salesperson",
|
||||
// status text
|
||||
"prop.name",
|
||||
// ytd sale
|
||||
"ytd_sale.year",
|
||||
"ytd_sale.ytd_sale"
|
||||
"prop.name"
|
||||
};
|
||||
|
||||
private static final Map<String, String> SORT_COLS = new HashMap<>();
|
||||
static {
|
||||
SORT_COLS.put(Customer.ID, Customer.ID);
|
||||
SORT_COLS.put("countryCode", Customer.COUNTRY_CODE);
|
||||
SORT_COLS.put(Customer.MS, Customer.MS);
|
||||
SORT_COLS.put(Customer.REGION, Customer.REGION);
|
||||
SORT_COLS.put(Customer.SALESPERSON, Customer.SALESPERSON);
|
||||
SORT_COLS.put(Customer.YEAR, "ytd_sale." + Customer.YEAR);
|
||||
SORT_COLS.put("ytdSale", "ytd_sale." + Customer.YTD_SALE);
|
||||
SORT_COLS.put(Customer.ID, "customer.id");
|
||||
SORT_COLS.put("countryCode", "customer.country_code");
|
||||
SORT_COLS.put(Customer.MS, "customer.ms");
|
||||
SORT_COLS.put(Customer.REGION, "customer.region");
|
||||
SORT_COLS.put(Customer.SALESPERSON, "customer.salesperson");
|
||||
SORT_COLS.put(Customer.SUM_YTD_SALES, Customer.SUM_YTD_SALES);
|
||||
}
|
||||
|
||||
private static final Map<String, String> CRITERION_COLS;
|
||||
static {
|
||||
CRITERION_COLS = new HashMap<>(SORT_COLS);
|
||||
CRITERION_COLS.put(Customer.NAME, Customer.NAME);
|
||||
CRITERION_COLS.put(Customer.STATE, Customer.STATE);
|
||||
CRITERION_COLS.put(Customer.CITY, Customer.CITY);
|
||||
CRITERION_COLS.put(Customer.NAME, "customer.name");
|
||||
CRITERION_COLS.put(Customer.STATE, "customer.state");
|
||||
CRITERION_COLS.put(Customer.CITY, "customer.city");
|
||||
|
||||
CRITERION_COLS.put("status", "prop.id");
|
||||
}
|
||||
@ -87,7 +82,7 @@ public class CustomerController
|
||||
final int start,
|
||||
@Min(1)
|
||||
@Max(512)
|
||||
@RequestParam(value = "limit", defaultValue = "16")
|
||||
@RequestParam(value = "limit", defaultValue = "64")
|
||||
final int limit,
|
||||
@RequestParam(value = "search", required = false)
|
||||
final String strSearch,
|
||||
|
@ -55,7 +55,7 @@ public class UserController
|
||||
final int start,
|
||||
@Min(1)
|
||||
@Max(512)
|
||||
@RequestParam(value = "limit", defaultValue = "16")
|
||||
@RequestParam(value = "limit", defaultValue = "64")
|
||||
final int limit,
|
||||
@RequestParam(value = "search", required = false)
|
||||
final String search,
|
||||
|
@ -24,7 +24,6 @@ import com.pudonghot.ambition.crm.mapper.CustomerPermissionMapper;
|
||||
import com.pudonghot.ambition.crm.form.create.CustomerFormForCreate;
|
||||
import com.pudonghot.ambition.crm.form.update.CustomerFormForUpdate;
|
||||
import me.chyxion.tigon.service.support.BaseCrudByFormServiceSupport;
|
||||
import com.pudonghot.ambition.crm.mapper.CustomerYearToDateSaleMapper;
|
||||
|
||||
/**
|
||||
* @author Shaun Chyxion <br>
|
||||
@ -43,8 +42,6 @@ public class CustomerServiceSupport
|
||||
@Autowired
|
||||
private CustomerPermissionMapper customerPermissionMapper;
|
||||
@Autowired
|
||||
private CustomerYearToDateSaleMapper customerYearToDateSaleMapper;
|
||||
@Autowired
|
||||
private CustomerIssueService customerIssueService;
|
||||
|
||||
/**
|
||||
@ -67,9 +64,6 @@ public class CustomerServiceSupport
|
||||
accounts.add(permission.getUserAccount());
|
||||
}
|
||||
viewModel.setAttr("users", userService.listByCustomerId(id));
|
||||
viewModel.setAttr("ytdSales", customerYearToDateSaleMapper.list(
|
||||
new Search(CustomerYearToDateSale.CUSTOMER_ID, id)
|
||||
.eq(CustomerYearToDateSale.ENABLED, true)));
|
||||
viewModel.setAttr("issues", customerIssueService.listViewModels(
|
||||
new Search(CustomerYearToDateSale.CUSTOMER_ID, id)
|
||||
.eq(CustomerYearToDateSale.ENABLED, true)));
|
||||
@ -82,12 +76,31 @@ public class CustomerServiceSupport
|
||||
*/
|
||||
@Override
|
||||
public ListResult<ViewModel<Customer>> listViewModelsPage(Search search) {
|
||||
search.table("customer");
|
||||
final String account = search.getAttr(User.ACCOUNT);
|
||||
return new ListResult<>(toViewModel(mapper.listForShow(search, account)),
|
||||
mapper.countForShow(search, account));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
protected void processViewModel(ViewModel<Customer> viewModel, Customer model) {
|
||||
super.processViewModel(viewModel, model);
|
||||
|
||||
// List<Map<String, Object>> ytdSales;0wi
|
||||
|
||||
final String strYears = model.getYears();
|
||||
final String strYtdSales = model.getYtdSales();
|
||||
|
||||
if (StringUtils.isNotBlank(strYears) &&
|
||||
StringUtils.isNotBlank(strYtdSales)) {
|
||||
String[] years = strYears.split("\\s*,\\s*");
|
||||
String[] ytdSales = strYtdSales.split("\\s*,\\s*");
|
||||
}
|
||||
// viewModel.setAttr("ytdSales", ytdSales);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @param csvIn
|
||||
|
@ -4,11 +4,17 @@ import java.util.Map;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.io.InputStream;
|
||||
import java.text.ParseException;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import me.chyxion.tigon.mybatis.Search;
|
||||
import org.apache.commons.csv.CSVRecord;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.time.DateUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.pudonghot.ambition.crm.util.CSVUtils;
|
||||
import com.pudonghot.ambition.crm.model.Customer;
|
||||
import com.pudonghot.ambition.crm.mapper.CustomerMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import com.pudonghot.ambition.crm.model.CustomerYearToDateSale;
|
||||
import me.chyxion.tigon.service.support.BaseCrudByFormServiceSupport;
|
||||
import com.pudonghot.ambition.crm.mapper.CustomerYearToDateSaleMapper;
|
||||
@ -30,6 +36,8 @@ public class CustomerYearToDateSaleServiceSupport
|
||||
CustomerYearToDateSaleFormForUpdate,
|
||||
CustomerYearToDateSaleMapper>
|
||||
implements CustomerYearToDateSaleService {
|
||||
@Autowired
|
||||
private CustomerMapper customerMapper;
|
||||
|
||||
@Override
|
||||
public void importCSV(final String operator, final InputStream csvIn) {
|
||||
@ -57,10 +65,31 @@ public class CustomerYearToDateSaleServiceSupport
|
||||
public void read(final CSVRecord record) {
|
||||
final CustomerYearToDateSale customerYtdSale =
|
||||
new CustomerYearToDateSale();
|
||||
final String customerId = record.get(0).trim();
|
||||
final String customerId = StringUtils.trim(record.get(0));
|
||||
customerYtdSale.setCustomerId(customerId);
|
||||
customerYtdSale.setYear(record.get(3).trim());
|
||||
customerYtdSale.setYtdSale(Long.parseLong(record.get(6).trim().replace(",", "")));
|
||||
customerYtdSale.setYear(StringUtils.trim(record.get(3)));
|
||||
customerYtdSale.setYtdSale(Long.parseLong(StringUtils.trim(record.get(6)).replace(",", "")));
|
||||
|
||||
// update date added
|
||||
final String strDateAdded = StringUtils.trim(record.get(5));
|
||||
if (StringUtils.isNotBlank(strDateAdded)) {
|
||||
log.info("Update Customer [{}] Date Added [{}].", customerId, strDateAdded);
|
||||
Date dateAdded = null;
|
||||
try {
|
||||
dateAdded = DateUtils.parseDate(strDateAdded, "M/d/yyyy");
|
||||
}
|
||||
catch (ParseException e) {
|
||||
log.warn("Parse Date [{}] Error Caused, Ignore.", strDateAdded, e);
|
||||
}
|
||||
if (dateAdded != null) {
|
||||
final Customer customer = customerMapper.find(customerId);
|
||||
customer.setDateAdded(dateAdded);
|
||||
customer.setUpdatedBy(operator);
|
||||
customer.setDateUpdated(now);
|
||||
log.info("Update Customer [{}] Date Added.", customer);
|
||||
customerMapper.update(customer);
|
||||
}
|
||||
}
|
||||
|
||||
log.info("Customer YTD Sale [{}] Read.", customerYtdSale);
|
||||
createOrUpdateCustomerYTDSale(operator, customerYtdSale, now);
|
||||
|
@ -1,14 +1,15 @@
|
||||
package com.pudonghot.ambition.crm.service.support;
|
||||
|
||||
import java.util.List;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.hibernate.validator.constraints.NotBlank;
|
||||
import org.springframework.util.Assert;
|
||||
import me.chyxion.tigon.mybatis.Search;
|
||||
import me.chyxion.tigon.model.ViewModel;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import com.pudonghot.ambition.crm.model.User;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.pudonghot.ambition.util.Sha512Utils;
|
||||
import org.hibernate.validator.constraints.NotBlank;
|
||||
import com.pudonghot.ambition.crm.mapper.UserMapper;
|
||||
import com.pudonghot.ambition.crm.service.UserService;
|
||||
import com.pudonghot.ambition.crm.form.create.UserFormForCreate;
|
||||
@ -16,8 +17,6 @@ import com.pudonghot.ambition.crm.form.update.UserFormForUpdate;
|
||||
import me.chyxion.tigon.service.support.BaseCrudByFormServiceSupport;
|
||||
import com.pudonghot.ambition.crm.form.update.UserFormForUpdatePassword;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @version 0.0.1
|
||||
* @since 0.0.1
|
||||
|
@ -1,10 +1,10 @@
|
||||
# Server
|
||||
server.port=80
|
||||
server.port=8088
|
||||
|
||||
# MySQL
|
||||
|
||||
datasource.host=127.0.0.1
|
||||
datasource.port=3306
|
||||
datasource.port=43306
|
||||
datasource.database-name=ambition_crm
|
||||
datasource.username=root
|
||||
datasource.password=696@2^~)oZ@^#*Q
|
||||
|
@ -1,13 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Configuration status="WARN">
|
||||
<Properties>
|
||||
<Property name="log.level">INFO</Property>
|
||||
<Property name="log.dir">/data/program/logs/${project.artifactId}</Property>
|
||||
<Property name="log.level">DEBUG</Property>
|
||||
<Property name="log.dir">.logs</Property>
|
||||
<Property name="pattern">%-d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%t][%c{1}] %m%n</Property>
|
||||
</Properties>
|
||||
<Appenders>
|
||||
<Console name="Console" target="SYSTEM_OUT">
|
||||
<PatternLayout pattern="${pattern}" />
|
||||
<PatternLayout pattern="%highlight{%-d{yyyy-MM-dd HH:mm:ss,SSS}}{FATAL=magenta, ERROR=magenta, WARN=magenta, INFO=magenta, DEBUG=magenta, TRACE=magenta} %highlight{%-5p}{FATAL=red blink, ERROR=red, WARN=yellow bold, INFO=black, DEBUG=green bold, TRACE=blue} [%t][%highlight{%c{1.}}{FATAL=cyan, ERROR=cyan, WARN=cyan, INFO=cyan, DEBUG=cyan, TRACE=cyan}] %m%n"/>
|
||||
</Console>
|
||||
<RollingFile name="File"
|
||||
fileName="${log.dir}/${project.artifactId}.log"
|
||||
@ -32,6 +32,7 @@
|
||||
</Logger>
|
||||
<Root level="${log.level}" additivity="false">
|
||||
<AppenderRef ref="File" level="${log.level}" />
|
||||
<AppenderRef ref="Console" level="${log.level}" />
|
||||
</Root>
|
||||
</Loggers>
|
||||
</Configuration>
|
||||
|
@ -15,12 +15,30 @@ import org.hibernate.validator.constraints.NotBlank;
|
||||
* Jun 19, 2017 10:35:51 PM
|
||||
*/
|
||||
public interface CustomerMapper extends BaseMapper<String, Customer> {
|
||||
|
||||
/**
|
||||
* find for show
|
||||
* @param id id
|
||||
* @return customer
|
||||
*/
|
||||
Customer findForShow(@NotBlank @Param("id") String id);
|
||||
|
||||
/**
|
||||
* list for show
|
||||
* @param search search
|
||||
* @param account account
|
||||
* @return customers
|
||||
*/
|
||||
List<Customer> listForShow(
|
||||
@NotNull @Param("s") Search search,
|
||||
@Param("account") String account);
|
||||
|
||||
/**
|
||||
* count for show
|
||||
* @param search search
|
||||
* @param account account
|
||||
* @return count of customers
|
||||
*/
|
||||
int countForShow(
|
||||
@NotNull @Param("s") Search search,
|
||||
@Param("account") String account);
|
||||
|
@ -12,64 +12,18 @@
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.pudonghot.ambition.crm.mapper.CustomerMapper">
|
||||
<select id="findForShow" resultType="com.pudonghot.ambition.crm.model.Customer">
|
||||
select
|
||||
customer.id,
|
||||
customer.name,
|
||||
customer.country_code,
|
||||
customer.state,
|
||||
customer.city,
|
||||
customer.ms,
|
||||
customer.region,
|
||||
customer.salesperson,
|
||||
customer.enabled,
|
||||
customer.note,
|
||||
customer.status,
|
||||
customer.created_by,
|
||||
customer.date_created,
|
||||
customer.updated_by,
|
||||
customer.date_updated,
|
||||
prop.name status_text
|
||||
from <include refid="table" /> customer
|
||||
left join crm_customer_property prop
|
||||
on customer.status = prop.id
|
||||
<include refid="selectionCommon" />
|
||||
where customer.id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="listForShow" resultType="com.pudonghot.ambition.crm.model.Customer">
|
||||
select
|
||||
customer.id,
|
||||
customer.name,
|
||||
customer.country_code,
|
||||
customer.state,
|
||||
customer.city,
|
||||
customer.ms,
|
||||
customer.region,
|
||||
customer.salesperson,
|
||||
customer.enabled,
|
||||
customer.note,
|
||||
customer.status,
|
||||
customer.created_by,
|
||||
customer.date_created,
|
||||
customer.updated_by,
|
||||
customer.date_updated,
|
||||
prop.name status_text,
|
||||
ytd_sale.year,
|
||||
ytd_sale.ytd_sale
|
||||
|
||||
from <include refid="table" /> customer
|
||||
|
||||
<if test="account != null">
|
||||
join crm_customer_permission perm on
|
||||
customer.id = perm.customer_id
|
||||
and perm.enabled = 1
|
||||
and perm.user_account = #{account}
|
||||
</if>
|
||||
|
||||
join crm_customer_year_to_date_sale ytd_sale
|
||||
on customer.id = ytd_sale.customer_id
|
||||
left join crm_customer_property prop
|
||||
on customer.status = prop.id
|
||||
|
||||
<include refid="selectionCommon" />
|
||||
<if test="account != null">
|
||||
join crm_customer_permission perm on
|
||||
customer.id = perm.customer_id
|
||||
and perm.enabled = 1
|
||||
and perm.user_account = #{account}
|
||||
</if>
|
||||
<include refid="Tigon.search" />
|
||||
</select>
|
||||
|
||||
@ -77,17 +31,45 @@
|
||||
select count(1)
|
||||
|
||||
from <include refid="table" /> customer
|
||||
|
||||
left join crm_customer_property prop
|
||||
on customer.status = prop.id
|
||||
|
||||
<if test="account != null">
|
||||
join crm_customer_permission perm on
|
||||
customer.id = perm.customer_id
|
||||
and perm.enabled = 1
|
||||
and perm.user_account = #{account}
|
||||
</if>
|
||||
join crm_customer_year_to_date_sale ytd_sale
|
||||
on customer.id = ytd_sale.customer_id
|
||||
left join crm_customer_property prop
|
||||
on customer.status = prop.id
|
||||
|
||||
<include refid="Tigon.searchForCount" />
|
||||
</select>
|
||||
|
||||
<sql id="selectionCommon">
|
||||
select
|
||||
<foreach collection="new com.pudonghot.ambition.crm.model.Customer().cols('customer')"
|
||||
item="col" separator=", ">
|
||||
${col}
|
||||
</foreach>
|
||||
, prop.name status_text,
|
||||
(select group_concat(year order by year asc separator ',')
|
||||
from crm_customer_year_to_date_sale
|
||||
where customer_id = customer.id
|
||||
and enabled = 1
|
||||
group by customer_id) years,
|
||||
(select group_concat(ytd_sale order by year asc separator ',')
|
||||
from crm_customer_year_to_date_sale
|
||||
where customer_id = customer.id
|
||||
and enabled = 1
|
||||
group by customer_id) ytd_sales,
|
||||
(select sum(ytd_sale)
|
||||
from crm_customer_year_to_date_sale
|
||||
where customer_id = customer.id
|
||||
and enabled = 1) sum_ytd_sales
|
||||
|
||||
from <include refid="table" /> customer
|
||||
left join crm_customer_property prop
|
||||
on customer.status = prop.id
|
||||
</sql>
|
||||
</mapper>
|
||||
|
||||
|
@ -3,9 +3,9 @@ package com.pudonghot.ambition.crm.form.create;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import me.chyxion.tigon.form.FC2;
|
||||
import me.chyxion.tigon.format.annotation.EmptyToNull;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
import org.hibernate.validator.constraints.NotBlank;
|
||||
import me.chyxion.tigon.format.annotation.EmptyToNull;
|
||||
|
||||
/**
|
||||
* @version 0.0.1
|
||||
|
@ -4,6 +4,7 @@ import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import me.chyxion.tigon.form.FC2;
|
||||
import javax.validation.constraints.Pattern;
|
||||
import me.chyxion.tigon.format.annotation.Trim;
|
||||
import org.hibernate.validator.constraints.Email;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
import org.hibernate.validator.constraints.NotBlank;
|
||||
@ -35,7 +36,7 @@ public class UserFormForCreate extends FC2<String> {
|
||||
private String name;
|
||||
@Length(max = 36)
|
||||
private String enName;
|
||||
@NotBlank
|
||||
@Trim
|
||||
@Pattern(regexp = GENDER_REGEXP)
|
||||
private String gender;
|
||||
@Length(max = 16)
|
||||
|
@ -37,7 +37,6 @@ public class UserFormForUpdate extends FU2<String, String> {
|
||||
@Length(max = 36)
|
||||
private String enName;
|
||||
@Trim
|
||||
@NotBlank
|
||||
@Pattern(regexp = GENDER_REGEXP)
|
||||
private String gender;
|
||||
@EmptyToNull
|
||||
|
@ -2,6 +2,7 @@ package com.pudonghot.ambition.crm.model;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import java.util.Date;
|
||||
import me.chyxion.tigon.model.M3;
|
||||
import me.chyxion.tigon.mybatis.Table;
|
||||
import me.chyxion.tigon.mybatis.Transient;
|
||||
@ -20,6 +21,7 @@ public class Customer extends M3<String, String> {
|
||||
|
||||
// Column Names
|
||||
public static final String SALESPERSON = "salesperson";
|
||||
public static final String DATE_ADDED = "date_added";
|
||||
public static final String NAME = "name";
|
||||
public static final String COUNTRY_CODE = "country_code";
|
||||
public static final String STATE = "state";
|
||||
@ -27,11 +29,11 @@ public class Customer extends M3<String, String> {
|
||||
public static final String MS = "ms";
|
||||
public static final String REGION = "region";
|
||||
public static final String STATUS = "status";
|
||||
public static final String YEAR = "year";
|
||||
public static final String YTD_SALE = "ytd_sale";
|
||||
public static final String SUM_YTD_SALES = "sum_ytd_sales";
|
||||
|
||||
// Properties
|
||||
private String salesperson;
|
||||
private Date dateAdded;
|
||||
private String name;
|
||||
private String countryCode;
|
||||
private String state;
|
||||
@ -42,10 +44,10 @@ public class Customer extends M3<String, String> {
|
||||
|
||||
@Transient
|
||||
private String statusText;
|
||||
|
||||
// ytd props
|
||||
@Transient
|
||||
private String year;
|
||||
private String years;
|
||||
@Transient
|
||||
private Long ytdSale;
|
||||
private String ytdSales;
|
||||
@Transient
|
||||
private int sumYtdSales;
|
||||
}
|
||||
|
@ -3,6 +3,8 @@ import BaseFormInput from './base-form-input';
|
||||
|
||||
export default BaseFormInput.extend({
|
||||
label: '状态',
|
||||
enabledText: '启用',
|
||||
disabledText: '禁用',
|
||||
name: 'enabled',
|
||||
classNames: ['form-group'],
|
||||
didReceiveAttrs() {
|
||||
|
@ -24,9 +24,9 @@ export default BaseFormInput.extend({
|
||||
let me = this;
|
||||
me.get('type') === 'file' &&
|
||||
me.$('input[type=file]').ace_file_input({
|
||||
no_file: '没有选择文件...',
|
||||
btn_choose: '选择',
|
||||
btn_change: '更换',
|
||||
no_file: 'No File Choosed...',
|
||||
btn_choose: 'Choose',
|
||||
btn_change: 'Change',
|
||||
droppable: true,
|
||||
before_change: function() {
|
||||
let filename = Ember.$(this).val();
|
||||
|
@ -5,7 +5,7 @@ export default BaseComponent.extend({
|
||||
trimIndex: true,
|
||||
tagName: 'a',
|
||||
attributeBindings: ['href', 'title'],
|
||||
title: '刷新',
|
||||
title: 'Reload',
|
||||
href: 'javascript:;',
|
||||
click() {
|
||||
this.get('route').refresh();
|
||||
|
@ -1,7 +1,7 @@
|
||||
import Ember from 'ember';
|
||||
|
||||
export function numberUs(params) {
|
||||
let num = params[0];
|
||||
let num = Ember.isNone(params[0]) ? 0 : params[0];
|
||||
let p = num.toFixed(2).split('.');
|
||||
return p[0].split('').reverse().reduce(function(acc, num, i, orig) {
|
||||
return num == "-" ? acc : num + (i && !(i % 3) ? ',' : '') + acc;
|
||||
|
@ -2,7 +2,7 @@ import Ember from 'ember';
|
||||
import BaseRoute from '../base';
|
||||
|
||||
export default BaseRoute.extend({
|
||||
breadcrumbs: [{route: 'customer.list', params: 1, text: '客户列表'}, {text: '创建客户备注'}],
|
||||
breadcrumbs: [{route: 'customer.list', params: 1, text: 'Customers'}, {text: 'Create Customer Issue'}],
|
||||
model(params) {
|
||||
return {
|
||||
customerId: params.customerId
|
||||
|
@ -3,8 +3,11 @@ import BaseEditRoute from '../base-edit';
|
||||
|
||||
export default BaseEditRoute.extend({
|
||||
afterModel(model) {
|
||||
let me = this;
|
||||
let customerId = model.customerId;
|
||||
this.set('breadcrumbs',
|
||||
[{route: 'customer.list', params: 1, text: '客户列表'},
|
||||
{text: '编辑客户[' + model.customerId + ']注记'}]);
|
||||
[{route: 'customer.list', params: 1, text: 'Customers'},
|
||||
{route: 'customer.show', params: customerId, text: 'Show Customer [' + customerId + ']'},
|
||||
{text: 'Edit Customer [' + customerId + '] Issue'}]);
|
||||
}
|
||||
});
|
||||
|
@ -2,7 +2,8 @@ import Ember from 'ember';
|
||||
import BaseRoute from '../base';
|
||||
|
||||
export default BaseRoute.extend({
|
||||
breadcrumbs: [{route: 'customer-status.list', params: 1, text: '客户状态列表'}, {text: '创建客户状态'}],
|
||||
breadcrumbs: [{route: 'customer-status.list', params: 1, text: 'Customer Status'},
|
||||
{text: 'Create Customer Status'}],
|
||||
model() {
|
||||
return {
|
||||
gender: 'M',
|
||||
|
@ -4,7 +4,7 @@ import BaseEditRoute from '../base-edit';
|
||||
export default BaseEditRoute.extend({
|
||||
afterModel(model) {
|
||||
this.set('breadcrumbs',
|
||||
[{route: 'customer-status.list', params: 1, text: '客户状态列表'},
|
||||
{text: '编辑客户状态[' + model.name + ']'}]);
|
||||
[{route: 'customer-status.list', params: 1, text: 'Customer Status'},
|
||||
{text: 'Edit Customer Status[' + model.name + ']'}]);
|
||||
}
|
||||
});
|
||||
|
@ -2,7 +2,7 @@ import Ember from 'ember';
|
||||
import BaseListRoute from './../base-list';
|
||||
|
||||
export default BaseListRoute.extend({
|
||||
breadcrumbs: [{text: '客户状态列表'}],
|
||||
breadcrumbs: [{text: 'Customer Status'}],
|
||||
extraParams() {
|
||||
return {type: 'STATUS'};
|
||||
},
|
||||
|
@ -1,7 +1,7 @@
|
||||
import BaseRoute from '../base';
|
||||
|
||||
export default BaseRoute.extend({
|
||||
breadcrumbs: [{route: 'customer.list', params: 1, text: '客户列表'}, {text: '导入客户销售记录'}],
|
||||
breadcrumbs: [{route: 'customer.list', params: 1, text: 'Customers'}, {text: 'Import Sales Data'}],
|
||||
model() {
|
||||
return {};
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ import BaseEditRoute from '../base-edit';
|
||||
export default BaseEditRoute.extend({
|
||||
afterModel(model) {
|
||||
this.set('breadcrumbs',
|
||||
[{route: 'customer.list', params: 1, text: '客户列表'},
|
||||
{text: '编辑客户[' + model.id + ']'}]);
|
||||
[{route: 'customer.list', params: 1, text: 'Customers'},
|
||||
{text: 'Edit Customer [' + model.id + ']'}]);
|
||||
}
|
||||
});
|
||||
|
@ -2,7 +2,7 @@ import Ember from 'ember';
|
||||
import BaseRoute from '../base';
|
||||
|
||||
export default BaseRoute.extend({
|
||||
breadcrumbs: [{route: 'customer.list', params: 1, text: '客户列表'}, {text: '导入客户'}],
|
||||
breadcrumbs: [{route: 'customer.list', params: 1, text: 'Customers'}, {text: 'Import Customers'}],
|
||||
model() {
|
||||
return {};
|
||||
}
|
||||
|
@ -38,8 +38,9 @@ const config = {
|
||||
};
|
||||
|
||||
cols.forEach((col) => {
|
||||
config[col] = true;
|
||||
config[col] = !['showCountryCode', 'showState', 'showCity'].contains(col);
|
||||
});
|
||||
|
||||
const TableOptions = Ember.Object.extend(config);
|
||||
|
||||
export default BaseListRoute.extend({
|
||||
@ -48,12 +49,7 @@ export default BaseListRoute.extend({
|
||||
refreshModel: true
|
||||
}
|
||||
},
|
||||
breadcrumbs: [{text: '客户列表'}],
|
||||
actions: {
|
||||
sort(col) {
|
||||
Ember.Logger.info('sort: ', col);
|
||||
}
|
||||
},
|
||||
breadcrumbs: [{text: 'Customers'}],
|
||||
setupController(controller) {
|
||||
let me = this;
|
||||
me._super(...arguments);
|
||||
|
@ -27,24 +27,24 @@ export default Ember.Route.extend({
|
||||
tableOptions: parentController.get('tableOptions'),
|
||||
statusList: parentController.get('model.statusList'),
|
||||
criteria: criteria,
|
||||
cols: [{col: 'name', name: '名称'},
|
||||
{col: 'year', name: '年份'},
|
||||
{col: 'ytdSale', name: '年销售额'},
|
||||
{col: 'countryCode', name: '国家'},
|
||||
{col: 'state', name: '省份'},
|
||||
{col: 'city', name: '城市'},
|
||||
cols: [{col: 'name', name: 'Name'},
|
||||
{col: 'year', name: 'Year'},
|
||||
{col: 'ytdSale', name: 'YTD Sales'},
|
||||
{col: 'countryCode', name: 'Country'},
|
||||
{col: 'state', name: 'State'},
|
||||
{col: 'city', name: 'City'},
|
||||
{col: 'ms', name: 'MS'},
|
||||
{col: 'region', name: '区域'},
|
||||
{col: 'salesperson', name: '销售'},
|
||||
{col: 'status', name: '状态'},
|
||||
{col: 'region', name: 'Region'},
|
||||
{col: 'salesperson', name: 'Salesperson'},
|
||||
{col: 'status', name: 'Status'},
|
||||
],
|
||||
ops: [{op: 'eq', name: '等于'},
|
||||
{op: 'gt', name: '大于'},
|
||||
{op: 'lt', name: '小于'},
|
||||
{op: 'gte', name: '大于等于'},
|
||||
{op: 'lte', name: '小于等于'},
|
||||
{op: 'ne', name: '不等于'},
|
||||
{op: 'like', name: '匹配'}
|
||||
ops: [{op: 'eq', name: '='},
|
||||
{op: 'gt', name: '>'},
|
||||
{op: 'lt', name: '<'},
|
||||
{op: 'gte', name: '>='},
|
||||
{op: 'lte', name: '<='},
|
||||
{op: 'ne', name: '<>'},
|
||||
{op: 'like', name: 'Like'}
|
||||
]
|
||||
};
|
||||
},
|
||||
|
@ -4,7 +4,7 @@ import BaseEditRoute from '../base-edit';
|
||||
export default BaseEditRoute.extend({
|
||||
afterModel(model) {
|
||||
this.set('breadcrumbs',
|
||||
[{route: 'customer.list', params: 1, text: '客户列表'},
|
||||
{text: '查看客户[' + model.id + ']'}]);
|
||||
[{route: 'customer.list', params: 1, text: 'Customers'},
|
||||
{text: 'Show Customer [' + model.id + ']'}]);
|
||||
}
|
||||
});
|
||||
|
@ -2,7 +2,7 @@ import Ember from 'ember';
|
||||
import BaseRoute from '../base';
|
||||
|
||||
export default BaseRoute.extend({
|
||||
breadcrumbs: [{route: 'user.list', params: 1, text: '用户列表'}, {text: '创建用户'}],
|
||||
breadcrumbs: [{route: 'user.list', params: 1, text: 'Users'}, {text: 'Create User'}],
|
||||
model() {
|
||||
return {
|
||||
gender: 'M',
|
||||
|
@ -1,4 +0,0 @@
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Route.extend({
|
||||
});
|
@ -4,7 +4,7 @@ import BaseEditRoute from '../base-edit';
|
||||
export default BaseEditRoute.extend({
|
||||
afterModel(model) {
|
||||
this.set('breadcrumbs',
|
||||
[{route: 'user.list', params: 1, text: '用户列表'},
|
||||
{text: '编辑用户[' + model.employeeId + ']'}]);
|
||||
[{route: 'user.list', params: 1, text: 'Users'},
|
||||
{text: 'Edit User [' + model.employeeId + ']'}]);
|
||||
}
|
||||
});
|
||||
|
@ -1,4 +0,0 @@
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Route.extend({
|
||||
});
|
@ -2,10 +2,5 @@ import Ember from 'ember';
|
||||
import BaseListRoute from './../base-list';
|
||||
|
||||
export default BaseListRoute.extend({
|
||||
breadcrumbs: [{text: '用户列表'}],
|
||||
actions: {
|
||||
sort(col) {
|
||||
Ember.Logger.info('sort: ', col);
|
||||
}
|
||||
}
|
||||
breadcrumbs: [{text: 'Users'}]
|
||||
});
|
||||
|
@ -1,43 +0,0 @@
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Route.extend({
|
||||
actions: {
|
||||
didTransition() {
|
||||
var me = this;
|
||||
me.set('working', false)
|
||||
Ember.run.later(function() {
|
||||
Ember.$('input[type=file]').ace_file_input({
|
||||
style: 'well',
|
||||
btn_choose: 'Click to choose new avatar',
|
||||
btn_change: null,
|
||||
no_icon: 'ace-icon fa fa-picture-o',
|
||||
thumbnail: 'small',
|
||||
before_remove: function() {
|
||||
//don't remove/reset files while being uploaded
|
||||
return !me.get('working')
|
||||
},
|
||||
allowExt: ['jpg', 'jpeg', 'png', 'gif'],
|
||||
allowMime: ['image/jpg', 'image/jpeg', 'image/png', 'image/gif']
|
||||
});
|
||||
}, 48);
|
||||
// Bubble the didTransition event
|
||||
return true;
|
||||
},
|
||||
submit() {
|
||||
let me = this;
|
||||
if (!Ember.$('input[type=file]').val()) {
|
||||
me.get('message').warn('请选择文件');
|
||||
}
|
||||
else {
|
||||
me.get('dialog').confirm('确认要更新头像吗?', () => {
|
||||
me.get('store').ajaxPost('admin/upload-avatar',
|
||||
new FormData(Ember.$('#form_upload_avatar')[0])).then((admin) => {
|
||||
me.get('message').alert('头像更新成功');
|
||||
Ember.getOwner(me).lookup('route:admin.profile').set('controller.model.avatar', admin.avatar);
|
||||
me.transitionTo('admin.profile');
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
@ -3,6 +3,7 @@ import BaseService from '../service';
|
||||
|
||||
export default BaseService.extend({
|
||||
modelName: 'User',
|
||||
pageSize: 64,
|
||||
createConstraints: {
|
||||
account: {
|
||||
presence: true,
|
||||
|
@ -1,6 +1,6 @@
|
||||
<li>
|
||||
<i class="ace-icon fa fa-home home-icon"></i>
|
||||
<a href="#/">首页</a>
|
||||
<a href="#/">Home</a>
|
||||
</li>
|
||||
{{log breadcrumbs}}
|
||||
{{#each breadcrumbs as |breadcrumb|}}
|
||||
|
@ -1,9 +1,9 @@
|
||||
<button class="btn btn-prev" {{action 'goback'}}>
|
||||
<i class="ace-icon fa fa-arrow-left"></i>
|
||||
返回
|
||||
Goback
|
||||
</button>
|
||||
|
||||
<button class="btn btn-success btn-next" {{action 'save'}}>
|
||||
提交
|
||||
Submit
|
||||
<i class="ace-icon fa fa-arrow-right icon-on-right"></i>
|
||||
</button>
|
||||
|
@ -3,7 +3,7 @@
|
||||
<div>
|
||||
<label class="line-height-1 green">
|
||||
{{radio-button value=true groupValue=(mut (get model name)) class="ace"}}
|
||||
<span class="lbl"> 启用</span>
|
||||
<span class="lbl"> {{enabledText}}</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
<label class="line-height-1 red">
|
||||
<!-- <input name="gender" value="false" type="radio" class="ace" /> -->
|
||||
{{radio-button value=false groupValue=(mut (get model name)) class="ace"}}
|
||||
<span class="lbl"> 禁用</span>
|
||||
<span class="lbl"> {{disabledText}}</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -35,7 +35,7 @@
|
||||
<li class="">
|
||||
{{#link-to 'user.list' 1}}
|
||||
<i class="menu-icon fa fa-user blue"></i>
|
||||
<span class="menu-text"> 用户管理 </span>
|
||||
<span class="menu-text"> User </span>
|
||||
{{/link-to}}
|
||||
</li>
|
||||
{{/if}}
|
||||
@ -43,14 +43,14 @@
|
||||
<li class="">
|
||||
{{#link-to 'customer.list' 1}}
|
||||
<i class="menu-icon fa fa-address-book-o blue"></i>
|
||||
<span class="menu-text"> 客户管理 </span>
|
||||
<span class="menu-text"> Customer </span>
|
||||
{{/link-to}}
|
||||
</li>
|
||||
{{#if ajax.user.admin}}
|
||||
<li>
|
||||
{{#link-to 'customer-status.list' 1}}
|
||||
<i class="menu-icon fa fa-star-half-o blue"></i>
|
||||
<span class="menu-text"> 客户状态管理 </span>
|
||||
<span class="menu-text"> Customer Status </span>
|
||||
{{/link-to}}
|
||||
</li>
|
||||
{{/if}}
|
||||
|
@ -1,5 +1,5 @@
|
||||
<h6 class="pull-left no-margin">
|
||||
总共:{{total}}条记录
|
||||
Total: {{total}} Records
|
||||
</h6>
|
||||
<ul class="pagination pull-right no-margin">
|
||||
<li class="prev">
|
||||
|
@ -1,6 +1,6 @@
|
||||
{{#form-content}}
|
||||
{{form-input type='hidden' name='customerId'}}
|
||||
{{form-input name='issue' label='注记' type='textarea'}}
|
||||
{{form-input name='issue' label='Issue' type='textarea'}}
|
||||
<hr />
|
||||
{{form-footer-buttons backRouteName='customer.show' backRouteParams=model.customerId}}
|
||||
{{/form-content}}
|
||||
|
@ -1,7 +1,7 @@
|
||||
{{#form-content}}
|
||||
{{form-input type='hidden' name='id'}}
|
||||
{{form-input type='hidden' name='enabled'}}
|
||||
{{form-input name='issue' label='注记' type='textarea'}}
|
||||
{{form-input name='issue' label='Issue' type='textarea'}}
|
||||
<hr />
|
||||
{{form-footer-buttons type='update' backRouteName='customer.show' backRouteParams=model.customerId}}
|
||||
{{/form-content}}
|
||||
|
@ -1,8 +1,8 @@
|
||||
{{#form-content}}
|
||||
{{form-input type='hidden' name='type'}}
|
||||
{{form-input name='name' label='名称'}}
|
||||
{{form-input-enabled}}
|
||||
{{form-input name='note' label='备注'}}
|
||||
{{form-input name='name' label='Name'}}
|
||||
{{form-input-enabled label='Enabled' enabledText='TRUE' disabledText='FALSE'}}
|
||||
{{form-input name='note' label='Remark'}}
|
||||
<hr />
|
||||
{{form-footer-buttons}}
|
||||
{{/form-content}}
|
||||
|
@ -1,9 +1,9 @@
|
||||
{{#form-content}}
|
||||
{{input type='hidden' name='id' value=model.id}}
|
||||
{{form-input type='hidden' name='type'}}
|
||||
{{form-input name='name' label='名称'}}
|
||||
{{form-input-enabled}}
|
||||
{{form-input name='note' label='备注'}}
|
||||
{{form-input name='name' label='Name'}}
|
||||
{{form-input-enabled label='Enabled' enabledText='TRUE' disabledText='FALSE'}}
|
||||
{{form-input name='note' label='Remark'}}
|
||||
<hr />
|
||||
{{form-footer-buttons type='update'}}
|
||||
{{/form-content}}
|
||||
|
@ -1,14 +1,14 @@
|
||||
{{#modal-list-select title='客户状态列表'}}
|
||||
{{#modal-list-select title='Customer Status'}}
|
||||
<thead class="thin-border-bottom">
|
||||
<tr>
|
||||
<th>
|
||||
</th>
|
||||
<th>
|
||||
名称
|
||||
Name
|
||||
</th>
|
||||
<th>
|
||||
<i class="ace-icon fa fa-sticky-note-o bigger-110 hidden-480"></i>
|
||||
备注
|
||||
Remark
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
@ -3,7 +3,7 @@
|
||||
{{#grid-header}}
|
||||
<li>
|
||||
{{#link-to 'customer-status.create'}}
|
||||
新建客户状态
|
||||
Create Customer Status
|
||||
{{/link-to}}
|
||||
</li>
|
||||
{{/grid-header}}
|
||||
@ -15,19 +15,19 @@
|
||||
<thead class="thin-border-bottom">
|
||||
<tr>
|
||||
<th>
|
||||
名称
|
||||
Name
|
||||
</th>
|
||||
<th class="hidden-480">
|
||||
<i class="ace-icon fa fa-sticky-note-o bigger-110 hidden-480"></i>
|
||||
备注
|
||||
Remark
|
||||
</th>
|
||||
<th>
|
||||
<i class="ace-icon fa fa-exchange bigger-110 hidden-480"></i>
|
||||
状态
|
||||
Enabled
|
||||
</th>
|
||||
<th>
|
||||
<i class="ace-icon fa fa-cogs bigger-110 hidden-480"></i>
|
||||
管理
|
||||
Settings
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -42,21 +42,21 @@
|
||||
{{editable-cell model=it field='note'}}
|
||||
</td>
|
||||
<td>
|
||||
{{status-cell model=it}}
|
||||
{{status-cell model=it enabledText='TRUE' disabledText='FALSE'}}
|
||||
</td>
|
||||
<td>
|
||||
<div class="hidden-sm hidden-xs btn-group">
|
||||
{{status-toggle-button model=it}}
|
||||
{{#link-to 'customer-status.edit' it.id class='btn btn-xs btn-info' title='编辑'}}
|
||||
{{#link-to 'customer-status.edit' it.id class='btn btn-xs btn-info' title='Edit'}}
|
||||
<i class="ace-icon fa fa-pencil bigger-120"></i>
|
||||
{{/link-to}}
|
||||
{{#if (not-eq model.data.firstObject.id it.id)}}
|
||||
<button class="btn btn-xs btn-purple" title="上移" {{action (route-action 'moveUp' it)}}>
|
||||
<button class="btn btn-xs btn-purple" title="Move Up" {{action (route-action 'moveUp' it)}}>
|
||||
<i class="ace-icon fa fa-arrow-up bigger-120"></i>
|
||||
</button>
|
||||
{{/if}}
|
||||
{{#if (not-eq model.data.lastObject.id it.id)}}
|
||||
<button class="btn btn-xs" title="下移" {{action (route-action 'moveDown' it)}}>
|
||||
<button class="btn btn-xs" title="Move Down" {{action (route-action 'moveDown' it)}}>
|
||||
<i class="ace-icon fa fa-arrow-down bigger-120"></i>
|
||||
</button>
|
||||
{{/if}}
|
||||
@ -74,7 +74,7 @@
|
||||
</li>
|
||||
|
||||
<li>
|
||||
{{#link-to 'customer-status.edit' it.id class='tooltip-info' data-rel='tooltip' title='编辑'}}
|
||||
{{#link-to 'customer-status.edit' it.id class='tooltip-info' data-rel='tooltip' title='Edit'}}
|
||||
<span class="blue">
|
||||
<i class="ace-icon fa fa-pencil-square-o bigger-120"></i>
|
||||
</span>
|
||||
@ -83,12 +83,12 @@
|
||||
|
||||
<li>
|
||||
{{#if (not-eq model.data.firstObject.id it.id)}}
|
||||
<button class="tooltip-info" title="上移" {{action (route-action 'moveUp' it)}}>
|
||||
<button class="tooltip-info" title="Move Up" {{action (route-action 'moveUp' it)}}>
|
||||
<i class="ace-icon fa fa-arrow-up bigger-120"></i>
|
||||
</button>
|
||||
{{/if}}
|
||||
{{#if (not-eq model.data.lastObject.id it.id)}}
|
||||
<button class="tooltip-info" title="下移" {{action (route-action 'moveDown' it)}}>
|
||||
<button class="tooltip-info" title="Move Down" {{action (route-action 'moveDown' it)}}>
|
||||
<i class="ace-icon fa fa-arrow-down bigger-120"></i>
|
||||
</button>
|
||||
{{/if}}
|
||||
|
@ -1,11 +1,11 @@
|
||||
{{#form-content}}
|
||||
<hr />
|
||||
{{form-input type='file' name='ytdSales' label='客户销售CSV文件'}}
|
||||
{{form-input type='file' name='ytdSales' label='Customer Sales CSV'}}
|
||||
<hr />
|
||||
{{form-footer-buttons type='import'
|
||||
postUrl='customer-year-to-date-sale/import'
|
||||
backRouteName='customer.list'
|
||||
backRouteParams=1
|
||||
successMsg='导入成功'}}
|
||||
successMsg='Imported Successfully'}}
|
||||
{{/form-content}}
|
||||
{{outlet}}
|
@ -1,7 +1,7 @@
|
||||
{{#form-content}}
|
||||
<hr />
|
||||
{{form-input type='file' name='customers' label='客户CSV文件'}}
|
||||
{{form-input type='file' name='customers' label='Customers CSV'}}
|
||||
<hr />
|
||||
{{form-footer-buttons type='import' postUrl='customer/import' successMsg='导入成功'}}
|
||||
{{form-footer-buttons type='import' postUrl='customer/import' successMsg='Imported Successfully'}}
|
||||
{{/form-content}}
|
||||
{{outlet}}
|
@ -5,20 +5,20 @@
|
||||
<li>
|
||||
{{#link-to 'customer.import'}}
|
||||
<i class="ace-icon fa fa-address-card-o bigger-110"></i>
|
||||
导入客户
|
||||
Import Customers
|
||||
{{/link-to}}
|
||||
</li>
|
||||
<li>
|
||||
{{#link-to 'customer-ytd-sale.import'}}
|
||||
<i class="ace-icon fa fa-line-chart bigger-110"></i>
|
||||
导入销售数据
|
||||
Import Sales Data
|
||||
{{/link-to}}
|
||||
</li>
|
||||
{{/if}}
|
||||
<li>
|
||||
{{#link-to 'customer.list.advanced-query'}}
|
||||
<i class="ace-icon fa fa-database bigger-110"></i>
|
||||
高级查询
|
||||
Advanced Query
|
||||
{{/link-to}}
|
||||
</li>
|
||||
{{/grid-header}}
|
||||
@ -30,41 +30,41 @@
|
||||
<thead class="thin-border-bottom">
|
||||
<tr>
|
||||
{{#if tableOptions.showId}}
|
||||
{{sortable-th name='id' text='编号'}}
|
||||
{{sortable-th name='id' text='ID'}}
|
||||
{{/if}}
|
||||
{{#if tableOptions.showName}}
|
||||
<th>名称</th>
|
||||
<th>Name</th>
|
||||
{{/if}}
|
||||
{{#if tableOptions.showYear}}
|
||||
{{sortable-th name='year' text='年份'}}
|
||||
{{sortable-th name='year' text='Year'}}
|
||||
{{/if}}
|
||||
{{#if tableOptions.showYtdSale}}
|
||||
{{sortable-th name='ytdSale' text='年销售额'}}
|
||||
{{sortable-th name='ytdSale' text='YTD Sales'}}
|
||||
{{/if}}
|
||||
{{#if tableOptions.showCountryCode}}
|
||||
<th class="hidden-480">国家</th>
|
||||
<th class="hidden-480">Country</th>
|
||||
{{/if}}
|
||||
{{#if tableOptions.showState}}
|
||||
<th class="hidden-480">省份</th>
|
||||
<th class="hidden-480">State</th>
|
||||
{{/if}}
|
||||
{{#if tableOptions.showCity}}
|
||||
<th class="hidden-480">城市</th>
|
||||
<th class="hidden-480">City</th>
|
||||
{{/if}}
|
||||
{{#if tableOptions.showMs}}
|
||||
{{sortable-th name='ms' text='MS' class='hidden-480'}}
|
||||
{{/if}}
|
||||
{{#if tableOptions.showRegion}}
|
||||
{{sortable-th name='region' text='区域' class='hidden-480'}}
|
||||
{{sortable-th name='region' text='Region' class='hidden-480'}}
|
||||
{{/if}}
|
||||
{{#if tableOptions.showSalesperson}}
|
||||
{{sortable-th name='salesperson' text='销售'}}
|
||||
{{sortable-th name='salesperson' text='Salesperson'}}
|
||||
{{/if}}
|
||||
{{#if tableOptions.showStatus}}
|
||||
<th class="hidden-480">状态</th>
|
||||
<th class="hidden-480">Status</th>
|
||||
{{/if}}
|
||||
<th>
|
||||
<i class="ace-icon fa fa-cogs bigger-110 hidden-480"></i>
|
||||
管理
|
||||
Settings
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -91,7 +91,7 @@
|
||||
{{/if}}
|
||||
{{#if tableOptions.showYtdSale}}
|
||||
<td>
|
||||
{{number-us it.ytdSale}}
|
||||
{{number-us it.sumYtdSales}}
|
||||
</td>
|
||||
{{/if}}
|
||||
{{#if tableOptions.showCountryCode}}
|
||||
|
@ -1,10 +1,10 @@
|
||||
{{#modal-frame title='高级查询'}}
|
||||
{{#modal-frame title='Advanced Query'}}
|
||||
<div class="modal-body no-padding">
|
||||
<div class="widget-main row">
|
||||
<div class="col-xs-12 col-sm-5">
|
||||
<div class="widget-box">
|
||||
<div class="widget-header">
|
||||
<h5 class="widget-title">展示列</h5>
|
||||
<h5 class="widget-title">Show Columns</h5>
|
||||
</div>
|
||||
|
||||
<div class="widget-body">
|
||||
@ -12,22 +12,22 @@
|
||||
<div class="row">
|
||||
<div class="col-xs-5 col-sm-5">
|
||||
<div class="control-group">
|
||||
{{ace-checkbox label='编号' value=model.tableOptions.showId}}
|
||||
{{ace-checkbox label='名称' value=model.tableOptions.showName}}
|
||||
{{ace-checkbox label='年份' value=model.tableOptions.showYear}}
|
||||
{{ace-checkbox label='年销售额' value=model.tableOptions.showYtdSale}}
|
||||
{{ace-checkbox label='国家' value=model.tableOptions.showCountryCode}}
|
||||
{{ace-checkbox label='省份' value=model.tableOptions.showState}}
|
||||
{{ace-checkbox label='ID' value=model.tableOptions.showId}}
|
||||
{{ace-checkbox label='Name' value=model.tableOptions.showName}}
|
||||
{{ace-checkbox label='Year' value=model.tableOptions.showYear}}
|
||||
{{ace-checkbox label='YTD Sales' value=model.tableOptions.showYtdSale}}
|
||||
{{ace-checkbox label='Country' value=model.tableOptions.showCountryCode}}
|
||||
{{ace-checkbox label='State' value=model.tableOptions.showState}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-5 col-sm-5">
|
||||
<div class="control-group">
|
||||
{{ace-checkbox label='城市' value=model.tableOptions.showCity}}
|
||||
{{ace-checkbox label='City' value=model.tableOptions.showCity}}
|
||||
{{ace-checkbox label='MS' value=model.tableOptions.showMs}}
|
||||
{{ace-checkbox label='区域' value=model.tableOptions.showRegion}}
|
||||
{{ace-checkbox label='销售' value=model.tableOptions.showSalesperson}}
|
||||
{{ace-checkbox label='状态' value=model.tableOptions.showStatus}}
|
||||
{{ace-checkbox label='全部选择' value=model.tableOptions.showAll}}
|
||||
{{ace-checkbox label='Region' value=model.tableOptions.showRegion}}
|
||||
{{ace-checkbox label='Salesperson' value=model.tableOptions.showSalesperson}}
|
||||
{{ace-checkbox label='Status' value=model.tableOptions.showStatus}}
|
||||
{{ace-checkbox label='Select All' value=model.tableOptions.showAll}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -40,7 +40,7 @@
|
||||
<div class="control-group">
|
||||
<div class="widget-box">
|
||||
<div class="widget-header">
|
||||
<h5 class="widget-title">查询条件</h5>
|
||||
<h5 class="widget-title">Query Criteria</h5>
|
||||
<span class="widget-toolbar">
|
||||
<a href="#" {{action (route-action 'addCriterion')}}>
|
||||
<i class="green ace-icon fa fa-plus"></i>
|
||||
@ -71,11 +71,11 @@
|
||||
<div class="modal-footer no-margin-top">
|
||||
<button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">
|
||||
<i class="ace-icon fa fa-times"></i>
|
||||
取消
|
||||
Cancel
|
||||
</button>
|
||||
<button type="button" class="btn btn-sm btn-primary" {{action (route-action 'query')}}>
|
||||
<i class="ace-icon fa fa-check"></i>
|
||||
确定
|
||||
Query
|
||||
</button>
|
||||
</div>
|
||||
{{/modal-frame}}
|
||||
|
@ -1,18 +1,18 @@
|
||||
{{#form-content}}
|
||||
{{form-input type='show' name='id' label='客户编号'}}
|
||||
{{form-input type='show' name='name' label='客户名称'}}
|
||||
{{form-input type='show' name='countryCode' label='国家编号'}}
|
||||
{{form-input type='show' name='state' label='省份'}}
|
||||
{{form-input type='show' name='city' label='城市'}}
|
||||
{{form-input type='show' name='id' label='ID'}}
|
||||
{{form-input type='show' name='name' label='Name'}}
|
||||
{{form-input type='show' name='countryCode' label='Country'}}
|
||||
{{form-input type='show' name='state' label='State'}}
|
||||
{{form-input type='show' name='city' label='City'}}
|
||||
{{form-input type='show' name='ms' label='MS'}}
|
||||
{{form-input type='show' name='region' label='地区'}}
|
||||
{{form-input type='show' name='salesperson' label='销售'}}
|
||||
{{form-input type='show' name='region' label='Region'}}
|
||||
{{form-input type='show' name='salesperson' label='Salesperson'}}
|
||||
|
||||
{{form-input type='show' name='statusText' label='客户状态'}}
|
||||
{{form-input type='show' name='statusText' label='Status'}}
|
||||
|
||||
{{!form-input-enabled}}
|
||||
{{!form-input name='note' label='备注'}}
|
||||
{{#form-input label='注记'}}
|
||||
{{#form-input label='Issues'}}
|
||||
<div class="widget-box transparent">
|
||||
<div class="widget-header widget-header-small">
|
||||
<div class="widget-toolbar action-buttons">
|
||||
@ -31,7 +31,7 @@
|
||||
{{issue.editor.name}}
|
||||
</span>
|
||||
<span class="blue">
|
||||
更新了
|
||||
Updated
|
||||
</span>
|
||||
{{else}}
|
||||
<!-- <span class="user"> -->
|
||||
@ -39,7 +39,7 @@
|
||||
{{issue.creator.name}}
|
||||
</span>
|
||||
<span class="green">
|
||||
创建了
|
||||
Created
|
||||
</span>
|
||||
{{/if}}
|
||||
{{issue.issue}}
|
||||
@ -56,7 +56,7 @@
|
||||
</div>
|
||||
|
||||
<div class="tools action-buttons">
|
||||
{{#link-to 'customer-issue.edit' issue.id class="blue" title="编辑"}}
|
||||
{{#link-to 'customer-issue.edit' issue.id class="blue" title="Edit"}}
|
||||
<i class="ace-icon fa fa-pencil bigger-125"></i>
|
||||
{{/link-to}}
|
||||
</div>
|
||||
|
@ -1,21 +1,16 @@
|
||||
{{#form-content}}
|
||||
{{form-input name='account' label='账户'}}
|
||||
{{form-input name='employeeId' label='工号'}}
|
||||
{{form-input name='name' label='姓名'}}
|
||||
{{form-input name='enName' label='英文名'}}
|
||||
{{#form-input-select label='性别' name='gender' as |xs|}}
|
||||
{{#xs.option value='M'}}男{{/xs.option}}
|
||||
{{#xs.option value='F'}}女{{/xs.option}}
|
||||
{{/form-input-select}}
|
||||
{{form-input name='mobile' label='手机号'}}
|
||||
{{form-input name='email' label='邮箱'}}
|
||||
{{form-input name='employeeId' label='Employee ID'}}
|
||||
{{form-input name='account' label='Account'}}
|
||||
{{form-input name='name' label='Name(CN)'}}
|
||||
{{form-input name='enName' label='Name(EN)'}}
|
||||
{{form-input name='email' label='Email'}}
|
||||
|
||||
{{form-input type='password' name='password' label='登录密码'}}
|
||||
{{form-input type='password' name='confirmPassword' label='重复密码'}}
|
||||
{{form-input type='password' name='password' label='Password'}}
|
||||
{{form-input type='password' name='confirmPassword' label='Confirm Password'}}
|
||||
|
||||
{{form-input-checkbox label='管理员' name='admin'}}
|
||||
{{form-input-enabled}}
|
||||
{{form-input name='note' label='备注'}}
|
||||
{{form-input-checkbox label='Administrator' name='admin'}}
|
||||
{{form-input-enabled label='Status' enabledText='ACTIVE' disabledText='BLOCKED'}}
|
||||
{{form-input name='note' label='Remark'}}
|
||||
<hr />
|
||||
{{form-footer-buttons}}
|
||||
{{/form-content}}
|
||||
|
@ -1,22 +1,17 @@
|
||||
{{#form-content}}
|
||||
{{input type='hidden' name='id' value=model.id}}
|
||||
{{form-input name='account' label='账户'}}
|
||||
{{form-input name='employeeId' label='工号' readonly='readonly'}}
|
||||
{{form-input name='name' label='姓名'}}
|
||||
{{form-input name='enName' label='英文名'}}
|
||||
{{#form-input-select label='性别' name='gender' as |xs|}}
|
||||
{{#xs.option value='M'}}男{{/xs.option}}
|
||||
{{#xs.option value='F'}}女{{/xs.option}}
|
||||
{{/form-input-select}}
|
||||
{{form-input name='mobile' label='手机号'}}
|
||||
{{form-input name='email' label='邮箱'}}
|
||||
{{form-input name='employeeId' label='Employee ID' readonly='readonly'}}
|
||||
{{form-input name='account' label='Account'}}
|
||||
{{form-input name='name' label='Name(CN)'}}
|
||||
{{form-input name='enName' label='Name(EN)'}}
|
||||
{{form-input name='email' label='Email'}}
|
||||
|
||||
{{form-input type='password' name='password' label='登录密码'}}
|
||||
{{form-input type='password' name='confirmPassword' label='重复密码'}}
|
||||
{{form-input type='password' name='password' label='Password'}}
|
||||
{{form-input type='password' name='confirmPassword' label='Confirm Password'}}
|
||||
|
||||
{{form-input-checkbox label='管理员' name='admin'}}
|
||||
{{form-input-enabled}}
|
||||
{{form-input name='note' label='备注'}}
|
||||
{{form-input-checkbox label='Administrator' name='admin'}}
|
||||
{{form-input-enabled label='Status' enabledText='ACTIVE' disabledText='BLOCKED'}}
|
||||
{{form-input name='note' label='Remark'}}
|
||||
<hr />
|
||||
{{form-footer-buttons type='update'}}
|
||||
{{/form-content}}
|
||||
|
@ -3,7 +3,7 @@
|
||||
{{#grid-header}}
|
||||
<li>
|
||||
{{#link-to 'user.create'}}
|
||||
新建用户
|
||||
Create User
|
||||
{{/link-to}}
|
||||
</li>
|
||||
{{/grid-header}}
|
||||
@ -14,27 +14,26 @@
|
||||
<table class="table table-striped table-bordered table-hover dataTable">
|
||||
<thead class="thin-border-bottom">
|
||||
<tr>
|
||||
{{sortable-th name='employeeId' text='工号'}}
|
||||
{{sortable-th name='account' text='账户'}}
|
||||
{{sortable-th name='mobile' class="hidden-480" text='手机号'}}
|
||||
{{sortable-th name='employeeId' text='Employee ID'}}
|
||||
{{sortable-th name='account' text='Account'}}
|
||||
<th>
|
||||
姓名
|
||||
Name
|
||||
</th>
|
||||
{{sortable-th name='enName' text='英文名'}}
|
||||
{{sortable-th name='enName' text='Name(EN)'}}
|
||||
<th>
|
||||
管理员
|
||||
Admin
|
||||
</th>
|
||||
<th class="hidden-480 sorting_desc">
|
||||
<th class="hidden-480">
|
||||
<i class="ace-icon fa fa-sticky-note-o bigger-110 hidden-480"></i>
|
||||
备注
|
||||
Remark
|
||||
</th>
|
||||
<th>
|
||||
<i class="ace-icon fa fa-exchange bigger-110 hidden-480"></i>
|
||||
状态
|
||||
Status
|
||||
</th>
|
||||
<th>
|
||||
<i class="ace-icon fa fa-cogs bigger-110 hidden-480"></i>
|
||||
管理
|
||||
Settings
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -48,9 +47,6 @@
|
||||
<td>
|
||||
{{it.account}}
|
||||
</td>
|
||||
<td class="hidden-480">
|
||||
{{it.mobile}}
|
||||
</td>
|
||||
<td>
|
||||
{{it.name}}
|
||||
</td>
|
||||
@ -58,18 +54,18 @@
|
||||
{{it.enName}}
|
||||
</td>
|
||||
<td>
|
||||
{{status-cell model=it field='admin' enabledText='是' disabledText='否'}}
|
||||
{{status-cell model=it field='admin' enabledText='YES' disabledText='NO'}}
|
||||
</td>
|
||||
<td class="hidden-480">
|
||||
{{editable-cell model=it field='note'}}
|
||||
</td>
|
||||
<td>
|
||||
{{status-cell model=it}}
|
||||
{{status-cell model=it field='enabled' enabledText='ACTIVE' disabledText='BLOCKED'}}
|
||||
</td>
|
||||
<td>
|
||||
<div class="hidden-sm hidden-xs btn-group">
|
||||
{{status-toggle-button model=it}}
|
||||
{{#link-to 'user.edit' it.id class='btn btn-xs btn-info' title='编辑'}}
|
||||
{{#link-to 'user.edit' it.id class='btn btn-xs btn-info' title='Edit User'}}
|
||||
<i class="ace-icon fa fa-pencil bigger-120"></i>
|
||||
{{/link-to}}
|
||||
</div>
|
||||
@ -86,7 +82,7 @@
|
||||
</li>
|
||||
|
||||
<li>
|
||||
{{#link-to 'user.edit' it.id class='tooltip-info' data-rel='tooltip' title='编辑'}}
|
||||
{{#link-to 'user.edit' it.id class='tooltip-info' data-rel='tooltip' title='Edit User'}}
|
||||
<span class="blue">
|
||||
<i class="ace-icon fa fa-pencil-square-o bigger-120"></i>
|
||||
</span>
|
||||
|
Loading…
x
Reference in New Issue
Block a user