日期校验有问题

This commit is contained in:
2026-04-04 23:41:45 +08:00
parent 6de3fae833
commit dd7bc95f53
4 changed files with 60 additions and 38 deletions
@@ -22,7 +22,18 @@
"usedAt": 1775242179615,
"industryId": "all"
}
],
"8e3dae3f55ad43b4b3b604818204bc8c": [
{
"expertId": "FrontendDeveloper",
"name": "Paul",
"profession": "前端开发工程师",
"avatarUrl": "https://acc-1258344699.cos.accelerate.myqcloud.com/workbuddy/experts/avatars/02-Engineering/FrontendDeveloper/FrontendDeveloper.png",
"promptUrl": "https://acc-1258344699.cos.accelerate.myqcloud.com/workbuddy/experts/experts/02-Engineering/FrontendDeveloper/FrontendDeveloper_zh.md",
"usedAt": 1775314940465,
"industryId": "all"
}
]
},
"lastUpdated": 1775242274077
"lastUpdated": 1775314975133
}
@@ -14,3 +14,9 @@
- 删除按钮、修改日程提交按钮
- `copyEvent``pastEvent` 的 toast 提示
- `"xxx的日程"` 占位文本暂保留(后续待动态注入用户名时再处理)
## purchase/addorder 表单字段对齐后端
- 修正 `src/views/purchase/addorder.vue` 提交 payload 字段名,使其与后端 `From_purchase_addorder` 一致:`partname``styles``tracking_number``update_time`
- 同步修正对应表单控件绑定,避免物件名称、样式备注、更新时间、快递单号提交到错误字段。
@@ -37,24 +37,24 @@ const orderStatus = computed(() => ({
const costEntries = reactive([])
const newCost = reactive({
type: '1', qty: 1, cost: 0, currencyType: '1',
type: '1', int: 1, cost: 0, currencyType: '1',
})
const newCostTotal = computed(() =>
parseFloat((newCost.qty * newCost.cost).toFixed(2))
parseFloat((newCost.int * newCost.cost).toFixed(2))
)
function addCostEntry() {
if (newCost.cost <= 0) return
costEntries.push({
type: newCost.type,
qty: newCost.qty,
int: newCost.int,
cost: newCost.cost,
cost_t: newCostTotal.value,
currency_type: newCost.currencyType,
costt: newCostTotal.value,
currencytype: newCost.currencyType,
})
newCost.type = '1'
newCost.qty = 1
newCost.int = 1
newCost.cost = 0
newCost.currencyType = '1'
}
@@ -73,11 +73,11 @@ const form = reactive({
remark: '',
photos: [],
link: '',
style_remarks: '',
notes: '',
partname: '',
styles: '',
costs: [],
tracking_number: '',
express_number: '',
updatetime: '',
order_status: '1',
})
@@ -97,7 +97,7 @@ async function handleSubmit() {
form.costs = costEntries.map(h => ({
...h,
cost: Math.round(h.cost * 100),
cost_t: Math.round(h.cost_t * 100),
costt: Math.round(h.costt * 100),
}))
loading.value = true
@@ -172,7 +172,7 @@ async function handleSubmit() {
<div>
<label class="mb-1.5 block text-sm font-medium text-gray-700 dark:text-gray-300">{{ t('purchase_addorder.part_name') }}</label>
<input
v-model="form.style_remarks"
v-model="form.partname"
type="text"
class="w-full rounded-lg border border-gray-300 bg-white px-3.5 py-2 text-sm outline-none transition-colors focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 dark:border-dk-muted dark:bg-dk-base dark:text-white"
:placeholder="t('purchase_addorder.part_name')"
@@ -180,7 +180,7 @@ async function handleSubmit() {
</div>
<div>
<label class="mb-1.5 block text-sm font-medium text-gray-700 dark:text-gray-300">{{ t('purchase_addorder.style_remarks') }}</label>
<tagadder :placeholder="t('purchase_addorder.add_style')" v-model="form.notes" />
<tagadder :placeholder="t('purchase_addorder.add_style')" v-model="form.styles" />
</div>
<!-- costs table -->
@@ -201,9 +201,9 @@ async function handleSubmit() {
<tbody>
<tr v-for="(item, idx) in costEntries" :key="idx" class="border-b border-gray-100 dark:border-dk-muted">
<td class="px-3 py-2 font-medium text-gray-900 dark:text-white">{{ costType[item.type] }}</td>
<td class="px-3 py-2 text-gray-500">{{ item.qty }}</td>
<td class="px-3 py-2 text-gray-500">{{ item.int }}</td>
<td class="px-3 py-2 text-gray-500">{{ item.cost }}</td>
<td class="px-3 py-2 text-gray-500">{{ item.cost_t }}</td>
<td class="px-3 py-2 text-gray-500">{{ item.costt }}</td>
<td class="px-3 py-2 text-gray-500">{{ currencyOptions[item.currency_type] }}</td>
<td class="px-3 py-2">
<button class="rounded px-2 py-1 text-xs font-medium text-red-600 hover:bg-red-50 dark:text-red-400 dark:hover:bg-red-900/20" @click="removeCostEntry(idx)">{{ t('purchase_addorder.remove') }}</button>
@@ -224,7 +224,7 @@ async function handleSubmit() {
</div>
<div>
<label class="mb-1 block text-xs font-medium text-gray-500">{{ t('purchase_addorder.input_quantity') }}</label>
<input v-model.number="newCost.qty" type="number" class="w-full rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm dark:border-dk-muted dark:bg-dk-base dark:text-white" min="1" />
<input v-model.number="newCost.int" type="number" class="w-full rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm dark:border-dk-muted dark:bg-dk-base dark:text-white" min="1" />
</div>
<div>
<label class="mb-1 block text-xs font-medium text-gray-500">{{ t('purchase_addorder.input_fee') }}</label>
@@ -255,12 +255,12 @@ async function handleSubmit() {
<label class="mb-1.5 block text-sm font-medium text-gray-700 dark:text-gray-300">
{{ t('purchase_addorder.update_time') }} <span class="text-red-500">*</span>
</label>
<datePicker v-model="form.tracking_number" />
<datePicker v-model="form.updatetime" />
</div>
<div>
<label class="mb-1.5 block text-sm font-medium text-gray-700 dark:text-gray-300">{{ t('purchase_addorder.tracking_number') }}</label>
<input
v-model="form.express_number"
v-model="form.tracking_number"
type="text"
class="w-full rounded-lg border border-gray-300 bg-white px-3.5 py-2 text-sm outline-none transition-colors focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 dark:border-dk-muted dark:bg-dk-base dark:text-white"
:placeholder="t('purchase_addorder.input_tracking_number')"