Browse Source

2312

master
lc18518571399 9 months ago
parent
commit
2476fb76ba
  1. 220
      api/app/model/chanpin.js
  2. 23
      api/app/model/dingdan.js
  3. 4
      api/app/model/user.js
  4. 29
      api/app/service/dingdan.js
  5. 8
      api/package.json
  6. 4
      front/src/main/index.js
  7. 7
      front/src/renderer/src/assets/css/base.css
  8. 1
      front/src/renderer/src/components/dingdanformcomponent.vue
  9. 16
      front/src/renderer/src/components/dingdantablecomponent.vue
  10. 1
      front/src/renderer/src/components/formcomponent.vue
  11. 8
      front/src/renderer/src/components/tablecomponent.vue
  12. 58
      front/src/renderer/src/views/dingdan.vue
  13. 4
      start.bat
  14. BIN
      模版/S6直营销售单导入模板.xls
  15. BIN
      模版/产品信息(模板).xls
  16. BIN
      模版/客户编码文档(1).xls
  17. BIN
      模版/销售订单导入准备表(1).xlsx

220
api/app/model/chanpin.js

@ -51,7 +51,8 @@ module.exports = app => {
// 箱装量
xiangzhuangliang: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 箱装单位
xiangzhuangdanwei: {
@ -61,7 +62,8 @@ module.exports = app => {
// 最大单位箱装量
zuidadanweixiangzhuangliang: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 最大箱装单位
zuidaxiangzhuangdanwei: {
@ -91,82 +93,98 @@ module.exports = app => {
// 最高采购价
zuigaocaigoujia: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 商超价1
shangchaojia1: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 现金价
xianjinjia: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 二批流通价
erpiliutongjia: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 商超价
shangchaojia: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 现金零售价
xianjinlingshoujia: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 商超零售价
shangchaolingshoujia: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 特通价
tetongjia: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 分公司价
fengongsijia: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 零食店价
shangchaolingshoujia: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 初中高中价
chuzhonggaozhongjia: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 车销价
chexiaojia: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 发货价11
shangchaolingshoujia: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 发货价12
fahuojia12: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 进货税率%
jinhuoshuilv: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 发货税率%
fahuoshuilv: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 包装
baozhuang: {
@ -176,7 +194,8 @@ module.exports = app => {
// 毛利率
maolilv: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 主存放仓库
zhucunfangcangku: {
@ -191,7 +210,8 @@ module.exports = app => {
// 保质期(天)
baozhiqi: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 有效?
youxiao: {
@ -216,7 +236,8 @@ module.exports = app => {
// 单位重量
danweizhongliang: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(4)) }
},
// 品牌
pinpai: {
@ -226,27 +247,32 @@ module.exports = app => {
// 单位体积(立方米)
danweitiji: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(4)) }
},
// 箱重量(kg)
xiangzhongliang: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(4)) }
},
// 最大单位重量(kg)
zuidadanweizhongliang: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(4)) }
},
// 箱体积(立方米)
xiangtiji: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(4)) }
},
// 最大单位体积(立方米)
zuidadanweitiji: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(4)) }
},
// 描述
miaoshu: {
@ -271,22 +297,26 @@ module.exports = app => {
// 标准核算价
biaozhunhesuanjia: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 建议零售价
jianyilingshoujia: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 最近一次采购价
zuijinyicicaigoujia: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 最近一次销售价
zuijinyicixiaoshoujia: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 箱条形码
xiangtiaoxingma: {
@ -318,22 +348,26 @@ module.exports = app => {
// 发货产品基数
fahuochanpinjishu: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 采购最少数量
caigouzuishaoshuliang: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 采购倍数
caigoubeishu: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 采购滚动基数
caigougundongjishu: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 最小单位产品
zuixiaodanweichanpin: {
@ -343,7 +377,8 @@ module.exports = app => {
// 最小单位倍数
zuixiaodanweibeishu: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 产品归类
chanpinguilei: {
@ -358,142 +393,170 @@ module.exports = app => {
// 箱单位最高采购价
xiangdanweizuigaocaigoujia: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 箱单位商超价1
xiangdanweishangchaojia1: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 箱单位现金价
xiangdanweixianjinjia: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 箱单位二批流通价
xiangdanweierpiliutongjia: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 箱单位商超价
xiangdanweishangchaojia: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 箱单位现金零售价
xiangdanweixianjinlingshoujia: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 箱单位商超零售价
xiangdanweishangchaolingshoujia: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 箱单位特通价
xiangdanweitetongjia: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 箱单位分公司价
xiangdanweifengongsijia: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 箱单位零食店价
xiangdanweilingshidianjia: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 箱单位初中高中价
xiangdanweichuzhonggaozhongjia: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 箱单位车销价
xiangdanweichexiaojia: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 箱单位发货价11
xiangdanweifahuojia11: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 箱单位发货价12
xiangdanweifahuojia12: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 最大单位最高采购价
zuidadanweizuigaocaigoujia: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 最大单位商超价1
zuidadanweishangchaojia1: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 最大单位现金价
zuidadanweixianjinjia: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 最大单位二批流通价
zuidadanweierpiliutongjia: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 最大单位商超价
zuidadanweishangchaojia: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 最大单位现金零售价
zuidadanweixianjinlingshoujia: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 最大单位商超零售价
zuidadanweishangchaolingshoujia: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 最大单位特通价
zuidadanweitetongjia: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 最大单位分公司价
zuidadanweifengongsijia: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 最大单位零食店价
zuidadanweilingshidianjia: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 最大单位初中高中价
zuidadanweichuzhonggaozhongjia: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 最大单位车销价
zuidadanweichexiaojia: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 最大单位发货价11
zuidadanweifahuojia11: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 最大单位发货价12
zuidadanweifahuojia12: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 默认单据单位
morendanjudanwei: {
@ -523,7 +586,7 @@ module.exports = app => {
// 建档日期
jiandangriqi: {
type: Date,
default: Date.now
default: ""
},
// 出货是否加工
chuhuoshifujiagong: {
@ -533,27 +596,31 @@ module.exports = app => {
// 保质期天数需大于
baozhiqitianshuxudayu: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 单品重量误差
danpinzhongliangwucha: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 最大单品重量误差百分比%
zuidadanpinzhongliangwuchabaifenbi: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 最大箱重量误差
zuidaxiangzhongliangwucha: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 价格调整时间
jiagediaozhengshijian: {
type: Date,
default: Date.now
default: ""
},
// 录入人
lururen: {
@ -563,7 +630,8 @@ module.exports = app => {
// 允收天数
yunshoutianshu: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 强制序列号管理
qiangzhixuliehaoguanli: {
@ -578,22 +646,26 @@ module.exports = app => {
// 长(cm)
chang: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(4)) }
},
// 宽(cm)
kuan: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(4)) }
},
// 高(cm)
gao: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(4)) }
},
// 每托盘件数
meituopanjianshu: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
//数据是否删除
isExit: {

23
api/app/model/dingdan.js

@ -48,7 +48,8 @@ module.exports = app => {
// 单据单位数量
danjudanweishuliang: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 条码
tiaoma: {
@ -63,22 +64,26 @@ module.exports = app => {
// 修改后销售数量
xiugaihouxiaoshoushuliang: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 最高采购价
zuigaocaigoujia: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 箱装量
xiangzhuangliang: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 最大箱装量
zuidaxiangzhuangliang: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 规格型号
guigexinghao: {
@ -128,14 +133,16 @@ module.exports = app => {
// 销售数量
xiaoshoushuliang: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 销售金额
xiaoshoujine: {
type: Number,
default: 0
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
//是否售卖
//是否售卖
isNotSale: {
type: Boolean,
default: true,

4
api/app/model/user.js

@ -19,8 +19,8 @@ module.exports = app => {
},
// 客户编号
usercode: {
type: Number,
default: 0,
type: String,
default: "",
index: true,
unique: true
},

29
api/app/service/dingdan.js

@ -29,14 +29,15 @@ class DingdanService extends Service {
returnData.hasError = false
returnData.msg = "数据删除成功"
} else if (subType === "edit") {
paramsLocal = paramsLocal.list[0]
paramsLocal["update_at"] = Date.now();
let chanpinItemA = await chanpinModel.find({ tiaoxingma: paramsLocal.tiaoma })
let chanpinItemB = await chanpinModel.find({ xiangtiaoxingma: paramsLocal.tiaoma })
let chanpinItemC = await chanpinModel.find({ zuidaxiangzhuangtiaoma: paramsLocal.tiaoma })
let list = await this.dealList(paramsLocal.list)
let updateItem = list[0]
updateItem["update_at"] = Date.now();
let chanpinItemA = await chanpinModel.find({ tiaoxingma: updateItem.tiaoma })
let chanpinItemB = await chanpinModel.find({ xiangtiaoxingma: updateItem.tiaoma })
let chanpinItemC = await chanpinModel.find({ zuidaxiangzhuangtiaoma: updateItem.tiaoma })
if (chanpinItemA.length || chanpinItemB.length || chanpinItemC.length) {
paramsLocal = { ...paramsLocal, isNotSale: false }
let res = await modelLocal.updateOne({ _id: paramsLocal._id }, paramsLocal)
updateItem = { ...updateItem, isNotSale: false }
let res = await modelLocal.updateOne({ _id: updateItem._id }, updateItem)
returnData.hasError = false
returnData.msg = "数据更新成功"
} else {
@ -76,7 +77,9 @@ class DingdanService extends Service {
async dealList(list) {
let { ctx } = this
let listLocal = []
let listCopy = _.cloneDeep(list)
let modelLocal = ctx.model.Dingdan
let allList = await modelLocal.find({ isExit: 1 })
let listCopy = _.concat(list, allList)
let pinmingGroup = _.groupBy(listCopy, o => o.tiaoma)
let pinmingOptionObj = {}
for (let key in pinmingGroup) {
@ -89,7 +92,7 @@ class DingdanService extends Service {
pinmingOptionItem["value"] = element.pinming
pinmingxuxnaing.push(pinmingOptionItem)
}
pinmingOptionObj[key] = pinmingxuxnaing
pinmingOptionObj[key] = _.unionBy(pinmingxuxnaing, "value")
}
let userModel = ctx.model.User
let chanpinModel = ctx.model.Chanpin
@ -125,7 +128,7 @@ class DingdanService extends Service {
item["xiugaihouxiaoshoushuliang"] = item.xiaoshoushuliang
}
item["xiaoshoujine"] = item.xiaoshoujine
item["zuigaocaigoujia"] = _.get(chanpinItemA, [0, "zuigaocaigoujia"], "")
item["zuigaocaigoujia"] = _.get(chanpinItemA, [0, "zuigaocaigoujia"], 0)
item["xiangzhuangliang"] = _.get(chanpinItemA, [0, "xiangzhuangliang"], "")
item["zuidaxiangzhuangliang"] = _.get(chanpinItemA, [0, "zuidadanweixiangzhuangliang"], "")
item["guigexinghao"] = _.get(chanpinItemA, [0, "guigexinghao"], "")
@ -142,7 +145,7 @@ class DingdanService extends Service {
let jishu = Number(guigexinghaoArr[1])
item["xiugaihouxiaoshoushuliang"] = item.xiaoshoushuliang * jishu
item["xiaoshoujine"] = item.xiaoshoujine
item["zuigaocaigoujia"] = _.get(chanpinItemB, [0, "zuigaocaigoujia"], "")
item["zuigaocaigoujia"] = _.get(chanpinItemB, [0, "zuigaocaigoujia"], 0)
item["xiangzhuangliang"] = _.get(chanpinItemB, [0, "xiangzhuangliang"], "")
item["zuidaxiangzhuangliang"] = _.get(chanpinItemB, [0, "zuidadanweixiangzhuangliang"], "")
item["guigexinghao"] = _.get(chanpinItemB, [0, "guigexinghao"], "")
@ -159,7 +162,7 @@ class DingdanService extends Service {
let jishu = Number(guigexinghaoArr[1])
item["xiugaihouxiaoshoushuliang"] = item.xiaoshoushuliang * jishu * Number((_.get(chanpinItemC, [0, "xiangzhuangliang"], 1) || 1))
item["xiaoshoujine"] = item.xiaoshoujine
item["zuigaocaigoujia"] = _.get(chanpinItemC, [0, "zuigaocaigoujia"], "")
item["zuigaocaigoujia"] = _.get(chanpinItemC, [0, "zuigaocaigoujia"], 0)
item["xiangzhuangliang"] = _.get(chanpinItemC, [0, "xiangzhuangliang"], "")
item["zuidaxiangzhuangliang"] = _.get(chanpinItemC, [0, "zuidadanweixiangzhuangliang"], "")
item["guigexinghao"] = _.get(chanpinItemC, [0, "guigexinghao"], "")
@ -173,7 +176,7 @@ class DingdanService extends Service {
item["xiaoshoushuliang"] = item.xiaoshoushuliang
item["xiugaihouxiaoshoushuliang"] = item.xiaoshoushuliang
item["xiaoshoujine"] = item.xiaoshoujine
item["zuigaocaigoujia"] = ""
item["zuigaocaigoujia"] = 0
item["xiangzhuangliang"] = ""
item["zuidaxiangzhuangliang"] = ""
item["guigexinghao"] = ""

8
api/package.json

@ -25,11 +25,7 @@
"start": "egg-scripts start --daemon --title=egg-server-back",
"stop": "egg-scripts stop --title=egg-server-back",
"dev": "egg-bin dev",
"test": "npm run lint -- --fix && npm run test:local",
"test:local": "egg-bin test",
"cov": "egg-bin cov",
"lint": "eslint .",
"ci": "npm run lint && npm run cov"
"build": "npm install --production && tar -zcvf ../release.tgz ."
},
"repository": {
"type": "git",
@ -37,4 +33,4 @@
},
"author": "lichong",
"license": "MIT"
}
}

4
front/src/main/index.js

@ -10,8 +10,8 @@ function createWindow() {
mainWindow = new BrowserWindow({
// fullscreen: true,
// fullscreenable: true,
width: 960,
height: 540,
width: 1280,
height: 800,
// width:1080,
// height:1920,
show: false,

7
front/src/renderer/src/assets/css/base.css

@ -8,13 +8,18 @@ body {
padding: 0 !important;
}
.el-table .isNotSale {
.el-table .blueRow {
background-color: #a0cfff;
}
.el-table .redRow {
background-color: #fab6b6;
}
.el-table .yellowRow {
background-color: #f3d19e;
}
.el-table .lightYellowRow {
background-color: #faecd8;
}

1
front/src/renderer/src/components/dingdanformcomponent.vue

@ -27,7 +27,6 @@
</template>
<template v-else-if="formItem.type === 'date'">
<el-date-picker v-model="formData[formItem.prop]" type="date" :placeholder="`请选择${formItem.label}`" />
<el-input />
</template>
</el-form-item>
</el-form>

16
front/src/renderer/src/components/dingdantablecomponent.vue

@ -5,6 +5,9 @@
<el-table-column type="selection" width="38" :reserve-selection="true" fixed="left">
</el-table-column>
<el-table-column type="index" width="38" :reserve-selection="true" fixed="left" label="序号">
<template #default="scope">
<span>{{ pageSize * (currentPage - 1) + scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column v-for="(headerItem, headerIndex) in tableHeader" :label="headerItem.label" show-overflow-tooltip
:key="headerIndex" :min-width="`${headerItem.label.length * 15 + 8}px`">
@ -109,17 +112,20 @@ export default {
},
//
getRowClassName({ row }) {
let rowClassName = ""
if (row.isNotSale) {
return 'isNotSale'
rowClassName = "blueRow"
}
if (row.xiaoshoujine < row.zuigaocaigoujia) {
return 'redRow'
rowClassName = "redRow"
}
if ((row.pinmingxuanxiang || []).length > 1) {
return 'yellowRow'
rowClassName = "yellowRow"
}
return ''
if (dayjs(row.update_at.slice(0, 19)).valueOf() > dayjs(row.create_at.slice(0, 19)).valueOf()) {
rowClassName = "lightYellowRow"
}
return rowClassName
},
},

1
front/src/renderer/src/components/formcomponent.vue

@ -21,7 +21,6 @@
</template>
<template v-else-if="formItem.type === 'date'">
<el-date-picker v-model="formData[formItem.prop]" type="date" :placeholder="`请选择${formItem.label}`" />
<el-input />
</template>
</el-form-item>
</el-form>

8
front/src/renderer/src/components/tablecomponent.vue

@ -1,12 +1,16 @@
<template>
<div class="tableClass">
<el-table :data="tableData" height="calc(100vh - 84px)" border @select="selectChange" @select-all="selectChange" fit :row-key="getRowKeys">
<el-table :data="tableData" height="calc(100vh - 84px)" border @select="selectChange" @select-all="selectChange" fit
:row-key="getRowKeys">
<el-table-column type="selection" width="38" :reserve-selection="true" fixed="left">
</el-table-column>
<el-table-column type="index" width="38" :reserve-selection="true" fixed="left" label="序号">
<template #default="scope">
<span>{{ pageSize * (currentPage - 1) + scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column v-for="(headerItem, headerIndex) in tableHeader" :label="headerItem.label" show-overflow-tooltip
:key="headerIndex" :min-width="`${headerItem.label.length*15+8}px`">
:key="headerIndex" :min-width="`${headerItem.label.length * 15 + 8}px`">
<template #default="scope">
<template v-if="headerItem.type === 'text'">
<span>{{ scope.row[headerItem.prop] }}</span>

58
front/src/renderer/src/views/dingdan.vue

@ -1,12 +1,12 @@
<template>
<div class="rightClass">
<div style="margin:0 0 8px 0">
<!-- <el-button type="primary" @click="addData">
<el-button type="primary" @click="addData">
<el-icon>
<Plus />
</el-icon>
<span>新增</span>
</el-button> -->
</el-button>
<el-button type="danger" @click="deleteData(selectionData)" :disabled="selectionData.length == 0">
<el-icon>
<Delete />
@ -30,6 +30,15 @@
</el-icon>
<span>刷新</span>
</el-button>
<el-button type="primary" @click="clickColor('blue')" color="#a0cfff">
<span>蓝色</span>
</el-button>
<el-button type="primary" @click="clickColor('red')" color="#fab6b6">
<span>红色</span>
</el-button>
<el-button type="primary" @click="clickColor('yellow')" color="#f3d19e">
<span>黄色</span>
</el-button>
<el-button type="primary" @click="exportxiaoshoudata">
<el-icon>
<Download />
@ -225,7 +234,6 @@ export default {
},
//
exportData() {
let that = this
window.electron.ipcRenderer.on('Dingdan', (eve, str) => {
if (str.hasError) {
ElMessage({
@ -261,6 +269,15 @@ export default {
}
this.updateSeach(params)
},
//
async clickColor(color) {
let params = {
blue: { isNotSale: true },
red: { $where: "this.zuigaocaigoujia > this.xiaoshoujine" },
yellow: { $where: "this.pinmingxuanxiang.length>1" }
}
await this.updateSeach(params[color])
},
//
selectChange(selection) {
this.selectionData = _.cloneDeep(selection)
@ -386,7 +403,6 @@ export default {
},
//
exportxiaoshoudata() {
let params = {
subType: "exportxiaoshou",
url: "/api/exportDingdanInfo",
@ -425,7 +441,7 @@ export default {
}
lilstLocal.push(listItem)
}
lilstLocal.push({ "销售金额": allMoney })
lilstLocal.push({ "销售金额": `总计:${allMoney}` })
let jsonWorkSheet = this.$XLSX.utils.json_to_sheet(lilstLocal);
let workBook = {
SheetNames: ["sheet1"],
@ -439,6 +455,34 @@ export default {
dealexportS6(list) {
let lilstLocal = []
let allMoney = 0
let allObj = {
"厂编": "",
"货号": "",
"Q7平台经销商": "",
"业务员": "",
"业务类型": "",
"主表备注": "",
"仓库": "",
"付款方式": "",
"单价": "",
"单据单位": "",
"单据单位单价": "",
"单据单位数量": "",
"单据类型": "",
"发货地址": "",
"备注": "",
"客户收货日期": "",
"客户订单号": "",
"店号": "",
"批号": "",
"数量": "",
"是否赠品": "",
"理货员": "",
"销售单号": "",
"销售日期": "",
"预计开票日": "",
"预订货编号": "",
}
for (let i = 0; i < list.length; i++) {
let item = list[i];
let listItem = {}
@ -447,9 +491,9 @@ export default {
let headerItem = this.exportS6[j];
listItem[headerItem.label] = item[headerItem.prop]
}
lilstLocal.push(listItem)
lilstLocal.push({ ...allObj, ...listItem })
}
lilstLocal.push({ "单据单位数量": allMoney })
lilstLocal.push({ "单据单位数量": `总计:${allMoney}` })
let jsonWorkSheet = this.$XLSX.utils.json_to_sheet(lilstLocal);
let workBook = {
SheetNames: ["sheet1"],

4
start.bat

@ -0,0 +1,4 @@
@echo off
cd E:\jscode\code\chanpininfo\release
npm start
exit

BIN
模版/S6直营销售单导入模板.xls

Binary file not shown.

BIN
模版/产品信息(模板).xls

Binary file not shown.

BIN
模版/客户编码文档(1).xls

Binary file not shown.

BIN
模版/销售订单导入准备表(1).xlsx

Binary file not shown.
Loading…
Cancel
Save