Jelajahi Sumber

销售询价单-询价有效期展示样式修改

jingbb 5 bulan lalu
induk
melakukan
e249fc1f2c

+ 22 - 14
src/views/saleCode/saleInquiryForm/SaleInquiryForm.data.ts

@@ -32,25 +32,33 @@ export const columns: BasicColumn[] = [
     dataIndex: 'inquiryCustomer_dictText'
    },
    {
-    title: '询价有效期(inquiry period)',
+    title: '询价有效期(inquiry period)',
     align:"center",
-    dataIndex: 'inquiryPeriodBegin',
+    dataIndex: 'time',
     width:250,
-    customRender:({text}) =>{
-      text = !text ? "" : (text.length > 10 ? text.substr(0,10) : text);
-      return text;
-    },
-   },
-   {
-    title: '询价有效期(inquiry period)止',
-    align:"center",
-    width:250,
-    dataIndex: 'inquiryPeriodEnd',
-    customRender:({text}) =>{
-      text = !text ? "" : (text.length > 10 ? text.substr(0,10) : text);
+    customRender:({text,record}) =>{
+      if(record.inquiryPeriodBegin&&record.inquiryPeriodEnd){
+        text = record.inquiryPeriodBegin+'~'+record.inquiryPeriodEnd
+      }else if(!record.inquiryPeriodBegin){
+        text = record.inquiryPeriodEnd
+      }else if(!record.inquiryPeriodEnd){
+        text = record.inquiryPeriodBegin
+      }else{
+        text=''
+      }
       return text;
     },
    },
+  //  {
+  //   title: '询价有效期(inquiry period)止',
+  //   align:"center",
+  //   width:250,
+  //   dataIndex: 'inquiryPeriodEnd',
+  //   customRender:({text}) =>{
+  //     text = !text ? "" : (text.length > 10 ? text.substr(0,10) : text);
+  //     return text;
+  //   },
+  //  },
    {
     title: '询价平台(inquiry platform)',
     align:"center",

+ 20 - 13
src/views/saleCode/saleInquiryForm/components/SaleInquiryFormForm.vue

@@ -35,13 +35,8 @@
 							</a-form-item>
 						</a-col>
 						<a-col :span="12">
-							<a-form-item label="询价有效期(inquiry period)止" v-bind="validateInfos.inquiryPeriodEnd" id="SaleInquiryFormForm-inquiryPeriodEnd" name="inquiryPeriodEnd">
-								<a-date-picker placeholder="请选择询价有效期(inquiry period)止"  v-model:value="formData.inquiryPeriodEnd" value-format="YYYY-MM-DD"  style="width: 100%"  allow-clear />
-							</a-form-item>
-						</a-col>
-						<a-col :span="12">
-							<a-form-item label="询价有效期(inquiry period)始" v-bind="validateInfos.inquiryPeriodBegin" id="SaleInquiryFormForm-inquiryPeriodBegin" name="inquiryPeriodBegin">
-								<a-date-picker placeholder="请选择询价有效期(inquiry period)始"  v-model:value="formData.inquiryPeriodBegin" value-format="YYYY-MM-DD"  style="width: 100%"  allow-clear />
+							<a-form-item label="询价有效期(inquiry period)" v-bind="validateInfos.inquiryPeriodEnd" id="SaleInquiryFormForm-inquiryPeriodEnd" name="inquiryPeriodEnd">
+                <a-range-picker v-model:value="inquiryPeriod" :format="['YYYY-MM-DD','YYYY-MM-DD']"  @change="onChangeInquiryPeriod" style="width: 100%" />
 							</a-form-item>
 						</a-col>
 						<a-col :span="12">
@@ -79,16 +74,17 @@
                 <JSelectUser v-model:value="formData.salesman" placeholder="请选择" :multiple="false"></JSelectUser>
 							</a-form-item>
 						</a-col>
-						<a-col :span="12">
-							<a-form-item label="采购询价组(procurement inquiry team)" v-bind="validateInfos.inquiryTeam" id="SaleInquiryFormForm-inquiryTeam" name="inquiryTeam">
-                <JDictSelectTag v-model:value="formData.inquiryTeam" placeholder="请选择" dictCode="procurement_inquiry_team"/>
+            <a-col :span="12">
+							<a-form-item label="交期(delivery time)" v-bind="validateInfos.deliveryTime" id="SaleInquiryFormForm-deliveryTime" name="deliveryTime">
+								<a-date-picker placeholder="请选择交期(delivery time)"  v-model:value="formData.deliveryTime"  value-format="YYYY-MM-DD" format="YYYY-MM-DD" style="width: 100%"  allow-clear />
 							</a-form-item>
 						</a-col>
 						<a-col :span="12">
-							<a-form-item label="交期(delivery time)" v-bind="validateInfos.deliveryTime" id="SaleInquiryFormForm-deliveryTime" name="deliveryTime">
-								<a-date-picker placeholder="请选择交期(delivery time)"  v-model:value="formData.deliveryTime"  value-format="YYYY-MM-DD" format="YYYY-MM-DD" style="width: 100%"  allow-clear />
+							<a-form-item label="采购询价组(procurement inquiry team)" v-bind="validateInfos.inquiryTeam" id="SaleInquiryFormForm-inquiryTeam" name="inquiryTeam">
+                <JDictSelectTag v-model:value="formData.inquiryTeam" placeholder="请选择" dictCode="procurement_inquiry_team"/>
 							</a-form-item>
 						</a-col>
+						
             <a-col :span="12">
 							<a-form-item label="询价备注(inquiry notes)" v-bind="validateInfos.inquiryNotes" id="SaleInquiryFormForm-inquiryNotes" name="inquiryNotes">
 								<a-input v-model:value="formData.inquiryNotes" placeholder="请输入询价备注(inquiry notes)"  allow-clear ></a-input>
@@ -211,6 +207,7 @@
       const formRef = ref();
       var SelectPrpductModalRef = ref()
       var SelectProjectModalRef = ref()
+      var inquiryPeriod = ref([])
       const saleInquiryFormShipTableRef = ref();
       const saleInquiryFormShipTable = reactive<Record<string, any>>({
         loading: false,
@@ -286,6 +283,7 @@
         activeKey.value = 'saleInquiryFormShip'
         getOptiom()
         getCustomerOptions()
+           inquiryPeriod.value = []
       }
 
       async function edit(row) {
@@ -298,6 +296,8 @@
         saleInquiryFormProductTable.dataSource = [...saleInquiryFormProductDataList];
         getOptiom()
         getCustomerOptions()
+          inquiryPeriod.value[0]=formData.inquiryPeriodBegin?moment(formData.inquiryPeriodBegin):''
+          inquiryPeriod.value[1]=formData.inquiryPeriodEnd?moment(formData.inquiryPeriodEnd):''
       }
 
       async function queryMainData(id) {
@@ -459,6 +459,11 @@
                 // loading.value = false;
             });
       }
+      function onChangeInquiryPeriod(data){
+        inquiryPeriod.value = data
+        formData.inquiryPeriodBegin = data[0].format('YYYY-MM-DD')
+        formData.inquiryPeriodEnd = data[1].format('YYYY-MM-DD')
+      }
       return {
         saleInquiryFormShipTableRef,
         saleInquiryFormShipTable,
@@ -496,7 +501,9 @@
         getOptiom,
         classOption,
         getCustomerOptions,
-        customerOption
+        customerOption,
+        inquiryPeriod,
+        onChangeInquiryPeriod
       }
     }
   });