7 Komitmen c9a8b5212f ... 31937ab9e2

Pembuat SHA1 Pesan Tanggal
  peter 31937ab9e2 feat: 创建PO.迭代7. 2 bulan lalu
  peter 1666b9861b change: indent商品模块product_type调整为必填. 2 bulan lalu
  peter e2d80f590a change: indent用户管理增加部门. 2 bulan lalu
  peter e1f02b9b67 change: indent计价导出Export_PDF_City默认值调整. 2 bulan lalu
  peter 0d4e2ec274 change: indnet报价.额外费用默认选中制版费用. 2 bulan lalu
  peter 6814276a4b fix: 修复计价step1商品图缓存异常. 2 bulan lalu
  peter d9e3526386 dependencies: update dependencies. 2 bulan lalu

+ 2 - 2
package.json

@@ -13,7 +13,7 @@
     "@element-plus/icons-vue": "^2.1.0",
     "axios": "~0.27.2",
     "dayjs": "^1.11.13",
-    "element-plus": "2.9.7",
+    "element-plus": "2.9.8",
     "html2canvas": "^1.4.1",
     "js-cookie": "^3.0.5",
     "jspdf": "3.0.1",
@@ -46,7 +46,7 @@
     "sass": "^1.85.1",
     "tailwindcss": "^3.4.17",
     "typescript": "^5.8.3",
-    "vite": "^6.2.6",
+    "vite": "^6.3.2",
     "vue-tsc": "^2.2.8"
   }
 }

+ 6 - 0
src/api/user.js

@@ -55,4 +55,10 @@ export default {
       method: 'POST',
       data: p,
     }),
+
+  getDeptList: (p) =>
+    request({
+      url: `/indent_department/getList`,
+      params: p,
+    }),
 }

+ 2 - 0
src/interface.ts

@@ -78,6 +78,8 @@ export interface IForm {
   Reference?: string // 用在 表单项:订单号 显示
   Warehouse?: string
   CF_Product_Type?: string
+  Special_QC_Requirement?: string
+  Special_Package_Requirement?: string
 }
 
 export interface IVendorItem {

+ 9 - 2
src/pages/indent-manage/indent/components/calcPrice/index.vue

@@ -45,7 +45,7 @@
               v-model="formData.cal_city.local_city"
               style="width: 120px; margin-right: 12px"
               size="small"
-              @change="($e) => (exportForm.pdf_city = $e)"
+              @change="onCityChange"
             >
               <el-option
                 v-for="city in cityList"
@@ -714,6 +714,7 @@ let getCalcParam = () => {
 }
 let close = (done = {} as any) => {
   $emit('update:visible', false)
+  imageList.value = []
   if (typeof done === 'function') done()
 }
 let resetData = () => {
@@ -879,7 +880,7 @@ let computedCityFreightParams = computed(() => {
 let initProductInfo = () => {
   const temp = cloneDeep(dataForCalc)
 
-  if (Array.isArray(temp.product_image) && temp.product_image.length) {
+  if (Array.isArray(temp.product_image)) {
     imageList.value = temp.product_image.map((img: string) => {
       return $mediaRegExp.test(img)
         ? img
@@ -1035,6 +1036,12 @@ let initForm = (switchStatus = [] as any[], useOldFormData = true) => {
     generateStep3Form(true)
   }
 }
+
+const onCityChange = (str: string) => {
+  // 没保存计价之前, 切换城市会改变pdf_city. 保存之后, 再怎么切换也用保存的数据做默认数据, 除非手动更改pdf_city
+  exportForm.value.pdf_city = productInfo.value.save_cal.pdf_city || str ||cityList.value[0]
+} 
+
 let reGenerateFormAfterCityChange = () => {
   const temp: any[] = formList.value.map((i, index) => {
     const result: any = {}

+ 2 - 2
src/pages/indent-manage/indent/components/info.vue

@@ -1130,7 +1130,7 @@ const formDemo = {
   number: [''],
   price: [''],
   days: [''],
-  cost_name: [''],
+  cost_name: ['制版费用'],
   cost_price: [''],
 
   // 包装信息
@@ -1198,7 +1198,7 @@ const costTableDeleteRow = function (index: number, subIndex: number) {
   forms.value[index].cost_price.splice(subIndex, 1)
 }
 const costTableAddRow = function (index: number) {
-  forms.value[index].cost_name.push('')
+  forms.value[index].cost_name.push('制版费用')
   forms.value[index].cost_price.push('')
 }
 const numberTableDeleteRow = function (index: number, subIndex: number) {

+ 7 - 0
src/pages/indent-manage/product/components/edit.vue

@@ -260,6 +260,13 @@ const rules = {
       trigger: 'change',
     },
   ],
+  product_type: [
+    {
+      required: true,
+      message: $t('text_please_input'),
+      trigger: 'change',
+    },
+  ],
 }
 
 watch(

+ 7 - 0
src/pages/indent-manage/product/components/examine.vue

@@ -275,6 +275,13 @@ const rules = {
       trigger: 'change',
     },
   ],
+  product_type: [
+    {
+      required: true,
+      message: $t('text_please_input'),
+      trigger: 'change',
+    },
+  ],
 }
 
 watch(

+ 31 - 0
src/pages/indent-manage/user/edit.vue

@@ -49,6 +49,18 @@
           :disabled="loading"
         ></el-input>
       </el-form-item>
+
+      <el-form-item
+        prop="department"
+        label="部门"
+      >
+        <el-select-v2
+          v-model="form.department"
+          :options="deptList"
+          filterable
+        ></el-select-v2>
+      </el-form-item>
+
       <el-form-item
         prop="password"
         label="密码"
@@ -153,6 +165,13 @@ const defaultRules = {
       trigger: 'change',
     },
   ],
+  department: [
+    {
+      required: true,
+      message: $t('text_please_input'),
+      trigger: 'change',
+    },
+  ],
 }
 let userList = ref([])
 const getUserSelectListFunc = () => {
@@ -169,6 +188,18 @@ const getUserSelectListFunc = () => {
     })
     .catch(() => console.log('获取用户下拉列表异常'))
 }
+const deptList = ref([])
+const getDeptSelectListFunc = () => {
+  userAPI.getDeptList().then((res: any) => {
+    if (res.code === 1) {
+      deptList.value = res.result.map((i: any) => ({
+        value: i.id,
+        label: i.role_name,
+      }))
+    }
+  })
+}
+getDeptSelectListFunc()
 const checkPassword = (rule: any, value: any, cb: any) => {
   const length = value.trim().length
   if (length < 6 && length > 0) {

+ 88 - 10
src/pages/purchase-order/edit.vue

@@ -1403,6 +1403,35 @@
         </div>
       </div>
     </div>
+    <el-dialog
+      v-model="specialReminderVisible"
+      width="700px"
+      style="margin-top: 30vh"
+      :title="`${soData.Order_Reminder}`"
+    >
+      <div class="flex items-center">
+        <span class="mr-2">将此特殊提醒添加到</span>
+        <div class="py-2">
+          <el-checkbox-group v-model="selectReminderType">
+            <el-checkbox
+              v-for="item in reminderTypeList"
+              :key="item"
+              :value="item"
+              :label="item"
+            ></el-checkbox>
+          </el-checkbox-group>
+        </div>
+      </div>
+      <div class="flex justify-center pt-2">
+        <el-button
+          type="primary"
+          @click="onReminderSelect"
+        >
+          OK
+        </el-button>
+        <el-button @click="specialReminderVisible = false">Cancel</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -1425,6 +1454,9 @@ import {
   ElRadio,
   ElMessageBox,
   ElTooltip,
+  ElDialog,
+  ElCheckboxGroup,
+  ElCheckbox,
 } from 'element-plus'
 import type { FormInstance } from 'element-plus'
 import { ShoppingCart, FolderAdd, Switch } from '@element-plus/icons-vue'
@@ -1434,6 +1466,7 @@ import jspdf from 'jspdf'
 import html2canvas from 'html2canvas'
 import utils from '@/utils/index'
 import variables from '@/assets/css/var.module.scss'
+import cloneDeep from 'lodash/cloneDeep'
 import {
   ServiceTypeKeyEnum,
   ISelectItem,
@@ -1857,6 +1890,8 @@ const form = ref<IForm>({
   field5: '供应商承担',
   currentVendor: '',
   Delivery_Details: '',
+  Special_QC_Requirement: '',
+  Special_Package_Requirement: '',
 })
 
 const addRow = function () {
@@ -2178,12 +2213,12 @@ const soOwner = ref('')
 const p2 = request.post('/common/getSalesOrdersDatV7', { id: route.params.id })
 
 // 获取对 该so对应客户的标注 并弹窗提醒
-const getAccountsData = async (id: string) =>
+const getAccountsData = async (id: string, Order_Reminder = '') =>
   request.post('/common/getAccountsData', { id }).then((response) => {
-    const res = response.data
-    if (res.code !== 1) return
-    if (res.result.User_Notes && res.result.User_Notes.length) {
-      ElMessageBox.confirm(res.result.User_Notes, '', {
+    const accountData = response.data
+    if (accountData.code !== 1) return
+    if (accountData.result.User_Notes && accountData.result.User_Notes.length) {
+      ElMessageBox.confirm(accountData.result.User_Notes, '', {
         confirmButtonText: '将此备注添加到合同',
         cancelButtonText: '已知悉',
         type: 'warning',
@@ -2196,7 +2231,7 @@ const getAccountsData = async (id: string) =>
           // 迭代3 需求. 固定填充一行.
           form.value.productList.push(
             Object.assign({}, emptyProductItem, {
-              requirement: res.result.User_Notes || '',
+              requirement: accountData.result.User_Notes || '',
               quantity: 1,
               rate: 0,
               id: '4791186000172849436',
@@ -2212,8 +2247,14 @@ const getAccountsData = async (id: string) =>
           )
         })
         .catch(() => {})
+        .finally(() => {
+          if (Order_Reminder) {
+            specialReminderVisible.value = true
+          }
+        })
     }
   })
+
 const getProductData = async (id: string) =>
   request.post('/common/getProductsData', { id }).then((response) => {
     const res = response.data
@@ -2228,7 +2269,7 @@ const getProductData = async (id: string) =>
           item.Supplier?.id &&
           !computedRecommandVendorID.value.includes(item.Supplier.id)
         ) {
-          console.log(item, 'item')
+          // console.log(item, 'item')
           recommandVendor.value.push({
             id: item.Supplier.id,
             name: item.Supplier.name,
@@ -2272,14 +2313,51 @@ const p3 = request
     }
   })
 const preferSupplier = ref([] as any[])
-Promise.all([p1, p2, p3, getAccountsData])
+const specialReminderVisible = ref(false)
+let selectReminderType = ref([] as string[])
+const reminderTypeList = ref(['QC Item', 'Package Notes', 'Purchase Order'])
+const onReminderSelect = () => {
+  if (selectReminderType.value.length === 0) {
+    ElMessage.error('请选择至少一个选项')
+    return
+  }
+  if (selectReminderType.value.includes('QC Item')) {
+    form.value.Special_QC_Requirement = soData.value.Order_Reminder || ''
+  }
+  if (selectReminderType.value.includes('Package Notes')) {
+    form.value.Special_Package_Requirement = soData.value.Order_Reminder || ''
+  }
+  if (selectReminderType.value.includes('Purchase Order')) {
+    form.value.productList.push(
+      Object.assign({}, emptyProductItem, {
+        requirement: soData.value.Order_Reminder || '',
+        quantity: 1,
+        rate: 0,
+        id: '4791186000172849436',
+        name: 'User Notes',
+        CF_Product_Type: '',
+        candidate: [
+          {
+            label: 'User Notes',
+            value: '4791186000172849436',
+          },
+        ],
+      }),
+    )
+  }
+  specialReminderVisible.value = false
+}
+const soData = ref({ Order_Reminder: '' } as any)
+Promise.all([p1, p2, p3])
   .then((array: any[]) => {
+    console.log(222, '222')
     // p2的数据处理逻辑从原本的p2then移动到这里处理.
     // 因为要根据p3用户数据的Organization 来填充产品列表里面的 requirement, 这步处理必须放在p3后面, 而p2 p3是并发操作.
     if (array[1].data.code !== 1) return
     const res = array[1].data.result
+    soData.value = Object.assign({ Order_Reminder: '' }, cloneDeep(res))
     if (res.Account_Name && res.Account_Name.id) {
-      getAccountsData(res.Account_Name.id)
+      getAccountsData(res.Account_Name.id, res.Order_Reminder)
     }
     form.value.field7 = res.Owner_name || res.Owner.name || ''
     soOwner.value = res.Owner_name || res.Owner.name || ''
@@ -2301,7 +2379,7 @@ Promise.all([p1, p2, p3, getAccountsData])
     recommandVendor.value = []
     temp.forEach((item: any) => {
       getProductData(item.Product_Name.id).then((ctx) => {
-        console.log(ctx, 'product ctx')
+        // console.log(ctx, 'product ctx')
         form.value.productList.push(
           Object.assign({}, emptyProductItem, {
             candidate: [