From b306d1106b915bb13fd7a02217ae9c65de2fd03d Mon Sep 17 00:00:00 2001
From: ws183 <1143478319@qq.com>
Date: 星期一, 28 四月 2025 17:19:52 +0800
Subject: [PATCH] 新增质检页面附件上传

---
 igds-core/src/main/java/com/ld/igds/m/view/QualityManager.view.xml |  223 +++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 172 insertions(+), 51 deletions(-)

diff --git a/igds-core/src/main/java/com/ld/igds/m/view/QualityManager.view.xml b/igds-core/src/main/java/com/ld/igds/m/view/QualityManager.view.xml
index 647835a..611f58f 100644
--- a/igds-core/src/main/java/com/ld/igds/m/view/QualityManager.view.xml
+++ b/igds-core/src/main/java/com/ld/igds/m/view/QualityManager.view.xml
@@ -69,7 +69,7 @@
       </PropertyDef>
       <PropertyDef name="time">
         <Property name="label">妫�楠屾椂闂�</Property>
-        <Property name="dataType">Date</Property>
+        <Property name="dataType">DateTime</Property>
         <Property name="required">true</Property>
       </PropertyDef>
       <PropertyDef name="result">
@@ -168,6 +168,7 @@
       <PropertyDef name="ypbh">
         <Property></Property>
         <Property name="label">鏍峰搧缂栧彿</Property>
+        <Property name="required">true</Property>
       </PropertyDef>
       <PropertyDef name="updateTime">
         <Property name="dataType">Date</Property>
@@ -176,6 +177,46 @@
       <PropertyDef name="spaqzbsfhg">
         <Property></Property>
         <Property name="label">椋熷搧鏄惁鍚堟牸</Property>
+        <Property name="mapping">
+          <Property name="keyProperty">code</Property>
+          <Property name="valueProperty">name</Property>
+          <Property name="mapValues">
+            <Collection>
+              <Entity>
+                <Property name="name">0-涓嶅悎鏍�</Property>
+                <Property name="code">0</Property>
+              </Entity>
+              <Entity>
+                <Property name="name">1-鍚堟牸</Property>
+                <Property name="code">1</Property>
+              </Entity>
+            </Collection>
+          </Property>
+        </Property>
+        <Property name="required">true</Property>
+      </PropertyDef>
+      <PropertyDef name="reportType">
+        <Property name="label">鎶ュ憡绫诲瀷</Property>
+        <Property name="mapping">
+          <Property name="keyProperty">code</Property>
+          <Property name="valueProperty">name</Property>
+          <Property name="mapValues">
+            <Collection>
+              <Entity>
+                <Property name="name">1-鍗曚綅妫�楠�</Property>
+                <Property name="code">1</Property>
+              </Entity>
+              <Entity>
+                <Property name="name">2-鏁翠綋妫�楠�(鍔犳潈骞冲潎)</Property>
+                <Property name="code">2</Property>
+              </Entity>
+              <Entity>
+                <Property name="name">3-鍏朵粬</Property>
+                <Property name="code">3</Property>
+              </Entity>
+            </Collection>
+          </Property>
+        </Property>
       </PropertyDef>
       <Reference name="checkItems">
         <Property name="dataProvider">checkStandardPR#listCheckItemsByParam</Property>
@@ -188,6 +229,20 @@
           </Entity>
         </Property>
       </Reference>
+      <PropertyDef name="fileId">
+        <Property></Property>
+        <Property name="label">闄勪欢id</Property>
+      </PropertyDef>
+      <PropertyDef name="fileName">
+        <Property></Property>
+        <Property name="label">闄勪欢鍚嶇О</Property>
+        <Property name="readOnly">true</Property>
+      </PropertyDef>
+      <PropertyDef name="fileTime">
+        <Property name="dataType">DateTime</Property>
+        <Property name="label">闄勪欢涓婁紶鏃堕棿</Property>
+        <Property name="readOnly">true</Property>
+      </PropertyDef>
     </DataType>
     <DataType name="dtQualityParam">
       <PropertyDef name="depotId">
@@ -250,7 +305,7 @@
         <Property name="label">妫�娴嬪��</Property>
       </PropertyDef>
       <PropertyDef name="remarks">
-        <Property name="label">鍖栭獙缁撴灉</Property>
+        <Property name="label">澶囨敞</Property>
       </PropertyDef>
       <PropertyDef name="operaSymbolValue">
         <Property></Property>
@@ -454,10 +509,9 @@
    view.get(&quot;#ajaxGetDepot&quot;).set(&quot;parameter&quot;,depotId).execute(function(result){&#xD;
      if(result){&#xD;
      var data = view.get(&quot;#dsMain.data:#&quot;);&#xD;
-     data.set(&quot;foodLocation&quot;,result.foodLocation);&#xD;
      data.set(&quot;foodLevel&quot;,result.foodLevel);&#xD;
      data.set(&quot;foodVariety&quot;,result.foodVariety);&#xD;
-     data.set(&quot;foodType&quot;,result.foodType);&#xD;
+	 data.set(&quot;storeDate&quot;,result.storeDate);&#xD;
 	}&#xD;
 });&#xD;
 };&#xD;
@@ -469,8 +523,29 @@
  data.set(&quot;checkItems&quot;,result);&#xD;
 	}&#xD;
   }); &#xD;
-};      </ClientEvent>
+};&#xD;
+/**&#xD;
+ * 棰勮PDF鏂囦欢&#xD;
+ */&#xD;
+showFilePdf = function(){&#xD;
+	var cur = view.get(&quot;#dsMain.data:#&quot;);&#xD;
+	var fileName = cur.get(&quot;fileId&quot;);&#xD;
+	var fileTime = new Date(cur.get(&quot;fileTime&quot;)).formatDate(&quot;y-m-d H:i:s&quot;);&#xD;
+	if(!fileName){&#xD;
+		$alert(&quot;娌℃湁鑾峰彇鍒版枃浠跺悕绉帮紝鏃犳硶棰勮銆�&quot;);&#xD;
+		return;&#xD;
+	}&#xD;
+	if(!cur.get(&quot;fileTime&quot;)){&#xD;
+		$alert(&quot;娌℃湁鑾峰彇鍒伴檮浠朵笂浼犳椂闂达紝鏃犳硶璁块棶銆�&quot;);&#xD;
+		return;&#xD;
+	}&#xD;
+	&#xD;
+	var url = &quot;./basic/file/show-pdf?fileName=&quot;+fileName+&quot;&amp;fileTime=&quot;+fileTime+&quot;&amp;filePathType=common&quot;;&#xD;
+	&#xD;
+	window.open(url, &quot;_blank&quot;);&#xD;
+};</ClientEvent>
     <Property name="packages">font-awesome,css-common</Property>
+    <Property name="javaScriptFile">./static/plugins/lodop/LodopFuncs.js</Property>
     <DataSet id="dsMain">
       <Property name="loadMode">lazy</Property>
       <Property name="dataProvider">qualityManagerPR#listQuality</Property>
@@ -534,9 +609,9 @@
       </Button>
       <Button layoutConstraint="left">
         <ClientEvent name="onClick">var data = view.get(&quot;#dsMain.data:#&quot;);&#xD;
-                    if(data){&#xD;
-                    view.get(&quot;#dialogMain&quot;).show();&#xD;
-                    }
+if(data){&#xD;
+    view.get(&quot;#dialogMain&quot;).show();&#xD;
+}
                 </ClientEvent>
         <Property name="caption">淇敼</Property>
         <Property name="exClassName">btn-warm</Property>
@@ -564,8 +639,25 @@
         <ClientEvent name="onClick">view.get(&quot;#dsMain&quot;).flushAsync();&#xD;
                 </ClientEvent>
         <Property name="caption">鍒锋柊</Property>
-        <Property name="exClassName">btn-default</Property>
-        <Property name="iconClass">fa fa-refresh</Property>
+        <Property name="exClassName">btn-warm</Property>
+        <Property name="iconClass">fa fa-print</Property>
+      </Button>
+      <Button layoutConstraint="left">
+        <ClientEvent name="onClick">showFilePdf();</ClientEvent>
+        <Property name="exClassName">btn-normal</Property>
+        <Property name="caption">鏌ョ湅璐ㄦ闄勪欢</Property>
+        <Property name="iconClass">fa fa-picture-o</Property>
+      </Button>
+      <Button layoutConstraint="left">
+        <ClientEvent name="onClick">var data = view.get(&quot;#dsMain.data:#&quot;);&#xD;
+if (!data) {&#xD;
+	$alert(&quot;璇峰厛閫夋嫨鏁版嵁锛�&quot;);&#xD;
+	return;&#xD;
+}&#xD;
+printBill();</ClientEvent>
+        <Property name="caption">鎵撳嵃璐ㄦ鎶ュ憡</Property>
+        <Property name="exClassName">btn-warm</Property>
+        <Property name="iconClass">fa fa-print</Property>
       </Button>
     </Container>
     <Container layout="regionPadding:10" layoutConstraint="center">
@@ -599,8 +691,7 @@
         <Container layout="hbox regionPadding:15">
           <Button layoutConstraint="left">
             <ClientEvent name="onClick">var param = view.get(&quot;#dsParam.data&quot;);&#xD;
-                            view.get(&quot;#dsMain&quot;).set(&quot;parameter&quot;,param.toJSON()).flushAsync();
-                        </ClientEvent>
+view.get(&quot;#dsMain&quot;).set(&quot;parameter&quot;,param.toJSON()).flushAsync();                   </ClientEvent>
             <Property name="caption">鏌ヨ</Property>
             <Property name="exClassName">btn-default</Property>
             <Property name="iconClass">fa fa-refresh</Property>
@@ -696,14 +787,13 @@
       <Buttons>
         <Button>
           <ClientEvent name="onClick">var data = view.get(&quot;#dsMain.data:#&quot;);&#xD;
-                        if(data.validate() != 'ok'){&#xD;
-                        $notify(&quot;鏁版嵁鏍¢獙澶辫触锛侊紒&quot;);&#xD;
-                        return;&#xD;
-                        }&#xD;
-                        view.get(&quot;#uaAction&quot;).set(&quot;parameter&quot;,data).execute(function(){&#xD;
-                        self.get(&quot;parent&quot;).hide();&#xD;
-                        });
-                    </ClientEvent>
+if(data.validate() != 'ok'){&#xD;
+ $notify(&quot;鏁版嵁鏍¢獙澶辫触锛侊紒&quot;);&#xD;
+ return;&#xD;
+ }&#xD;
+ view.get(&quot;#uaAction&quot;).set(&quot;parameter&quot;,data).execute(function(){&#xD;
+ self.get(&quot;parent&quot;).hide();&#xD;
+});                 </ClientEvent>
           <Property name="caption">淇濆瓨</Property>
           <Property name="iconClass">fa fa-check</Property>
           <Property name="exClassName">btn-normal</Property>
@@ -727,7 +817,7 @@
               <Property name="readOnly">false</Property>
               <Property name="labelSeparator">:</Property>
               <Property name="labelAlign">right</Property>
-              <Property name="cols">*,*,*</Property>
+              <Property name="cols">*,*,*,*</Property>
               <Property name="labelWidth">120</Property>
               <AutoFormElement>
                 <Property name="name">depotId</Property>
@@ -807,6 +897,11 @@
                 <Editor/>
               </AutoFormElement>
               <AutoFormElement layoutConstraint="colSpan:1">
+                <Property name="name">storeDate</Property>
+                <Property name="property">storeDate</Property>
+                <Editor/>
+              </AutoFormElement>
+              <AutoFormElement layoutConstraint="colSpan:1">
                 <Property name="name">result</Property>
                 <Property name="property">result</Property>
                 <Editor>
@@ -817,7 +912,7 @@
                   </TagEditor>
                 </Editor>
               </AutoFormElement>
-              <Label layoutConstraint="colSpan:2">
+              <Label layoutConstraint="colSpan:3">
                 <Property name="text">璇存槑锛氬椤规寚鏍囨椂鎸夌収1:璐ㄩ噺鎸囨爣妫�楠�(杈炬爣,涓嶈揪鏍�)銆�2:鍌ㄥ瓨鍝佽川妫�楠�(瀹滃瓨,涓嶅疁瀛�)銆�3:椋熷搧瀹夊叏妫�楠�(鍚堟牸,涓嶅悎鏍�)杩欎釜椤哄簭濉啓妫�楠岀粨璁�</Property>
                 <Property name="style">
                   <Property name="color">blue</Property>
@@ -865,11 +960,43 @@
                 <Property name="property">spaqzbsfhg</Property>
                 <Editor/>
               </AutoFormElement>
-              <AutoFormElement layoutConstraint="colSpan:3">
+              <AutoFormElement layoutConstraint="colSpan:2">
                 <Property name="name">remark</Property>
                 <Property name="property">remark</Property>
                 <Editor/>
               </AutoFormElement>
+              <AutoFormElement>
+                <Property name="name">reportType</Property>
+                <Property name="property">reportType</Property>
+                <Editor/>
+              </AutoFormElement>
+              <AutoFormElement>
+                <Property name="name">fileName</Property>
+                <Property name="property">fileName</Property>
+                <Editor/>
+              </AutoFormElement>
+              <AutoFormElement>
+                <Property name="name">fileTime</Property>
+                <Property name="property">fileTime</Property>
+                <Editor/>
+              </AutoFormElement>
+              <Container>
+                <Button layoutConstraint="left">
+                  <Property name="action">uploadFile</Property>
+                  <Property name="caption">闄勪欢涓婁紶...</Property>
+                  <Property name="exClassName">btn-default</Property>
+                  <Property name="iconClass">fa fa-cloud-upload</Property>
+                </Button>
+                <Label layoutConstraint="left">
+                  <Property name="width">10px</Property>
+                </Label>
+                <Button layoutConstraint="left">
+                  <ClientEvent name="onClick">showFilePdf();</ClientEvent>
+                  <Property name="exClassName">btn-normal</Property>
+                  <Property name="caption">棰勮</Property>
+                  <Property name="iconClass">fa fa-picture-o</Property>
+                </Button>
+              </Container>
             </AutoForm>
           </Children>
         </FieldSet>
@@ -935,33 +1062,6 @@
                 <Property name="align">center</Property>
                 <Property name="readOnly">true</Property>
               </DataColumn>
-              <DataColumn name="operaSymbolValue">
-                <Property name="property">operaSymbolValue</Property>
-                <Property name="align">center</Property>
-                <Property name="caption">鏍囧噯鍊�</Property>
-                <Property name="readOnly">true</Property>
-              </DataColumn>
-              <DataColumn name="deNum">
-                <Property name="property">deNum</Property>
-                <Property name="align">center</Property>
-              </DataColumn>
-              <DataColumn name="addNum">
-                <Property name="property">addNum</Property>
-                <Property name="align">center</Property>
-              </DataColumn>
-              <DataColumn name="dePrice">
-                <Property name="property">dePrice</Property>
-                <Property name="align">center</Property>
-              </DataColumn>
-              <DataColumn name="addPrice">
-                <Property name="property">addPrice</Property>
-                <Property name="align">center</Property>
-              </DataColumn>
-              <DataColumn name="result">
-                <Property name="property">result</Property>
-                <Property name="align">center</Property>
-                <Property name="readOnly">true</Property>
-              </DataColumn>
               <DataColumn name="remarks">
                 <Property name="property">remarks</Property>
                 <Property name="align">center</Property>
@@ -1007,7 +1107,7 @@
           </TextEditor>
           <Button>
             <ClientEvent name="onClick">var key = view.get(&quot;#key2.value&quot;);&#xD;
-                            view.get(&quot;#dsFoodOrigin&quot;).set(&quot;parameter&quot;,{key:key}).flushAsync();
+view.get(&quot;#dsFoodOrigin&quot;).set(&quot;parameter&quot;,{key:key}).flushAsync();
                         </ClientEvent>
             <Property name="caption">鏌ヨ</Property>
             <Property name="iconClass">fa fa-search</Property>
@@ -1064,5 +1164,26 @@
       <Property name="property">cname</Property>
       <Property name="assignmentMap">user=cname</Property>
     </DataSetDropDown>
+    <AjaxAction id="ajaxQualityPrint">
+      <Property name="service">qualityManagerPR#printQualityBill</Property>
+      <Property name="executingMessage">姝e湪鎵ц鎵撳嵃鈥︹��</Property>
+    </AjaxAction>
+    <UploadAction id="uploadFile">
+      <ClientEvent name="onFileUploaded">var fileId = arg.returnValue;&#xD;
+        if(fileId==(&quot;10&quot;)){&#xD;
+        $alert(&quot;涓婁紶澶辫触锛氶檮浠跺悕绉颁负绌恒��&quot;);&#xD;
+        return;&#xD;
+        }&#xD;
+        if(fileId==(&quot;20&quot;)){&#xD;
+        $alert(&quot;涓婁紶澶辫触锛氶檮浠朵笉鏄痯df鏂囦欢銆�&quot;);&#xD;
+        return;&#xD;
+        }&#xD;
+var data = view.get(&quot;#dsMain.data:#&quot;);&#xD;
+data.set(&quot;fileId&quot;,fileId);&#xD;
+data.set(&quot;fileName&quot;,arg.file.name);&#xD;
+data.set(&quot;fileTime&quot;,new Date);</ClientEvent>
+      <Property name="fileResolver">myUploadProcessor#uploadCommonFile</Property>
+      <Filters/>
+    </UploadAction>
   </View>
 </ViewConfig>

--
Gitblit v1.9.3