diff --git a/api/httpRequest3.js b/api/httpRequest3.js
index 51075ab7..d51a546d 100644
--- a/api/httpRequest3.js
+++ b/api/httpRequest3.js
@@ -52,5 +52,7 @@ function service(options = {}) {
uni.request(options);
});
}
+
+
export default service;
diff --git a/api/index.js b/api/index.js
index 0552cfaa..ab6423f7 100644
--- a/api/index.js
+++ b/api/index.js
@@ -1226,3 +1226,7 @@ export const issueDirect = (params) => request(
data: params,
method: "post"
});
+
+
+
+
diff --git a/api/request2.js b/api/request2.js
index cadc36ac..d5348b3d 100644
--- a/api/request2.js
+++ b/api/request2.js
@@ -1,4 +1,5 @@
import request from '@/api/httpRequest3.js'
+import storage from '@/common/utils/storage'
// const baseApi = "/api/admin-api"
//公司地址
// 本地地址
@@ -624,7 +625,7 @@ export function getPurchaseReturnRequestDetail(id) {
*/
export function purchaseReturnRequestClose(id) {
return request({
- url: baseApi + "/wms/purchasereturn-request-main/close?id="+id,
+ url: baseApi + "/wms/purchasereturn-request-main/close?id=" + id,
method: "put",
data: {},
});
@@ -636,7 +637,7 @@ export function purchaseReturnRequestClose(id) {
*/
export function purchaseReturnRequestApprove(id) {
return request({
- url: baseApi + "/wms/purchasereturn-request-main/submit?id="+id,
+ url: baseApi + "/wms/purchasereturn-request-main/submit?id=" + id,
method: "put",
data: {},
});
@@ -648,7 +649,7 @@ export function purchaseReturnRequestApprove(id) {
*/
export function purchaseReturnRequestApproveAgree(id) {
return request({
- url: baseApi + "/wms/purchasereturn-request-main/agree?id="+id,
+ url: baseApi + "/wms/purchasereturn-request-main/agree?id=" + id,
method: "put",
data: {},
});
@@ -660,7 +661,7 @@ export function purchaseReturnRequestApproveAgree(id) {
*/
export function purchaseReturnRequestApproveRefused(id) {
return request({
- url: baseApi + "/wms/purchasereturn-request-main/refused?id="+id,
+ url: baseApi + "/wms/purchasereturn-request-main/refused?id=" + id,
method: "put",
data: {},
});
@@ -672,7 +673,7 @@ export function purchaseReturnRequestApproveRefused(id) {
*/
export function purchaseReturnRequestHandle(id) {
return request({
- url: baseApi + "/wms/purchasereturn-request-main/handle?id="+id,
+ url: baseApi + "/wms/purchasereturn-request-main/handle?id=" + id,
method: "put",
data: {},
});
@@ -1287,7 +1288,7 @@ export function unPlannedReceiptRequestCreate(params) {
*/
export function unPlannedReceiptRequestApprove(id) {
return request({
- url: baseApi + "/wms/unplannedreceipt-request-main/submit?id="+id,
+ url: baseApi + "/wms/unplannedreceipt-request-main/submit?id=" + id,
method: "put",
data: {},
});
@@ -1299,7 +1300,7 @@ export function unPlannedReceiptRequestApprove(id) {
*/
export function unPlannedReceiptRequestClose(id) {
return request({
- url: baseApi + "/wms/unplannedreceipt-request-main/close?id="+id,
+ url: baseApi + "/wms/unplannedreceipt-request-main/close?id=" + id,
method: "put",
data: {},
});
@@ -1311,7 +1312,7 @@ export function unPlannedReceiptRequestClose(id) {
*/
export function unPlannedReceiptRequestApproveAgree(id) {
return request({
- url: baseApi + "/wms/unplannedreceipt-request-main/agree?id="+id,
+ url: baseApi + "/wms/unplannedreceipt-request-main/agree?id=" + id,
method: "put",
data: {},
});
@@ -1323,7 +1324,7 @@ export function unPlannedReceiptRequestApproveAgree(id) {
*/
export function unPlannedReceiptRequestApproveRefused(id) {
return request({
- url: baseApi + "/wms/unplannedreceipt-request-main/refused?id="+id,
+ url: baseApi + "/wms/unplannedreceipt-request-main/refused?id=" + id,
method: "put",
data: {},
});
@@ -1335,7 +1336,7 @@ export function unPlannedReceiptRequestApproveRefused(id) {
*/
export function unPlannedReceiptRequestHandle(id) {
return request({
- url: baseApi + "/wms/unplannedreceipt-request-main/handle?id="+id,
+ url: baseApi + "/wms/unplannedreceipt-request-main/handle?id=" + id,
method: "put",
data: {},
});
@@ -1440,7 +1441,7 @@ export function unPlannedIssueRequestCreate(params) {
*/
export function unPlannedIssueRequestApprove(id) {
return request({
- url: baseApi + "/wms/unplannedissue-request-main/submit?id="+id,
+ url: baseApi + "/wms/unplannedissue-request-main/submit?id=" + id,
method: "put",
data: {},
});
@@ -1452,7 +1453,7 @@ export function unPlannedIssueRequestApprove(id) {
*/
export function unPlannedIssueRequestClose(id) {
return request({
- url: baseApi + "/wms/unplannedissue-request-main/close?id="+id,
+ url: baseApi + "/wms/unplannedissue-request-main/close?id=" + id,
method: "put",
data: {},
});
@@ -1464,7 +1465,7 @@ export function unPlannedIssueRequestClose(id) {
*/
export function unPlannedIssueRequestApproveAgree(id) {
return request({
- url: baseApi + "/wms/unplannedissue-request-main/agree?id="+id,
+ url: baseApi + "/wms/unplannedissue-request-main/agree?id=" + id,
method: "put",
data: {},
});
@@ -1476,7 +1477,7 @@ export function unPlannedIssueRequestApproveAgree(id) {
*/
export function unPlannedIssueRequestApproveRefused(id) {
return request({
- url: baseApi + "/wms/unplannedissue-request-main/refused?id="+id,
+ url: baseApi + "/wms/unplannedissue-request-main/refused?id=" + id,
method: "put",
data: {},
});
@@ -1488,7 +1489,7 @@ export function unPlannedIssueRequestApproveRefused(id) {
*/
export function unPlannedIssueRequestHandle(id) {
return request({
- url: baseApi + "/wms/unplannedissue-request-main/handle?id="+id,
+ url: baseApi + "/wms/unplannedissue-request-main/handle?id=" + id,
method: "put",
data: {},
});
@@ -2251,7 +2252,7 @@ export function issueRequestSubmit(params) {
*/
export function issueRequestHandle(id) {
return request({
- url: baseApi + "/wms/issue-request-main/handle?id="+id,
+ url: baseApi + "/wms/issue-request-main/handle?id=" + id,
method: "put",
data: {},
});
@@ -2264,7 +2265,7 @@ export function issueRequestHandle(id) {
*/
export function issueRequestSubmitApprove(id) {
return request({
- url: baseApi + "/wms/issue-request-main/submit?id="+id,
+ url: baseApi + "/wms/issue-request-main/submit?id=" + id,
method: "put",
data: {},
});
@@ -2276,7 +2277,7 @@ export function issueRequestSubmitApprove(id) {
*/
export function issueRequestSubmitApproveAgree(id) {
return request({
- url: baseApi + "/wms/issue-request-main/agree?id="+id,
+ url: baseApi + "/wms/issue-request-main/agree?id=" + id,
method: "put",
data: {},
});
@@ -2288,7 +2289,7 @@ export function issueRequestSubmitApproveAgree(id) {
*/
export function issueRequestSubmitApproveRefused(id) {
return request({
- url: baseApi + "/wms/issue-request-main/refused?id="+id,
+ url: baseApi + "/wms/issue-request-main/refused?id=" + id,
method: "put",
data: {},
});
@@ -2300,7 +2301,7 @@ export function issueRequestSubmitApproveRefused(id) {
*/
export function issueRequestClose(id) {
return request({
- url: baseApi + "/wms/issue-request-main/close?id="+id,
+ url: baseApi + "/wms/issue-request-main/close?id=" + id,
method: "put",
data: {},
});
@@ -2699,7 +2700,7 @@ export function scrapRequestCreate(params) {
*/
export function scrapRequestApprove(id) {
return request({
- url: baseApi + "/wms/scrap-request-main/submit?id="+id,
+ url: baseApi + "/wms/scrap-request-main/submit?id=" + id,
method: "put",
data: {},
});
@@ -2711,7 +2712,7 @@ export function scrapRequestApprove(id) {
*/
export function scrapRequestClose(id) {
return request({
- url: baseApi + "/wms/scrap-request-main/close?id="+id,
+ url: baseApi + "/wms/scrap-request-main/close?id=" + id,
method: "put",
data: {},
});
@@ -2723,7 +2724,7 @@ export function scrapRequestClose(id) {
*/
export function scrapRequestApproveAgree(id) {
return request({
- url: baseApi + "/wms/scrap-request-main/agree?id="+id,
+ url: baseApi + "/wms/scrap-request-main/agree?id=" + id,
method: "put",
data: {},
});
@@ -2735,7 +2736,7 @@ export function scrapRequestApproveAgree(id) {
*/
export function scrapRequestApproveRefused(id) {
return request({
- url: baseApi + "/wms/scrap-request-main/refused?id="+id,
+ url: baseApi + "/wms/scrap-request-main/refused?id=" + id,
method: "put",
data: {},
});
@@ -2747,7 +2748,7 @@ export function scrapRequestApproveRefused(id) {
*/
export function scrapRequestHandle(id) {
return request({
- url: baseApi + "/wms/scrap-request-main/handle?id="+id,
+ url: baseApi + "/wms/scrap-request-main/handle?id=" + id,
method: "put",
data: {},
});
@@ -2951,3 +2952,57 @@ export function getBalanceByFilter(param) {
data: param,
});
}
+
+
+/**
+ * 删除文件
+ * @param {*}
+ *
+ */
+export function deleteFileById(id) {
+ return request({
+ url: baseApi + "/infra/file/delete?id=" + id ,
+ method: "delete",
+ data: {},
+ });
+}
+
+
+/**
+ * 获取文件列表
+ * @param {*}
+ *
+ */
+export function getFileList(tableName, tableId) {
+ return request({
+ url: baseApi + "/infra/file/list?tableName=" + tableName + "&tableId=" + tableId,
+ method: "get",
+ data: {},
+ });
+}
+
+/**
+ * 图片上传
+ * @param {*}
+ *
+ */
+export function uploadFile(tableName, tableId,filePath,callBack) {
+ var token = storage.getStorage(storage.constant.token)
+ var url = getApp().globalData.request_url+baseApi
+ uni.uploadFile({
+ url: url+"/infra/file/upload?tableName="+tableName + "&tableId=" + tableId,
+ filePath: filePath,
+ name: 'file',
+ header: {
+ "Authorization": "Bearer " + token,
+ "tenant-id": 1
+ },
+ success: (uploadFileRes) => {
+ callBack(uploadFileRes.data)
+ console.log(uploadFileRes.data);
+ },
+ fail: (error) => {
+ callBack(undefined)
+ },
+ });
+}
diff --git a/pages/count/job/countDetail.vue b/pages/count/job/countDetail.vue
index c90ada10..b5d9c19c 100644
--- a/pages/count/job/countDetail.vue
+++ b/pages/count/job/countDetail.vue
@@ -400,7 +400,7 @@
createAddDetailInfo(balance, pack) {
var detail = {
- id: "",
+ id: "0",
scaned: true,
countDetailNumber: "",
ownerCode: balance.ownerCode,
@@ -413,16 +413,17 @@
itemDesc1: pack.itemDesc1,
itemDesc2: pack.itemDesc2,
projectCode: "",
- qty: balance.qty,
+ qty: 0,
handleQty: balance.qty,
uom: balance.uom,
- number: "",
+ number: this.jobContent.number,
remark: "",
countQty: balance.qty,
balanceQty: balance.qty,
fromLocationCode: balance.locationCode,
stdPackQty: pack.stdPackQty,
stdPackUnit: pack.stdPackUnit,
+ creator:this.$store.state.user.id
}
return detail;
@@ -509,10 +510,10 @@
});
var params = this.setParams()
console.log("提交参数", JSON.stringify(params));
- countJobSubmit(this.id, params).then(res => {
+ countJobSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
- this.showCommitSuccessMessage("提交成功
生成盘点记录" + res.data)
+ this.showCommitSuccessMessage("提交成功
生成盘点记录
" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
diff --git a/pages/inspect/coms/inspectEdit.vue b/pages/inspect/coms/inspectEdit.vue
index 53a4a918..4cefd83e 100644
--- a/pages/inspect/coms/inspectEdit.vue
+++ b/pages/inspect/coms/inspectEdit.vue
@@ -1,6 +1,6 @@
-
+
箱码
@@ -49,8 +49,8 @@
-
-
+
@@ -65,6 +65,12 @@
import {
getInspectFailedReasonList,
} from '@/common/directory.js';
+ import {
+ uploadFile,
+ getFileList,
+ deleteFileById
+ } from '@/api/request2.js';
+
import comMessage from '@/mycomponents/common/comMessage.vue'
import uploadCamera from '@/pages/inspect/coms/uploadCamera.vue'
import uom from '@/mycomponents/qty/uom.vue'
@@ -81,7 +87,8 @@
failedReasonIndex: 0,
failedReasonArray: [],
dataContent: {},
- failedReasonArray: []
+ failedReasonArray: [],
+ picInfoList: []
}
},
props: {
@@ -101,11 +108,93 @@
this.failedReasonArray = getInspectFailedReasonList();
//拷贝数据到页面显示,防止修改数据原数据修改
this.dataContent = Object.assign({}, item)
+ this.getFileList();
this.$refs['editPopup'].open("bottom");
+
+
+ },
+ getFileList() {
+ getFileList("jobInspectDetail", this.dataContent.id).then(res => {
+ if(res.data){
+ var imageFiles = [];
+ res.data.forEach(item=>{
+ var image = this.createImage(item.id, item.url, item.path, item.size)
+ imageFiles.push(image)
+ })
+ }
+
+ if (imageFiles.length > 0) {
+ this.$nextTick(function() {
+ this.$refs.uploadImage.setFiles(imageFiles);
+ this.setPhotosInfo();
+ })
+
+ }
+ })
+ },
+
+ setPhotosInfo(){
+ var list = this.$refs.uploadImage.getFiles()
+ var photoItem = "";
+ for (var i = 0; i < list.length; i++) {
+ if (list.length - 1 == i) {
+ photoItem = photoItem + list[i].url
+ } else {
+ photoItem = photoItem + list[i].url + ","
+ }
+ }
+ this.dataContent.photos = photoItem;
+ },
+
+
+ createImage(id, url, fileName, size) {
+
+ let image = {
+ id: id,
+ name: fileName,
+ extname: "png",
+ fileType: "image",
+ url: url,
+ size: size,
+ image: {
+ width: 175,
+ height: 175,
+ location: url,
+ },
+ path: url,
+ progress: 100,
+ status: "ready"
+ }
+
+ return image;
+ },
+
+ deleteImg(content) {
+ var id = content.id
+ if (id != undefined) {
+ deleteFileById(id).then(res => {
+ if (res.data) {
+ uni.showToast({
+ title: "删除成功"
+ })
+ }
+ }).catch(error => {
+ console.log(error)
+ })
+ } else {
+ this.getFileList();
+ }
+
+ },
+ select(content) {
+ this.uploadFile(content);
},
back() {
- this.$refs['editPopup'].close();
+ this.afterSave()
+ },
+ maskClick() {
+
},
afterSave() {
@@ -119,6 +208,8 @@
}
});
},
+
+
save() {
var failedQty = Number(this.dataContent.failedQty);
var crackQty = Number(this.dataContent.crackQty);
@@ -137,13 +228,26 @@
}
this.dataContent.failedQty = failedQty;
this.dataContent.crackQty = crackQty
- this.dataContent.goodQty = this.dataContent.handleQty -failedQty-crackQty
+ this.dataContent.goodQty = this.dataContent.handleQty - failedQty - crackQty
this.afterSave()
+ },
+ uploadFile(content) {
+ uploadFile("jobInspectDetail", this.dataContent.id, content.path, res => {
+ if (res != undefined) {
+ uni.showToast({
+ title: "上传成功"
+ })
+ } else {
+ uni.showToast({
+ title: "上传失败"
+ })
+ }
+ this.getFileList();
+ })
}
-
}
}
diff --git a/pages/inspect/coms/uploadCamera.vue b/pages/inspect/coms/uploadCamera.vue
index b1f0857f..13718fdc 100644
--- a/pages/inspect/coms/uploadCamera.vue
+++ b/pages/inspect/coms/uploadCamera.vue
@@ -33,12 +33,14 @@
},
// 获取上传状态
select(e) {
- console.log('选择文件:', e)
+ // console.log('选择文件:', e)
+ this.$emit("select",e.tempFiles[0])
},
//删除
deleteImg(e) {
- console.log('删除:', e)
+ // console.log('删除:', e)
+ this.$emit("delete",e.tempFile)
},
// 获取上传进度
diff --git a/pages/inspect/job/inspectDetail.vue b/pages/inspect/job/inspectDetail.vue
index 89df9ba5..9c77da89 100644
--- a/pages/inspect/job/inspectDetail.vue
+++ b/pages/inspect/job/inspectDetail.vue
@@ -39,8 +39,9 @@
takeInspectJob,
cancleTakeInspectJob,
getInspectJobDetail,
- getBasicLocationByCode,
- inspectJobSubmit
+ inspectJobSubmit,
+ deleteFileById,
+ getFileList
} from '@/api/request2.js';
import {
goHome,
@@ -135,6 +136,7 @@
}
},
+
onPullDownRefresh() {
this.getDetail();
@@ -145,6 +147,29 @@
},
methods: {
+ deleteFileById(id){
+ deleteFileById(id).then(res=>{
+
+ })
+
+ },
+ getFileList(id){
+ getFileList("jobInspectDetail", id).then(res => {
+ if(res.data){
+ res.data.forEach(res=>{
+ this.deleteFileById(res.id)
+ })
+ }
+ })
+ },
+
+ clearPicList(subList){
+ subList.forEach(item=>{
+ this.getFileList(item.id)
+ })
+ },
+
+
//接收
receive(callback) {
uni.showLoading({
@@ -179,6 +204,7 @@
that.jobContent.failedQty = this.failedQty
that.jobContent.crackQty = this.crackQty;
that.subList = res.data.subList;
+ this.clearPicList(that.subList);
that.subList.forEach(res => {
res.batch = that.jobContent.batch
res.goodQty = 0;
diff --git a/pages/inspect/job/inspectFullDetail.vue b/pages/inspect/job/inspectFullDetail.vue
index 12d6754b..539eb678 100644
--- a/pages/inspect/job/inspectFullDetail.vue
+++ b/pages/inspect/job/inspectFullDetail.vue
@@ -39,8 +39,9 @@
takeInspectJob,
cancleTakeInspectJob,
getInspectJobDetail,
- getBasicLocationByCode,
- inspectJobSubmit
+ inspectJobSubmit,
+ deleteFileById,
+ getFileList
} from '@/api/request2.js';
import {
goHome,
@@ -147,6 +148,27 @@
},
methods: {
+ deleteFileById(id){
+ deleteFileById(id).then(res=>{
+
+ })
+
+ },
+ getFileList(id){
+ getFileList("jobInspectDetail", id).then(res => {
+ if(res.data){
+ res.data.forEach(res=>{
+ this.deleteFileById(res.id)
+ })
+ }
+ })
+ },
+
+ clearPicList(subList){
+ subList.forEach(item=>{
+ this.getFileList(item.id)
+ })
+ },
//接收
receive(callback) {
uni.showLoading({
@@ -182,6 +204,7 @@
this.jobContent.crackQty = 0;
this.jobContent.notPassedQty = 0;
that.subList = res.data.subList;
+ this.clearPicList(that.subList);
that.subList.forEach(res => {
res.batch = that.jobContent.batch
res.goodQty = 0;