diff --git a/.env.dev b/.env.dev
index ec0e249..361e8ea 100644
--- a/.env.dev
+++ b/.env.dev
@@ -6,6 +6,8 @@ VUE_APP_TITLE = "车联通"后台管理系统
# 芋道管理系统/开发环境
VUE_APP_BASE_API = 'http://localhost:48080'
+# 附件请求地址前缀
+VUE_APP_FILE_API = 'http://122.51.230.86:9000/'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true
diff --git a/.env.prod b/.env.prod
index 54c84a0..94ceef2 100644
--- a/.env.prod
+++ b/.env.prod
@@ -9,6 +9,8 @@ VUE_APP_BASE_API = '/prod-api'
# 根据服务器或域名修改
PUBLIC_PATH = 'http://my-pi.com:8888/yudao-admin/'
+# 附件请求地址前缀
+VUE_APP_FILE_API = 'http://122.51.230.86:9000/'
# 二级部署路径
VUE_APP_APP_NAME ='yudao-admin'
diff --git a/src/api/repair/stockOperate/stockOperate.js b/src/api/repair/stockOperate/stockOperate.js
index 543ea86..a2a1685 100644
--- a/src/api/repair/stockOperate/stockOperate.js
+++ b/src/api/repair/stockOperate/stockOperate.js
@@ -1 +1,20 @@
import request from '@/utils/request'
+
+const preUrl = "/repair/so"
+
+// 采购单\领料单 新增
+export function createRepairSo(data){
+ return request({
+ url: preUrl + "/create",
+ method: "post",
+ data
+ })
+}
+
+export function getRepairSoPage(params){
+ return request({
+ url: preUrl + "/page",
+ method: "get",
+ params
+ })
+}
diff --git a/src/components/FileUpload/index.vue b/src/components/FileUpload/index.vue
index 613beab..2147f8c 100644
--- a/src/components/FileUpload/index.vue
+++ b/src/components/FileUpload/index.vue
@@ -72,6 +72,7 @@ export default {
return {
number: 0,
uploadList: [],
+ viewFileUrl: process.env.VUE_APP_FILE_API,
baseUrl: process.env.VUE_APP_BASE_API,
uploadFileUrl: process.env.VUE_APP_BASE_API + "/admin-api/infra/file/upload", // 请求地址
headers: { Authorization: "Bearer " + getAccessToken() }, // 设置上传的请求头部
@@ -88,7 +89,7 @@ export default {
// 然后将数组转为对象数组
this.fileList = list.map(item => {
if (typeof item === "string") {
- item = { name: item, url: item };
+ item = { name: item, url: this.viewFileUrl+item };
}
item.uid = item.uid || new Date().getTime() + temp++;
return item;
diff --git a/src/components/FileUpload2/index.vue b/src/components/FileUpload2/index.vue
index 5183ce4..73d64f3 100644
--- a/src/components/FileUpload2/index.vue
+++ b/src/components/FileUpload2/index.vue
@@ -88,6 +88,7 @@ export default {
number: 0,
uploadList: [],
baseUrl: "",
+ viewFileUrl: process.env.VUE_APP_FILE_API,
headers: { Authorization: "Bearer " + getAccessToken() }, // 设置上传的请求头部
fileList: [],
uploadFileUrl: process.env.VUE_APP_BASE_API + "/admin-api/infra/file/uploadDetail", // 请求地址
@@ -110,7 +111,7 @@ export default {
const list = Array.isArray(val)? val : this.value.split(",");
this.fileList = list.map((item) => {
if (typeof item === "string") {
- item = { name: item, url: item };
+ item = { name: item, url: this.viewFileUrl+item };
}
item.uid = item.uid || new Date().getTime() + temp++;
return item;
@@ -134,7 +135,7 @@ export default {
const list = Array.isArray(this.value)? this.value : this.value.split(",");
this.fileList = list.map((item) => {
if (typeof item === "string") {
- item = { name: item, url: item };
+ item = { name: item, url: this.viewFileUrl+item };
}
item.uid = item.uid || new Date().getTime() + temp++;
return item;
diff --git a/src/components/ImageUpload/index.vue b/src/components/ImageUpload/index.vue
index dc64e8d..6ef8f7b 100644
--- a/src/components/ImageUpload/index.vue
+++ b/src/components/ImageUpload/index.vue
@@ -76,6 +76,7 @@ export default {
dialogImageUrl: "",
dialogVisible: false,
hideUpload: false,
+ viewFileUrl: process.env.VUE_APP_FILE_API,
uploadFileUrl: process.env.VUE_APP_BASE_API + "/admin-api/infra/file/upload", // 请求地址
headers: { Authorization: "Bearer " + getAccessToken() }, // 设置上传的请求头部
fileList: []
@@ -91,7 +92,7 @@ export default {
this.fileList = list.map(item => {
if (typeof item === "string") {
// edit by 芋道源码
- item = { name: item, url: item };
+ item = { name: item, url: this.viewFileUrl+item };
}
return item;
});
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/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 7b00eb6..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 @@
-
-
+
+
@@ -36,20 +36,25 @@
-
+
-
+
+
+
+
+
+
-
-
+
+
-
- 结算
- 确定
+
+ 结算
+ 确定
@@ -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,26 +83,29 @@ export default {
type: Boolean,
defaultValue: true,
required: true
- }
+ },
},
data() {
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",
+ itemCount: 0,
+ soStatus: this.soByType ? "01" : "04",
+ remark: null,
},
staffRole: "采购员",
partList: [],
}
},
mounted() {
- this.formData.soNo = createUniqueCodeByHead(this.soByType ? "CG" : "LL")
- this.staffRole = this.soByType ? this.staffRole : "领料人"
+ this.init()
},
methods: {
// 得到选择的员工
@@ -106,7 +115,8 @@ export default {
},
// 得到选择的供应商
getSupplier(data) {
- console.log(data)
+ this.formData.supplierId = data.id
+ this.formData.supplierName = data.name
},
// 得到选择的商品
async getPart(data) {
@@ -124,6 +134,66 @@ 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.goodsList = data.map(item => {
+ return {
+ goodsId: item.id,
+ goodsType: "0",
+ wareId: "0",
+ goodsCount: item.count,
+ goodsPrice: item.newPrice,
+ remark: item.remark
+ }
+ })
+ },
+ // 提交
+ async handleSubmit(){
+ 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 0a73902..21b635a 100644
--- a/src/views/repair/stockOperate/Components/SoTable.vue
+++ b/src/views/repair/stockOperate/Components/SoTable.vue
@@ -1,21 +1,62 @@
-
+
{{ scope.$index + 1 }}
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+ {{ scope.row.warehouse }}
+
+
+
+
+
+
+
+ {{ scope.row.count }}
+
+
+
+
+
+
+ {{ scope.row.newPrice }}
+
+
+
+
+
+
+ {{ scope.row.remark }}
+
+
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 @@
+
+
+
+
+
+
+
+
+
+ 搜索
+ 重置
+
+
+
+
+
+ 新增
+
+
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 修改
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+