From 1faedc0334667d7e6e402acf8f2bf2663e6b14d6 Mon Sep 17 00:00:00 2001
From: xiao-fajia <1665375861@qq.com>
Date: Sat, 14 Sep 2024 11:33:58 +0800
Subject: [PATCH 1/4] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/repair/stockOperate/stockOperate.js | 10 ++
src/views/repair/Components/PartChoose.vue | 58 ++++++--
.../repair/stockOperate/Components/SoInfo.vue | 41 ++++--
.../stockOperate/Components/SoTable.vue | 126 +++++++++++++++---
4 files changed, 201 insertions(+), 34 deletions(-)
diff --git a/src/api/repair/stockOperate/stockOperate.js b/src/api/repair/stockOperate/stockOperate.js
index 543ea86..23d957c 100644
--- a/src/api/repair/stockOperate/stockOperate.js
+++ b/src/api/repair/stockOperate/stockOperate.js
@@ -1 +1,11 @@
import request from '@/utils/request'
+
+const preUrl = "/repair/so"
+
+export function createRepairSo(data){
+ return request({
+ url: preUrl + "/create",
+ method: "post",
+ data
+ })
+}
diff --git a/src/views/repair/Components/PartChoose.vue b/src/views/repair/Components/PartChoose.vue
index 8565f20..f80cbfc 100644
--- a/src/views/repair/Components/PartChoose.vue
+++ b/src/views/repair/Components/PartChoose.vue
@@ -2,17 +2,17 @@
-
+
{{ scope.$index + 1 }}
-
-
-
-
-
-
+
+
+
+
+
+
@@ -26,8 +26,48 @@ export default {
return{
partSelected: null,
partList: [
- {id: 1, name: '张胜男', age:20, gender: 1},
- {id: 2, name: '张胜妇', age:20, gender: 1}
+ {
+ id: 1,
+ tenantId: 1,
+ barCode: "12344564632463",
+ code: "12312312",
+ name: "测试1",
+ model: "12321",
+ price: "100",
+ type: "不知道",
+ unit: "个",
+ warehouse: "d1",
+ miniStock: 100,
+ maxStock: 100,
+ stock: 20,
+ img: '',
+ attribute: "123213123",
+ corpId: 1,
+ coverImage: '',
+ carModel: "大车",
+ remark: "没有",
+ },
+ {
+ id: 2,
+ tenantId: 1,
+ barCode: "12344564632463",
+ code: "12312312",
+ name: "测试2",
+ model: "12321",
+ price: "10",
+ type: "不知道",
+ unit: "个",
+ warehouse: "d2",
+ miniStock: 10,
+ maxStock: 10,
+ stock: 5,
+ img: '',
+ attribute: "123213123",
+ corpId: 1,
+ coverImage: '',
+ carModel: "大车",
+ remark: "没有",
+ }
],
queryParams:{
pageNo: 1,
diff --git a/src/views/repair/stockOperate/Components/SoInfo.vue b/src/views/repair/stockOperate/Components/SoInfo.vue
index 7b00eb6..7ab2e92 100644
--- a/src/views/repair/stockOperate/Components/SoInfo.vue
+++ b/src/views/repair/stockOperate/Components/SoInfo.vue
@@ -36,19 +36,24 @@
-
+
-
+
+
+
+
+
+
-
-
+
+
-
- 结算
+
+ 结算
确定
@@ -63,6 +68,7 @@ import PartChoose from "@/views/repair/Components/PartChoose.vue";
import SoTable from "@/views/repair/stockOperate/Components/SoTable.vue";
import SupplierChoose from "@/views/repair/Components/SupplierChoose.vue";
import {createUniqueCodeByHead} from "@/utils/createUniqueCode";
+import {createRepairSo} from "@/api/repair/stockOperate/stockOperate";
export default {
name: "SoInfo",
@@ -77,7 +83,7 @@ export default {
type: Boolean,
defaultValue: true,
required: true
- }
+ },
},
data() {
return {
@@ -88,7 +94,13 @@ export default {
soTime: Date.now(),
userId: null,
userName: null,
- partList: []
+ partList: [],
+ totalPrice: null,
+ soType: this.soByType ? "01" : "02",
+ purchaseType: "01",
+ itemCount: 0,
+ soStatus: this.soByType ? "01" : "04",
+ remark: null,
},
staffRole: "采购员",
partList: [],
@@ -106,7 +118,8 @@ export default {
},
// 得到选择的供应商
getSupplier(data) {
- console.log(data)
+ this.formData.supplierId = data.id
+ this.formData.supplierName = data.name
},
// 得到选择的商品
async getPart(data) {
@@ -124,6 +137,16 @@ export default {
// 删除数据
deleteItem(index) {
this.partList.splice(index, 1)
+ },
+ // 表格的数据
+ tableData(data){
+ this.formData.totalPrice = data.reduce((x, y) => {return x + y.totalPrice}, 0)
+ this.formData.itemCount = data.reduce((x, y) => {return x + y.count}, 0)
+ this.formData.partList = data
+ },
+ async handleSubmit(){
+ const res = await createRepairSo(this.formData)
+ console.log(res)
}
}
}
diff --git a/src/views/repair/stockOperate/Components/SoTable.vue b/src/views/repair/stockOperate/Components/SoTable.vue
index 0a73902..524e9c7 100644
--- a/src/views/repair/stockOperate/Components/SoTable.vue
+++ b/src/views/repair/stockOperate/Components/SoTable.vue
@@ -1,21 +1,53 @@
-
+
{{ scope.$index + 1 }}
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ {{ scope.row.count }}
+
+
+
+
+
+
+ {{ scope.row.newPrice }}
+
+
+
+
+
+
+ {{ scope.row.remark }}
+
+
export default {
name: "SoTable",
- props:{
- soByType:{
+ props: {
+ soByType: {
type: Boolean,
defaultValue: true,
required: true
},
- partList:{
+ partList: {
type: Array,
defaultValue: false,
required: true
@@ -45,13 +77,75 @@ export default {
return {
loading: false,
list: [],
+ includeColumn: ['count', 'totalPrice'],
+ randomKey: Math.random(),
+ }
+ },
+ watch: {
+ partList(val) {
+ const data = val[val.length - 1]
+ const newData = {
+ ...data,
+ count: 1,
+ totalPrice: data.price * 1,
+ remark: '',
+ newPrice: data.price,
+ }
+ this.list.push(newData)
+ },
+ list: {
+ handler(newVal, oldVal) {
+ this.$emit("tableData", newVal)
+ },
+ deep: true
}
},
methods: {
// 通知父组件,删除数据
- deleteItem(index){
+ deleteItem(index) {
this.$emit("deleteItem", index)
- }
+ },
+ // 设置不统计的字段
+ getSummaries(param) {
+ const {columns, data} = param
+ const sums = []
+ columns.forEach((column, index) => {
+ if (index === 0) {
+ sums[index] = '合计';
+ return;
+ }
+ const values = data.map(item => Number(item[column.property]));
+ if (this.includeColumn.includes(column.property)) {
+ sums[index] = values.reduce((prev, curr) => {
+ const value = Number(curr);
+ if (!isNaN(value)) {
+ return prev + curr;
+ } else {
+ return prev;
+ }
+ }, 0);
+ sums[index];
+ }
+ });
+ return sums
+ },
+ editData(row, column) {
+ row[column.property + "isShow"] = true
+ //refreshTable是table数据改动时,刷新table的
+ this.refreshTable()
+ this.$nextTick(() => {
+ this.$refs[column.property] && this.$refs[column.property].focus()
+ })
+ },
+ alterData(row, column) {
+ row[column.property + "isShow"] = false
+ const data = this.list.find(item => item.id === row.id)
+ data.totalPrice = data.newPrice * data.count
+ this.refreshTable()
+ },
+ refreshTable() {
+ this.randomKey = Math.random()
+ },
}
}
From 9fd0101266519c06cf9ed6b33eda84b40dd587f4 Mon Sep 17 00:00:00 2001
From: nyoung <12190070+nyoungo@user.noreply.gitee.com>
Date: Sat, 14 Sep 2024 11:50:34 +0800
Subject: [PATCH 2/4] 1
---
src/views/system/appBase/appSwiper/api.js | 44 +++
src/views/system/appBase/appSwiper/index.vue | 266 +++++++++++++++++++
2 files changed, 310 insertions(+)
create mode 100644 src/views/system/appBase/appSwiper/api.js
create mode 100644 src/views/system/appBase/appSwiper/index.vue
diff --git a/src/views/system/appBase/appSwiper/api.js b/src/views/system/appBase/appSwiper/api.js
new file mode 100644
index 0000000..86fe978
--- /dev/null
+++ b/src/views/system/appBase/appSwiper/api.js
@@ -0,0 +1,44 @@
+import request from '@/utils/request'
+
+// 查询app轮播图列表
+export function listSwiper(query) {
+ return request({
+ url: '/system/appSwiper/list',
+ method: 'get',
+ params: query
+ })
+}
+
+// 查询app轮播图详细
+export function getSwiper(swiperId) {
+ return request({
+ url: '/system/appSwiper/' + swiperId,
+ method: 'get'
+ })
+}
+
+// 新增app轮播图
+export function addSwiper(data) {
+ return request({
+ url: '/system/appSwiper/add',
+ method: 'post',
+ data: data
+ })
+}
+
+// 修改app轮播图
+export function updateSwiper(data) {
+ return request({
+ url: '/system/appSwiper/edit',
+ method: 'post',
+ data: data
+ })
+}
+
+// 删除app轮播图
+export function delSwiper(swiperId) {
+ return request({
+ url: '/system/appSwiper/del?idList=' + swiperId,
+ method: 'post'
+ })
+}
diff --git a/src/views/system/appBase/appSwiper/index.vue b/src/views/system/appBase/appSwiper/index.vue
new file mode 100644
index 0000000..6fae34d
--- /dev/null
+++ b/src/views/system/appBase/appSwiper/index.vue
@@ -0,0 +1,266 @@
+
+
+
+
+
+
+
+
+
+ 搜索
+ 重置
+
+
+
+
+
+ 新增
+
+
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 修改
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From 1aad791aa26d2b10df8f1a91dc7fa1ad69491093 Mon Sep 17 00:00:00 2001
From: xiao-fajia <1665375861@qq.com>
Date: Sat, 14 Sep 2024 18:27:01 +0800
Subject: [PATCH 3/4] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/repair/stockOperate/stockOperate.js | 9 ++
src/views/repair/Components/StaffChoose.vue | 15 +++-
.../repair/Components/SupplierChoose.vue | 19 +++-
.../repair/Components/WarehouseChoose.vue | 3 +-
.../stockOperate/Components/SoIndex.vue | 87 +++++++++++--------
.../repair/stockOperate/Components/SoInfo.vue | 77 ++++++++++++----
.../stockOperate/Components/SoTable.vue | 43 ++++++---
7 files changed, 185 insertions(+), 68 deletions(-)
diff --git a/src/api/repair/stockOperate/stockOperate.js b/src/api/repair/stockOperate/stockOperate.js
index 23d957c..a2a1685 100644
--- a/src/api/repair/stockOperate/stockOperate.js
+++ b/src/api/repair/stockOperate/stockOperate.js
@@ -2,6 +2,7 @@ import request from '@/utils/request'
const preUrl = "/repair/so"
+// 采购单\领料单 新增
export function createRepairSo(data){
return request({
url: preUrl + "/create",
@@ -9,3 +10,11 @@ export function createRepairSo(data){
data
})
}
+
+export function getRepairSoPage(params){
+ return request({
+ url: preUrl + "/page",
+ method: "get",
+ params
+ })
+}
diff --git a/src/views/repair/Components/StaffChoose.vue b/src/views/repair/Components/StaffChoose.vue
index a5301bb..223f742 100644
--- a/src/views/repair/Components/StaffChoose.vue
+++ b/src/views/repair/Components/StaffChoose.vue
@@ -10,6 +10,12 @@ import {getStaffList} from "@/api/company/staff";
export default {
name: "StaffChoose",
+ props:{
+ value: {
+ type: Object,
+ defaultValue: null
+ }
+ },
data() {
return {
staffList: [],
@@ -19,7 +25,14 @@ export default {
watch:{
staffSelected(val) {
const staff = this.staffList.find(item => item.id === val);
- this.$emit("selected", staff);
+ this.$emit("input", staff);
+ },
+ value(newVal){
+ if (newVal){
+ this.staffSelected = newVal.id
+ }else {
+ this.staffSelected = null
+ }
}
},
mounted() {
diff --git a/src/views/repair/Components/SupplierChoose.vue b/src/views/repair/Components/SupplierChoose.vue
index 85ff8b9..7011d0f 100644
--- a/src/views/repair/Components/SupplierChoose.vue
+++ b/src/views/repair/Components/SupplierChoose.vue
@@ -11,16 +11,29 @@ import {getBaseSupplierList} from "@/api/repair/supplier";
export default {
name: "SupplierChoose",
+ props: {
+ value: {
+ type: Object,
+ defaultValue: null
+ }
+ },
data() {
return {
supplierSelected: undefined,
supplierList: null
}
},
- watch:{
+ watch: {
supplierSelected(val) {
- const supplier = this.supplierList.find(item => item.id === val);
- this.$emit("selected", supplier);
+ const supplier = this.supplierList.find(item => item.id === val)
+ this.$emit("input", supplier);
+ },
+ value(newVal) {
+ if (newVal) {
+ this.supplierSelected = newVal.id
+ } else {
+ this.supplierSelected = null
+ }
}
},
mounted() {
diff --git a/src/views/repair/Components/WarehouseChoose.vue b/src/views/repair/Components/WarehouseChoose.vue
index 7dad376..0b0fcb7 100644
--- a/src/views/repair/Components/WarehouseChoose.vue
+++ b/src/views/repair/Components/WarehouseChoose.vue
@@ -51,7 +51,8 @@ export default {
return JSON.parse(JSON.stringify(result))
},
handleNodeClick(node){
- this.$emit("selected", node)
+ this.$emit("input", node.name)
+ this.$emit("change")
this.warehouseSelected = node.name
this.$refs.selectTree.blur()
}
diff --git a/src/views/repair/stockOperate/Components/SoIndex.vue b/src/views/repair/stockOperate/Components/SoIndex.vue
index ad3f7d9..edd98f3 100644
--- a/src/views/repair/stockOperate/Components/SoIndex.vue
+++ b/src/views/repair/stockOperate/Components/SoIndex.vue
@@ -12,7 +12,7 @@
-
+
@@ -25,7 +25,7 @@
+ :value="item.value"/>
@@ -55,19 +55,19 @@
{{ scope.$index + 1 }}
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
{{ scope.$index + 1 }}
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
item.label.toString().indexOf("领料") === -1)
}
},
- components:{
+ components: {
StaffChoose,
SupplierChoose,
CorpChoose
},
- props:{
+ props: {
soByType: {
type: Boolean,
defaultValue: true,
@@ -145,17 +146,18 @@ export default {
},
data() {
return {
- queryParams:{
+ queryParams: {
pageNo: 1,
pageSize: 10,
- searchTimeArray:[],
+ searchTimeArray: [],
soNo: null,
supplierId: null,
supplierName: null,
soStatus: null,
corpId: null,
userId: null,
- userName: null
+ userName: null,
+ soType: this.soByType ? "01" : "02"
},
showSearch: true,
list: [],
@@ -163,21 +165,36 @@ export default {
total: 0
}
},
+ mounted() {
+ this.pageSo();
+ },
methods: {
+ // 分页
+ async pageSo() {
+ try {
+ this.loading = true
+ const res = await getRepairSoPage(this.queryParams)
+ this.list = res.data.records
+ this.total = res.data.total
+ }finally {
+ this.loading = false
+ }
+ },
// 搜索按钮
- handleQuery(){},
+ handleQuery() {
+ },
// 搜索重置
- resetQuery(){
+ resetQuery() {
this.resetForm('queryForm')
this.handleQuery()
},
// 员工选择组件的回调
- getStaff(data){
+ getStaff(data) {
this.queryParams.userId = data.id
this.queryParams.userName = data.name
},
// 门店选择
- getCompany(data){
+ getCompany(data) {
console.log(data)
}
}
diff --git a/src/views/repair/stockOperate/Components/SoInfo.vue b/src/views/repair/stockOperate/Components/SoInfo.vue
index 7ab2e92..7eed3ab 100644
--- a/src/views/repair/stockOperate/Components/SoInfo.vue
+++ b/src/views/repair/stockOperate/Components/SoInfo.vue
@@ -4,8 +4,8 @@
-
-
+
+
@@ -20,8 +20,8 @@
-
-
+
+
@@ -54,7 +54,7 @@
结算
- 确定
+ 确定
@@ -89,12 +89,10 @@ export default {
return {
formData: {
soNo: null,
- supplierId: null,
- supplierName: null,
+ supplier: null,
soTime: Date.now(),
- userId: null,
- userName: null,
- partList: [],
+ user: null,
+ goodsList: [],
totalPrice: null,
soType: this.soByType ? "01" : "02",
purchaseType: "01",
@@ -107,8 +105,7 @@ export default {
}
},
mounted() {
- this.formData.soNo = createUniqueCodeByHead(this.soByType ? "CG" : "LL")
- this.staffRole = this.soByType ? this.staffRole : "领料人"
+ this.init()
},
methods: {
// 得到选择的员工
@@ -142,11 +139,61 @@ export default {
tableData(data){
this.formData.totalPrice = data.reduce((x, y) => {return x + y.totalPrice}, 0)
this.formData.itemCount = data.reduce((x, y) => {return x + y.count}, 0)
- this.formData.partList = data
+ this.formData.goodsList = data.map(item => {
+ return {
+ goodsId: item.id,
+ goodsType: "0",
+ wareId: "0",
+ goodsCount: item.count,
+ goodsPrice: item.newPrice,
+ remark: item.remark
+ }
+ })
},
+ // 提交
async handleSubmit(){
- const res = await createRepairSo(this.formData)
- console.log(res)
+ try {
+ this.createInit()
+ await createRepairSo(this.formData)
+ this.$modal.msgSuccess("新增成功")
+ this.init()
+ }catch{
+ }
+ },
+ // 初始化
+ init(){
+ this.formData = {
+ soNo: null,
+ supplier: null,
+ soTime: Date.now(),
+ user: null,
+ goodsList: [],
+ totalPrice: null,
+ soType: this.soByType ? "01" : "02",
+ purchaseType: "01",
+ itemCount: 0,
+ soStatus: this.soByType ? "01" : "04",
+ remark: null,
+ }
+ this.formData.soNo = createUniqueCodeByHead(this.soByType ? "CG" : "LL")
+ this.staffRole = this.soByType ? this.staffRole : "领料人"
+ this.partList = []
+ },
+ // 提交前的构建
+ createInit(){
+ const data = this.formData
+ this.formData = {
+ ...data,
+ userId: data.user.id,
+ userName: data.user.name,
+ }
+ if (this.soByType){
+ this.formData = {
+ ...data,
+ supplierId: data.supplier.id,
+ supplierName: data.supplier.name
+ }
+ }
}
}
}
diff --git a/src/views/repair/stockOperate/Components/SoTable.vue b/src/views/repair/stockOperate/Components/SoTable.vue
index 524e9c7..21b635a 100644
--- a/src/views/repair/stockOperate/Components/SoTable.vue
+++ b/src/views/repair/stockOperate/Components/SoTable.vue
@@ -16,7 +16,16 @@
-
+
+
+
+ {{ scope.row.warehouse }}
+
+
@@ -31,7 +40,7 @@
-
@@ -59,8 +68,11 @@