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 @@ - + - - - - - - + + + + + + @@ -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 }} - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + +