This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-09-20 20:53:32 +08:00
parent b4cd6f2b41
commit d34aded053
18 changed files with 54 additions and 40 deletions

View File

@ -103,6 +103,9 @@ func (s Value) Create(m *ice.Message, arg ...string) {
func (s Value) Modify(m *ice.Message, arg ...string) {
s.ValueModify(m, s.transPrice(m, arg...)...)
}
func (s Value) List(m *ice.Message, arg ...string) {
s.ValueList(m, arg).PushAction(s.Modify, s.Remove)
}
func (s Value) transPrice(m *ice.Message, arg ...string) []string {
for i := 0; i < len(arg); i += 2 {
switch arg[i] {

View File

@ -2,9 +2,11 @@ Volcanos(chat.ONIMPORT, {
_init: function(can, msg) {
can.onimport.myView(can, msg, function(value) { return [
{view: html.TITLE, list: [value.user_name]},
{view: html.STATUS, list: [value.uid.slice(0, 6), can.onimport.timeView(can, value), can.onimport.textView(can, value)]},
{view: html.STATUS, list: [can.onimport.timeView(can, value), can.onimport.textView(can, value)]},
{view: html.STATUS, list: ["订单"+":", value.order_uid.slice(0, 6),
can.onimport.unitView(can, value, "amount", "元"), can.onimport.unitView(can, value, "total", "个"),
]},
{view: html.STATUS, list: [value.company_name+":", value.open_id]},
{view: html.STATUS, list: ["订单:", value.order_uid.slice(0, 6), "金额:", value.amount||"0", "数量:", value.total||"0"]},
] })
},
})

View File

@ -19,8 +19,11 @@ func (s goods) Create(m *ice.Message, arg ...string) {
func (s goods) List(m *ice.Message, arg ...string) {
s.Product.List(m.Options(model.PRODUCT_TYPE, kit.Format(ProductGoods)), arg...)
kit.If(s.IsBoss(m), func() {
m.PushAction(s.MarketInsert, s.SetShop, s.SetBrand, s.SetQuality, s.Modify, s.Remove).Action(s.Create)
s.Button(m, "")
m.PushAction(s.MarketInsert, s.SetShop, s.SetBrand, s.SetQuality, s.Modify, s.Remove)
if len(arg) == 1 {
m.Action(s.Create)
s.Button(m, "")
}
})
}

View File

@ -7,7 +7,6 @@ const (
NAME = "name"
INFO = "info"
TYPE = "type"
ROLE = "role"
STATUS = "status"
TITLE = "title"
CONTENT = "content"

View File

@ -390,14 +390,6 @@ func (s Order) ConfirmRefund(m *ice.Message, arg ...string) {
})
s.sendTemplate(m, model.FROM_USER_UID, m.Trans("order confirm refund", "订单已确认退款"))
}
func (s Order) CheckRole(m *ice.Message, arg ...string) {
role := UserStoreRole(kit.Int(m.Cmd(userStore{}, s.Select, m.OptionSimple(model.STORE_UID, model.USER_UID)).Append(model.ROLE)))
if m.WarnNotRight(!kit.IsIn(role.String(), append(kit.Split(kit.JoinWord(arg...)), UserStoreCreator.String())...)) || m.Option(model.UID) == "" {
return
}
msg := s.Select(m, "(from_store_uid = ? OR to_store_uid = ?) AND uid = ?", m.Option(model.STORE_UID), m.Option(model.STORE_UID), m.Option(model.UID))
m.WarnNotValid(OrderStatus(kit.Int(msg.Append(model.STATUS))) != OrderCreate)
}
func init() { ice.TeamCtxCmd(Order{}) }

View File

@ -3,11 +3,11 @@ Volcanos(chat.ONIMPORT, {
can.onimport.myView(can, msg, function(value) { return [
{view: html.TITLE, list: [value.name||value.user_name||"待确认", can.onimport.textView(can, value, "order_type")]},
{view: html.STATUS, list: [value.uid.slice(0, 6), can.onimport.timeView(can, value), can.onimport.textView(can, value)]},
{view: html.STATUS, list: ["数量:", value.total, "件", "总额:", value.amount, "元"]},
value.payment_success_time && {view: html.STATUS, list: ["收款时间:", can.base.TimeTrim(value.payment_success_time)]},
value.express_recv_time && {view: html.STATUS, list: ["收货时间:", can.base.TimeTrim(value.express_recv_time)]},
value.return_recv_time && {view: html.STATUS, list: ["退货时间:", can.base.TimeTrim(value.return_recv_time)]},
value.refund_success_time && {view: html.STATUS, list: ["退款时间:", can.base.TimeTrim(value.refund_success_time)]},
{view: html.STATUS, list: [can.onimport.unitView(can, value, "amount", "元"), can.onimport.unitView(can, value, "total", "件")]},
value.payment_success_time && {view: html.STATUS, list: [can.onimport.timeView(can, value, "payment_success_time")]},
value.express_recv_time && {view: html.STATUS, list: [can.onimport.timeView(can, value, "express_recv_time")]},
value.return_recv_time && {view: html.STATUS, list: [can.onimport.timeView(can, value, "return_recv_time")]},
value.refund_success_time && {view: html.STATUS, list: [can.onimport.timeView(can, value, "refund_success_time")]},
value.info && {view: html.OUTPUT, list: [value.info]},
] })
},

View File

@ -2,7 +2,7 @@ Volcanos(chat.ONIMPORT, {
_init: function(can, msg) {
can.onimport.myView(can, msg, function(value) { return [
{view: html.TITLE, list: [value.name, can.onimport.textView(can, value, "product_type")]},
{view: html.STATUS, list: ["单价: ", value.price, " 元", "数量: ", value.count, " ", value.unit]},
{view: html.STATUS, list: [can.onimport.unitView(can, value, "price", "元"), can.onimport.unitView(can, value, "count", value.unit)]},
{view: html.OUTPUT, list: [value.info]},
] }, function(event) {})
},

View File

@ -2,9 +2,11 @@ Volcanos(chat.ONIMPORT, {
_init: function(can, msg) {
can.onimport.myView(can, msg, function(value) { return [
{view: html.TITLE, list: [value.user_name]},
{view: html.STATUS, list: [value.uid.slice(0, 6), can.onimport.timeView(can, value), can.onimport.textView(can, value)]},
{view: html.STATUS, list: [can.onimport.timeView(can, value), can.onimport.textView(can, value)]},
{view: html.STATUS, list: ["订单"+":", value.order_uid.slice(0, 6),
can.onimport.unitView(can, value, "amount", "元"), can.onimport.unitView(can, value, "total", "个"),
]},
{view: html.STATUS, list: [value.company_name+":", value.open_id]},
{view: html.STATUS, list: ["订单:", value.order_uid.slice(0, 6), "金额:", value.amount||"0", "数量:", value.total||"0"]},
] })
},
})

View File

@ -18,10 +18,10 @@ type Portal struct {
func (s Portal) AfterPlaceAuth(m *ice.Message, arg ...string) {
defer s.DashboardCreate(m, "")()
s.DashboardInsert(m, "1", "订单总额", s.order, "SUM(amount) / 100.0", model.FROM_STORE_UID, m.Option(model.STORE_UID), model.STATUS, kit.Format(OrderDeal))
s.DashboardInsert(m, "2", "订单数量", s.order, "", model.FROM_STORE_UID, m.Option(model.STORE_UID), model.STATUS, kit.Format(OrderDeal))
s.DashboardInsert(m, "3", "库存数量", s.product, "SUM(stock)")
s.DashboardInsert(m, "4", "库存总额", s.product, "SUM(stock * price) / 100.0")
s.DashboardInsert(m, "1", "订单总额", "money", s.order, "SUM(amount) / 100.0", model.FROM_STORE_UID, m.Option(model.STORE_UID), model.STATUS, kit.Format(OrderDeal))
s.DashboardInsert(m, "2", "订单数量", "order", s.order, "", model.FROM_STORE_UID, m.Option(model.STORE_UID), model.STATUS, kit.Format(OrderDeal))
s.DashboardInsert(m, "3", "库存数量", "stock", s.product, "SUM(stock)")
s.DashboardInsert(m, "4", "库存总额", "money", s.product, "SUM(stock * price) / 100.0")
}
func init() { gonganxitong.PortalCmd(Portal{Portal: guanlixitong.NewPortal(userStore{}, store{})}) }

View File

@ -15,6 +15,9 @@
"confirmRefund": "确认收到退款",
"setShop": "店铺", "setWarehouse": "仓库", "setQuality": "质检", "setBrand": "贴牌",
"style": {
"again": "notice",
"produce": "notice",
"confirmProduce": "notice",
"return": "danger"
},
"icons": {
@ -46,13 +49,19 @@
"shop_name": "店铺名称",
"warehouse_uid": "仓库",
"warehouse_name": "仓库名称",
"quality_uid": "质检",
"quality_name": "质检名称",
"brand_uid": "品牌",
"brand_name": "品牌名称",
"product_uid": "产品",
"product_type": "产品类型",
"order_type": "订单类型",
"from_store_uid":"出货店铺",
"to_store_uid": "收货店铺",
"payment_success_time": "付款时间",
"express_recv_time": "收货时间",
"return_recv_time": "退货时间",
"refund_success_time": "退款时间",
"payment_status": "付款状态",
"express_status": "快递状态",
"return_status": "退货状态",

View File

@ -17,10 +17,10 @@ type Product struct {
create string `name:"create product_type*:select name* info price stock unit" role:"boss"`
modify string `name:"modify name* info price stock unit" role:"boss"`
remove string `name:"remove" role:"boss"`
setShop string `name:"setShop shop_uid*" role:"boss"`
setWarehouse string `name:"setWarehouse warehouse_uid*" role:"boss"`
setQuality string `name:"setQuality quality_uid*" role:"boss"`
setBrand string `name:"setBrand brand_uid*" role:"boss"`
setShop string `name:"setShop shop_uid*:select" role:"boss"`
setWarehouse string `name:"setWarehouse warehouse_uid*:select" role:"boss"`
setQuality string `name:"setQuality quality_uid*:select" role:"boss"`
setBrand string `name:"setBrand brand_uid*:select" role:"boss"`
}
func (s Product) Create(m *ice.Message, arg ...string) {

View File

@ -2,7 +2,10 @@ Volcanos(chat.ONIMPORT, {
_init: function(can, msg) {
can.onimport.myView(can, msg, function(value) { return [
{view: html.TITLE, list: [value.name, can.onimport.textView(can, value, "product_type")]},
{view: html.STATUS, list: ["单价:", value.price, "元", "库存:", value.stock, value.unit, value.shop_name||"", value.warehouse_name||""]},
{view: html.STATUS, list: [
can.onimport.unitView(can, value, "price", "元"), can.onimport.unitView(can, value, "stock", value.unit),
can.onimport.unitView(can, value, "shop_name"), can.onimport.unitView(can, value, "warehouse_name"),
]},
{view: html.OUTPUT, list: [value.info]},
] })
},

View File

@ -2,9 +2,11 @@ Volcanos(chat.ONIMPORT, {
_init: function(can, msg) {
can.onimport.myView(can, msg, function(value) { return [
{view: html.TITLE, list: [value.user_name]},
{view: html.STATUS, list: [value.uid.slice(0, 6), can.onimport.timeView(can, value), can.onimport.textView(can, value)]},
{view: html.STATUS, list: [can.onimport.timeView(can, value), can.onimport.textView(can, value)]},
{view: html.STATUS, list: ["订单"+":", value.order_uid.slice(0, 6),
can.onimport.unitView(can, value, "amount", "元"), can.onimport.unitView(can, value, "total", "个"),
]},
{view: html.STATUS, list: [value.company_name+":", value.open_id]},
{view: html.STATUS, list: ["订单:", value.order_uid.slice(0, 6), "金额:", value.amount||"0", "数量:", value.total||"0"]},
] })
},
})

View File

@ -2,9 +2,11 @@ Volcanos(chat.ONIMPORT, {
_init: function(can, msg) {
can.onimport.myView(can, msg, function(value) { return [
{view: html.TITLE, list: [value.user_name]},
{view: html.STATUS, list: [value.uid.slice(0, 6), can.onimport.timeView(can, value), can.onimport.textView(can, value)]},
{view: html.STATUS, list: [can.onimport.timeView(can, value), can.onimport.textView(can, value)]},
{view: html.STATUS, list: ["订单"+":", value.order_uid.slice(0, 6),
can.onimport.unitView(can, value, "amount", "元"), can.onimport.unitView(can, value, "total", "个"),
]},
{view: html.STATUS, list: [value.company_name+":", value.open_id]},
{view: html.STATUS, list: ["订单:", value.order_uid.slice(0, 6), "金额:", value.amount||"0", "数量:", value.total||"0"]},
] })
},
})

View File

@ -44,13 +44,13 @@ func (s Table) RewriteAppend(m *ice.Message, arg ...string) *ice.Message {
})
return s.Table.RewriteAppend(m)
}
func (s Table) SelectJoinCompany(m *ice.Message) *ice.Message {
return s.SelectJoin(m, company{}, model.NAME, model.CITY_UID)
func (s Table) SelectJoinCompany(m *ice.Message) {
s.SelectJoin(m, company{}, model.NAME, model.CITY_UID)
s.SelectJoinCity(m)
}
func (s Table) CheckRole(m *ice.Message, arg ...string) {
role := UserGroupRole(s.UserPlaceRole(m))
m.WarnNotRight(!kit.IsIn(role.String(), append(arg, UserGroupCreator.String())...), role.String())
m.Option(model.USER_ROLE, kit.Format(role))
}
type Tables struct{ Table }

View File

@ -6,7 +6,6 @@ const (
UID = "uid"
NAME = "name"
TYPE = "type"
ROLE = "role"
TITLE = "title"
CONTENT = "content"
USER_UID = "user_uid"

View File

@ -6,7 +6,6 @@ const (
UID = "uid"
NAME = "name"
TYPE = "type"
ROLE = "role"
TITLE = "title"
CONTENT = "content"
USER_UID = "user_uid"

View File

@ -6,7 +6,6 @@ const (
UID = "uid"
NAME = "name"
TYPE = "type"
ROLE = "role"
TITLE = "title"
CONTENT = "content"
USER_UID = "user_uid"