|
@@ -46,7 +46,7 @@
|
|
|
disabled
|
|
|
style="display: none"
|
|
|
></el-input>
|
|
|
- <div class="">{{ form.creator_userid }}</div>
|
|
|
+ <div style="font-weight: bold">{{ firstName }}</div>
|
|
|
</el-form-item>
|
|
|
<el-form-item
|
|
|
prop="so_ref"
|
|
@@ -167,16 +167,43 @@
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
|
|
|
- <el-form-item
|
|
|
- prop="addr"
|
|
|
- label="地址"
|
|
|
- >
|
|
|
- <el-input
|
|
|
- v-model="form.addr"
|
|
|
- placeholder="如选直送客户,寄送地址请附在此处"
|
|
|
- type="textarea"
|
|
|
- :rows="4"
|
|
|
- ></el-input>
|
|
|
+ <el-form-item label="地址">
|
|
|
+ <div class="addr-input-group">
|
|
|
+ <el-input
|
|
|
+ v-model="form.ATTN"
|
|
|
+ placeholder="ATTN"
|
|
|
+ ></el-input>
|
|
|
+ <el-input
|
|
|
+ v-model="form.Phone"
|
|
|
+ placeholder="Phone"
|
|
|
+ ></el-input>
|
|
|
+ <el-input
|
|
|
+ v-model="form.Shipping_Unit_Building_Name"
|
|
|
+ placeholder="Shipping_Unit/Building_Name"
|
|
|
+ type="textarea"
|
|
|
+ rows="1"
|
|
|
+ ></el-input>
|
|
|
+ <el-input
|
|
|
+ v-model="form.Shipping_Street"
|
|
|
+ placeholder="Shipping_Street"
|
|
|
+ ></el-input>
|
|
|
+ <el-input
|
|
|
+ v-model="form.Shipping_City"
|
|
|
+ placeholder="Shipping_City"
|
|
|
+ ></el-input>
|
|
|
+ <el-input
|
|
|
+ v-model="form.Shipping_State"
|
|
|
+ placeholder="Shipping_State"
|
|
|
+ ></el-input>
|
|
|
+ <el-input
|
|
|
+ v-model="form.Shipping_Code"
|
|
|
+ placeholder="Shipping_Code"
|
|
|
+ ></el-input>
|
|
|
+ <el-input
|
|
|
+ v-model="form.Shipping_Country"
|
|
|
+ placeholder="Shipping_Country"
|
|
|
+ ></el-input>
|
|
|
+ </div>
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item
|
|
@@ -294,11 +321,15 @@
|
|
|
<el-table :data="form.goods">
|
|
|
<el-table-column label="品名">
|
|
|
<template #default="scope">
|
|
|
- <el-input v-model="scope.row.name"></el-input>
|
|
|
+ <el-input
|
|
|
+ v-model="scope.row.name"
|
|
|
+ disabled
|
|
|
+ ></el-input>
|
|
|
<el-input
|
|
|
v-model="scope.row.desc"
|
|
|
type="textarea"
|
|
|
row="3"
|
|
|
+ disabled
|
|
|
style="margin-top: 8px"
|
|
|
></el-input>
|
|
|
</template>
|
|
@@ -430,18 +461,19 @@ const form = ref({
|
|
|
trans: '',
|
|
|
number: '',
|
|
|
weight: '',
|
|
|
- addr: '',
|
|
|
+ ATTN: '',
|
|
|
+ Phone: '',
|
|
|
+ Shipping_Unit_Building_Name: '',
|
|
|
+ Shipping_Street: '',
|
|
|
+ Shipping_City: '',
|
|
|
+ Shipping_State: '',
|
|
|
+ Shipping_Code: '',
|
|
|
+ Shipping_Country: '',
|
|
|
comment: '',
|
|
|
archer: '',
|
|
|
price: [{ pa: '', pb: '' }],
|
|
|
goods: [] as any[],
|
|
|
- files: [
|
|
|
- // {
|
|
|
- // file_id:
|
|
|
- // '3ZEDMgSxc5WGR-sUbCIfGANv6ew8itx-KGdvpU2r7m-FUF3UO-Ycv-kOo3NUSbN0G',
|
|
|
- // name: 'cat.jpg',
|
|
|
- // },
|
|
|
- ] as { file_id: string; name: string }[], // 附件
|
|
|
+ files: [] as { file_id: string; name: string }[], // 附件
|
|
|
})
|
|
|
const rules = ref<FormRules>({
|
|
|
creator_userid: [{ required: true, message: '必填项', trigger: 'blur' }],
|
|
@@ -694,26 +726,30 @@ const soData = ref(
|
|
|
Contract_Title: string
|
|
|
Reference: string
|
|
|
Pkg_details: any[]
|
|
|
- Ordered_Items: any[]
|
|
|
+ Product_Details: any[]
|
|
|
},
|
|
|
)
|
|
|
|
|
|
const resetGoods = function () {
|
|
|
- if (Array.isArray(soData.value.Pkg_details)) {
|
|
|
+ if (
|
|
|
+ Array.isArray(soData.value.Pkg_details) &&
|
|
|
+ soData.value.Pkg_details.length
|
|
|
+ ) {
|
|
|
form.value.goods = soData.value.Pkg_details.map((i: any) => {
|
|
|
return {
|
|
|
name: i.Product?.name || '',
|
|
|
desc: i.Description || '',
|
|
|
- quantity: i.Quantity || '',
|
|
|
+ quantity: i.Quantity || 0,
|
|
|
number: '',
|
|
|
}
|
|
|
})
|
|
|
- } else if (Array.isArray(soData.value.Ordered_Items)) {
|
|
|
- form.value.goods = soData.value.Ordered_Items.map((i: any) => {
|
|
|
+ } else if (Array.isArray(soData.value.Product_Details)) {
|
|
|
+ form.value.goods = soData.value.Product_Details.map((i: any) => {
|
|
|
+ console.log('iii')
|
|
|
return {
|
|
|
- name: i.product || '',
|
|
|
- desc: i.description || '',
|
|
|
- quantity: i.quantity || '',
|
|
|
+ name: i.product.name || '',
|
|
|
+ desc: i.product_description || '',
|
|
|
+ quantity: i.quantity || 0,
|
|
|
number: '',
|
|
|
}
|
|
|
})
|
|
@@ -721,6 +757,7 @@ const resetGoods = function () {
|
|
|
form.value.goods = []
|
|
|
}
|
|
|
}
|
|
|
+const firstName = ref('')
|
|
|
request
|
|
|
.post('/common/getSalesOrdersData', {
|
|
|
id: route.params.id,
|
|
@@ -729,25 +766,28 @@ request
|
|
|
const d = res.data.result
|
|
|
if (res.status === 200 && res.data.code === 1) {
|
|
|
soData.value = d
|
|
|
+ if (d.Package_not_complate === true) {
|
|
|
+ ElNotification({
|
|
|
+ duration: 0,
|
|
|
+ type: 'error',
|
|
|
+ title: '出错啦!',
|
|
|
+ message: 'Please confirm current package before a create a new one',
|
|
|
+ })
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ firstName.value = (route.query.firstName as string) || ''
|
|
|
form.value.creator_userid = (route.query.userName as string) || ''
|
|
|
form.value.job_name = d.Contract_Title
|
|
|
form.value.so_ref = d.Reference
|
|
|
- form.value.addr = (
|
|
|
- (d.ATTN ? `ATTN ${d.ATTN}; ` : '') +
|
|
|
- (d.Phone ? `Phone ${d.Phone}` : '') +
|
|
|
- '\n' +
|
|
|
- d.Shipping_Unit_Building_Name +
|
|
|
- ', ' +
|
|
|
- d.Shipping_Street +
|
|
|
- ', ' +
|
|
|
- d.Shipping_City +
|
|
|
- ', ' +
|
|
|
- d.Shipping_State +
|
|
|
- ', ' +
|
|
|
- d.Shipping_Code +
|
|
|
- ', ' +
|
|
|
- d.Shipping_Country
|
|
|
- ).trim()
|
|
|
+ form.value.ATTN = d.ATTN || ''
|
|
|
+ form.value.Phone = d.Phone || ''
|
|
|
+ form.value.Shipping_Unit_Building_Name =
|
|
|
+ d.Shipping_Unit_Building_Name || ''
|
|
|
+ form.value.Shipping_Street = d.Shipping_Street || ''
|
|
|
+ form.value.Shipping_City = d.Shipping_City || ''
|
|
|
+ form.value.Shipping_State = d.Shipping_State || ''
|
|
|
+ form.value.Shipping_Code = d.Shipping_Code || ''
|
|
|
+ form.value.Shipping_Country = d.Shipping_Country || ''
|
|
|
}
|
|
|
resetGoods()
|
|
|
})
|
|
@@ -818,7 +858,7 @@ const checkForm = function (formEl: FormInstance | undefined) {
|
|
|
}
|
|
|
const submit = function () {
|
|
|
// 接口
|
|
|
- const d = {
|
|
|
+ const d: any = {
|
|
|
creator_userid: form.value.creator_userid,
|
|
|
template_id: '3TmmDAekrafuPCvjxB9TqYwrmk5uj6XGoxseaD1J', // 申请模版 的id
|
|
|
use_template_approver: 1, // 使用此模板在管理后台设置的审批流程
|
|
@@ -916,7 +956,24 @@ const submit = function () {
|
|
|
control: 'Textarea',
|
|
|
id: 'Textarea-1718769752197',
|
|
|
value: {
|
|
|
- text: form.value.addr,
|
|
|
+ text: (
|
|
|
+ (form.value.ATTN ? `ATTN ${form.value.ATTN}; ` : '') +
|
|
|
+ (form.value.Phone ? `Phone ${form.value.Phone}` : '') +
|
|
|
+ '\n' +
|
|
|
+ form.value.Shipping_Unit_Building_Name +
|
|
|
+ ', ' +
|
|
|
+ form.value.Shipping_Street +
|
|
|
+ ', ' +
|
|
|
+ form.value.Shipping_City +
|
|
|
+ ', ' +
|
|
|
+ form.value.Shipping_State +
|
|
|
+ ', ' +
|
|
|
+ form.value.Shipping_Code +
|
|
|
+ ', ' +
|
|
|
+ form.value.Shipping_Country
|
|
|
+ )
|
|
|
+ .trim()
|
|
|
+ .replace('null', ''),
|
|
|
},
|
|
|
},
|
|
|
{
|
|
@@ -1019,6 +1076,14 @@ const submit = function () {
|
|
|
id: 'Table-1718950612643',
|
|
|
value: {
|
|
|
children: form.value.goods.map((g) => {
|
|
|
+ setTimeout(() => {
|
|
|
+ ElNotification({
|
|
|
+ duration: 0,
|
|
|
+ type: 'warning',
|
|
|
+ title: '注意',
|
|
|
+ message: `${g.name} 发货数量${g.number}大于可发货数量${g.quantity}`,
|
|
|
+ })
|
|
|
+ }, 0)
|
|
|
return {
|
|
|
list: [
|
|
|
{
|
|
@@ -1060,6 +1125,8 @@ const submit = function () {
|
|
|
},
|
|
|
})
|
|
|
}
|
|
|
+ d.sales_order_detail = soData.value
|
|
|
+ d.origin_form = form.value
|
|
|
console.log(d, 'form data')
|
|
|
loading.value = true
|
|
|
request
|
|
@@ -1115,7 +1182,7 @@ input[type='number'] {
|
|
|
<style lang="scss" scoped>
|
|
|
.main-content {
|
|
|
background-color: #fff;
|
|
|
- padding: 12px 40px;
|
|
|
+ padding: 12px 40px 12px;
|
|
|
width: 1000px;
|
|
|
min-width: 1000px;
|
|
|
min-height: 100vh;
|
|
@@ -1125,6 +1192,7 @@ input[type='number'] {
|
|
|
0 0.5em 1em rgba(0, 0, 0, 0.6);
|
|
|
}
|
|
|
.logo-area {
|
|
|
+ padding: 12px 0 12px;
|
|
|
img {
|
|
|
position: relative;
|
|
|
left: -16px;
|
|
@@ -1144,4 +1212,13 @@ input[type='number'] {
|
|
|
line-height: 16px;
|
|
|
right: 16px;
|
|
|
}
|
|
|
+.addr-input-group {
|
|
|
+ .el-input,
|
|
|
+ .el-textarea {
|
|
|
+ margin-bottom: 10px;
|
|
|
+ &:last-of-type {
|
|
|
+ margin-bottom: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|