|
@@ -230,6 +230,7 @@
|
|
>
|
|
>
|
|
提交
|
|
提交
|
|
</el-button>
|
|
</el-button>
|
|
|
|
+ <!-- <el-button @click="toApplyVendor">test</el-button> -->
|
|
</div>
|
|
</div>
|
|
</el-form>
|
|
</el-form>
|
|
</template>
|
|
</template>
|
|
@@ -370,7 +371,9 @@ import {
|
|
ElIcon,
|
|
ElIcon,
|
|
} from 'element-plus'
|
|
} from 'element-plus'
|
|
import { Notebook } from '@element-plus/icons-vue'
|
|
import { Notebook } from '@element-plus/icons-vue'
|
|
|
|
+import Cookie from 'js-cookie'
|
|
import { getCalcPriceRecord, generateOrder } from '@/api/indent'
|
|
import { getCalcPriceRecord, generateOrder } from '@/api/indent'
|
|
|
|
+import userAPI from '@/api/user'
|
|
import skuSelect from './skuSelect.vue'
|
|
import skuSelect from './skuSelect.vue'
|
|
|
|
|
|
defineComponent({
|
|
defineComponent({
|
|
@@ -391,6 +394,30 @@ let show2 = ref(false)
|
|
let loading = ref(false)
|
|
let loading = ref(false)
|
|
let list = ref([] as any[])
|
|
let list = ref([] as any[])
|
|
// let remoteOption = ref([])
|
|
// let remoteOption = ref([])
|
|
|
|
+let user: any = ref({} as any)
|
|
|
|
+const getUserDetailFunc = () => {
|
|
|
|
+ let indentID = Cookie.get('indent-id') || ''
|
|
|
|
+ let indentName = Cookie.get('indent-user') || ''
|
|
|
|
+ console.log(indentID, 'indentID')
|
|
|
|
+ console.log(indentName, 'indentName')
|
|
|
|
+ // 由于历史原因, 早期登录时没有记录下用户id, 只有用户名称.
|
|
|
|
+ if (indentID) {
|
|
|
|
+ userAPI.getUserDetail({ id: indentID }).then((res: any) => {
|
|
|
|
+ if (res.code === 1) {
|
|
|
|
+ user.value = res.result || {}
|
|
|
|
+ console.log(res.result, 'res')
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ } else if (indentName) {
|
|
|
|
+ // get user by name
|
|
|
|
+ userAPI.getUserDetailByName({ username: indentName }).then((res: any) => {
|
|
|
|
+ if (res.code === 1) {
|
|
|
|
+ user.value = res.result || {}
|
|
|
|
+ console.log(res.result, 'res')
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
|
|
watch(
|
|
watch(
|
|
() => visible,
|
|
() => visible,
|
|
@@ -398,6 +425,7 @@ watch(
|
|
show.value = visible
|
|
show.value = visible
|
|
if (show.value) {
|
|
if (show.value) {
|
|
getCalcPriceRecordFunc()
|
|
getCalcPriceRecordFunc()
|
|
|
|
+ getUserDetailFunc()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
)
|
|
)
|
|
@@ -510,6 +538,19 @@ const submitChangeOrder = (index: number) => {
|
|
onChangeOrderClick(data)
|
|
onChangeOrderClick(data)
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+// 跳转到申请录入供应商的外部页面.
|
|
|
|
+const toApplyVendor = () => {
|
|
|
|
+ // 找出当前转单的记录. 必定存在, 不然进不来这个组件.
|
|
|
|
+ let a = indentData.lists.filter((i: any) => i.id === id)
|
|
|
|
+ let tt = a[0] || {}
|
|
|
|
+ console.log(tt, 'tt')
|
|
|
|
+ // 为空或者不是纯数字, 说明这个id不是真的在crm的供应商id
|
|
|
|
+ if ([null, 'null', ''].includes(tt.vendor_id) || !/\d+/.test(tt.vendor_id)) {
|
|
|
|
+ window.open(
|
|
|
|
+ `https://forms.zohopublic.com/promocollectionau/form/SupplierCreationRequirements/formperma/ArflvTSXGDW--ONLT9Wgo5t0N1XLRJ8wGErjacQZl5g?email=${user.value.email || ''}&vendor=${encodeURIComponent(tt.vendor_name)}&name=${encodeURIComponent(tt.vendor_contact)}&phone=${tt.vendor_phone}`,
|
|
|
|
+ )
|
|
|
|
+ }
|
|
|
|
+}
|
|
const onChangeOrderClick = (row: any) => {
|
|
const onChangeOrderClick = (row: any) => {
|
|
ElMessageBox.confirm('选择该条计价记录进行转单, 是否继续?', '提示', {
|
|
ElMessageBox.confirm('选择该条计价记录进行转单, 是否继续?', '提示', {
|
|
confirmButtonText: '确定',
|
|
confirmButtonText: '确定',
|
|
@@ -535,6 +576,7 @@ const onChangeOrderClick = (row: any) => {
|
|
`${id}` +
|
|
`${id}` +
|
|
import.meta.env.VITE_SO_APPEND,
|
|
import.meta.env.VITE_SO_APPEND,
|
|
)
|
|
)
|
|
|
|
+ toApplyVendor()
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
ElNotification({
|
|
ElNotification({
|