diff --git a/androidPrivacy.json b/androidPrivacy.json
new file mode 100644
index 0000000..12df862
--- /dev/null
+++ b/androidPrivacy.json
@@ -0,0 +1,3 @@
+{
+ "prompt": "template"
+}
diff --git a/api/purchase.js b/api/purchase.js
index 2e2ab21..17e5328 100644
--- a/api/purchase.js
+++ b/api/purchase.js
@@ -27,6 +27,11 @@ export const purchaseApi = {
// 新增订单
addOrder(data = {}) {
return api.post('/purchase/addorder', data)
+ },
+
+ // 更新订单
+ updateOrder(data = {}) {
+ return api.post('/purchase/updateorder', data)
}
}
diff --git a/manifest.json b/manifest.json
index 709b3c6..701daa5 100644
--- a/manifest.json
+++ b/manifest.json
@@ -17,7 +17,11 @@
"delay" : 0
},
/* 模块配置 */
- "modules" : {},
+ "modules" : {
+ "Barcode" : {},
+ "Bluetooth" : {},
+ "Camera" : {}
+ },
/* 应用发布信息 */
"distribute" : {
/* android打包配置 */
@@ -77,6 +81,9 @@
"spotlight@3x" : "unpackage/res/icons/120x120.png"
}
}
+ },
+ "splashscreen" : {
+ "useOriginalMsgbox" : true
}
}
},
diff --git a/pages.json b/pages.json
index c1c62eb..84545d0 100644
--- a/pages.json
+++ b/pages.json
@@ -24,6 +24,12 @@
"navigationBarTitleText": "新增订单"
}
},
+ {
+ "path": "pages/order/edit-order",
+ "style": {
+ "navigationBarTitleText": "编辑订单"
+ }
+ },
{
"path": "pages/workorder/workorder",
"style": {
diff --git a/pages/order/edit-order.vue b/pages/order/edit-order.vue
new file mode 100644
index 0000000..0d95de9
--- /dev/null
+++ b/pages/order/edit-order.vue
@@ -0,0 +1,762 @@
+
+
+
+
+
+
+
+
+ 基本信息
+
+
+
+ 配件名称
+
+
+
+
+
+ 备注
+
+ {{ form.remark.length }}/256
+
+
+
+
+ 采购链接
+
+
+
+
+
+ 款式标签
+
+
+
+ {{ tag }}
+ ×
+
+
+
+
+
+
+
+
+
+ 费用明细
+
+
+
+
+
+ {{ costType[item.type] || item.type }}
+ {{ item.int }}
+ {{ item.cost }}
+ {{ item.costt }}
+ {{ currencyOptions[item.currencytype] || item.currencytype }}
+ 删除
+
+
+
+
+
+
+
+ 费用类型
+
+
+ {{ costTypeOptions[costTypeIndex].label }}
+
+
+
+
+ 数量
+
+
+
+
+
+ 单价
+
+
+
+ 货币
+
+
+ {{ currencyOptionsList[currencyIndex].label }}
+
+
+
+
+
+ 总计:{{ currencyOptionsList[currencyIndex].symbol }}{{ newCostTotal }}
+
+ 单价必须大于0
+
+
+
+
+
+
+ 图片
+
+
+
+ ×
+
+
+ +
+ 添加图片
+
+
+
+
+
+
+
+
+
+
+ 加载中...
+
+
+
+
+
+
diff --git a/pages/order/order-detail.vue b/pages/order/order-detail.vue
index 577ce9c..d1a2506 100644
--- a/pages/order/order-detail.vue
+++ b/pages/order/order-detail.vue
@@ -100,7 +100,7 @@
by {{ getUsernameById(commit.userId) }}
-
+
@@ -154,7 +154,7 @@ import { purchaseApi } from '@/api/purchase.js'
import { useConfigStore } from '@/stores/config.js'
import { fetchUserInfo, getUsername } from '@/stores/users.js'
import { api } from '@/api/index.js'
-import { onLoad } from '@dcloudio/uni-app'
+import { onLoad, onShow } from '@dcloudio/uni-app'
const configStore = useConfigStore()
@@ -222,11 +222,17 @@ function getImageUrl(sha256) {
}
function previewImages(currentSha) {
- const urls = photos.value.map(p => getImageUrl(p.Sha256))
- const idx = photos.value.findIndex(p => p.Sha256 === currentSha)
+ const allPhotos = photos.value || []
+ const urls = allPhotos.map(p => getImageUrl(p.Sha256))
+ const idx = allPhotos.findIndex(p => p.Sha256 === currentSha)
uni.previewImage({ urls, current: idx >= 0 ? idx : 0 })
}
+function previewCommitImages(photoHashes, currentIndex) {
+ const urls = photoHashes.map(h => getImageUrl(h))
+ uni.previewImage({ urls, current: currentIndex })
+}
+
function getUsernameById(userId) {
return getUsername(userId) || `用户${userId}`
}
@@ -348,6 +354,13 @@ onLoad((options) => {
fetchOrderDetail()
}
})
+
+// 每次页面显示时刷新数据
+onShow(() => {
+ if (orderId.value) {
+ fetchOrderDetail()
+ }
+})