|
@@ -24,6 +24,10 @@
|
|
>
|
|
>
|
|
<div class="flex justify-between flex-wrap">
|
|
<div class="flex justify-between flex-wrap">
|
|
<el-form-item
|
|
<el-form-item
|
|
|
|
+ :rules="{
|
|
|
|
+ required: true,
|
|
|
|
+ }"
|
|
|
|
+ prop="product_sku"
|
|
label="SKU"
|
|
label="SKU"
|
|
style="height: 40px"
|
|
style="height: 40px"
|
|
>
|
|
>
|
|
@@ -31,6 +35,11 @@
|
|
class="el-input el-input__wrapper el-input__inner fake-sku-input"
|
|
class="el-input el-input__wrapper el-input__inner fake-sku-input"
|
|
@click="openSkuSelect(props.$index)"
|
|
@click="openSkuSelect(props.$index)"
|
|
>
|
|
>
|
|
|
|
+ <el-input
|
|
|
|
+ style="display: none"
|
|
|
|
+ v-model="formList[props.$index].product_sku"
|
|
|
|
+ ></el-input>
|
|
|
|
+
|
|
<span class="cursor-pointer">
|
|
<span class="cursor-pointer">
|
|
{{ formList[props.$index].product_sku }}
|
|
{{ formList[props.$index].product_sku }}
|
|
</span>
|
|
</span>
|
|
@@ -203,6 +212,32 @@
|
|
></el-option>
|
|
></el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
+ <el-form-item
|
|
|
|
+ label="客户名称"
|
|
|
|
+ prop="custom_name"
|
|
|
|
+ :rules="{
|
|
|
|
+ required: true,
|
|
|
|
+ }"
|
|
|
|
+ >
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="formList[props.$index].custom_name"
|
|
|
|
+ style="width: 100%"
|
|
|
|
+ :placeholder="$t('text_please_select')"
|
|
|
|
+ :remote-method="debounce(getCustomListFun, 500)"
|
|
|
|
+ :loading="customLoading"
|
|
|
|
+ remote
|
|
|
|
+ filterable
|
|
|
|
+ @change="selectCustomer"
|
|
|
|
+ :disabled="!!indentData.enquiry_id"
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="(option, index) in customList"
|
|
|
|
+ :key="option.id || index"
|
|
|
|
+ :label="option.name"
|
|
|
|
+ :value="option.name"
|
|
|
|
+ ></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
</div>
|
|
</div>
|
|
<div class="flex justify-end">
|
|
<div class="flex justify-end">
|
|
<el-button
|
|
<el-button
|
|
@@ -362,6 +397,9 @@ import {
|
|
import { Notebook } from '@element-plus/icons-vue'
|
|
import { Notebook } from '@element-plus/icons-vue'
|
|
import Cookie from 'js-cookie'
|
|
import Cookie from 'js-cookie'
|
|
import { getCalcPriceRecord, generateOrder } from '@/api/indent'
|
|
import { getCalcPriceRecord, generateOrder } from '@/api/indent'
|
|
|
|
+import debounce from 'lodash.debounce'
|
|
|
|
+import { $t } from '@/i18n/index'
|
|
|
|
+import { getCustomList } from '@/api/indent'
|
|
import userAPI from '@/api/user'
|
|
import userAPI from '@/api/user'
|
|
import skuSelect from './skuSelect.vue'
|
|
import skuSelect from './skuSelect.vue'
|
|
|
|
|
|
@@ -438,6 +476,9 @@ const getCalcPriceRecordFunc = () => {
|
|
const v = list.value[i].Accounts || ({} as any)
|
|
const v = list.value[i].Accounts || ({} as any)
|
|
// remoteOption.value.push([])
|
|
// remoteOption.value.push([])
|
|
formList.value.push({
|
|
formList.value.push({
|
|
|
|
+ // custom_id 不存在说明是旧系统的数据, 需要置空让用户重新选客户
|
|
|
|
+ custom_name: indentData.custom_id ? indentData.custom_name : '',
|
|
|
|
+ custom_id: indentData.custom_id || '', // 联动custom_name
|
|
item_id: indentData.item_id || '',
|
|
item_id: indentData.item_id || '',
|
|
product_name: indentData.product_name || '',
|
|
product_name: indentData.product_name || '',
|
|
product_sku: indentData.product_sku || '',
|
|
product_sku: indentData.product_sku || '',
|
|
@@ -524,6 +565,22 @@ const submitChangeOrder = (index: number) => {
|
|
})
|
|
})
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+ if (!data.product_sku || !data.product_name) {
|
|
|
|
+ ElNotification({
|
|
|
|
+ title: 'SKU/产品名称不能为空',
|
|
|
|
+ message: '请选择正确的SKU进行转单',
|
|
|
|
+ duration: 5000,
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (!data.custom_id || !data.custom_name) {
|
|
|
|
+ ElNotification({
|
|
|
|
+ title: '客户名称 数据出错',
|
|
|
|
+ message: '如果界面上的客户名称有值, 请联系管理员',
|
|
|
|
+ duration: 5000,
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
console.log(data, 'data')
|
|
console.log(data, 'data')
|
|
onChangeOrderClick(data)
|
|
onChangeOrderClick(data)
|
|
})
|
|
})
|
|
@@ -600,6 +657,40 @@ const selectSku = (data: any) => {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+// 客户下拉框候选列表
|
|
|
|
+const customList = ref([] as any[])
|
|
|
|
+let customLoading = ref(false)
|
|
|
|
+const selectCustomer = (data: any) => {
|
|
|
|
+ const temp = customList.value.filter((i: any) => i.name === data)
|
|
|
|
+ if (temp.length === 0) {
|
|
|
|
+ ElMessage.error('客户名称不存在, 请重新选择')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ formList.value = formList.value.map((i: any) => {
|
|
|
|
+ return {
|
|
|
|
+ ...i,
|
|
|
|
+ custom_name: temp[0].name || '',
|
|
|
|
+ custom_id: temp[0].id || '',
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+const getCustomListFun = (keyword: string) => {
|
|
|
|
+ let keywords = keyword.trim()
|
|
|
|
+ if (!keywords.length) return
|
|
|
|
+ customLoading.value = true
|
|
|
|
+ customList.value = []
|
|
|
|
+ getCustomList({ keywords })
|
|
|
|
+ .then((response: any) => {
|
|
|
|
+ if (Array.isArray(response.result)) {
|
|
|
|
+ customList.value = response.result.length ? response.result : []
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ .finally(() => {
|
|
|
|
+ customLoading.value = false
|
|
|
|
+ })
|
|
|
|
+}
|
|
</script>
|
|
</script>
|
|
<style lang="scss">
|
|
<style lang="scss">
|
|
.dialog-change-order {
|
|
.dialog-change-order {
|