Browse Source

更新交验单导入功能

zhaoyaxiong 1 year ago
parent
commit
9eb613ddfa

+ 23 - 6
ZRAdmin-vue-main/src/views/Business/SapDeliverRecord/index.vue

@@ -39,6 +39,14 @@
             </el-option>
           </el-select>
         </el-form-item>
+        <el-form-item label="质检结果" prop="CheckResult">
+          <el-select v-model="queryParams.CheckResult" placeholder="请选择" clearable style="width:120px">
+            <el-option v-for="dict in options.qaResultOptions" :key="dict.dictValue" :label="dict.dictLabel"
+              :value="dict.dictValue">
+              <dict-tag :options="options.qaResultOptions" :value="dict.dictValue" />
+            </el-option>
+          </el-select>
+        </el-form-item>
       </el-row>
       <el-row>
         <el-form-item label="交验单号" prop="deliverNo">
@@ -296,10 +304,10 @@
     </el-dialog>
     <!-- 导入对话框 -->
     <el-dialog :title="upload.title" v-model="upload.open" width="400px" append-to-body>
-      <el-upload name="file" ref="uploadRef" :limit="1" accept=".xlsx, .xls" :headers="upload.headers"
+      <el-upload name="file" ref="uploadRef" :limit="1" accept=".xlsx" :headers="upload.headers"
         :action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading"
         :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :on-error="handleFileError"
-        :auto-upload="false" drag>
+        :auto-upload="false" :data="uploadPara" drag>
         <el-icon class="el-icon--upload">
           <upload-filled />
         </el-icon>
@@ -309,15 +317,21 @@
             <!-- <div class="el-upload__tip">
                   <el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据
                 </div> -->
-            <span>仅允许导入xls、xlsx格式文件。</span>
+            <span>仅允许导入xlsx格式文件。</span>
             <!-- <el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline"
               @click="importTemplate">下载模板</el-link> -->
           </div>
         </template>
       </el-upload>
       <template #footer>
-        <el-button @click="upload.open = false">{{ $t('btn.cancel') }}</el-button>
-        <el-button type="primary" @click="submitFileForm">{{ $t('btn.submit') }}</el-button>
+        <el-select v-model="uploadPara.category" placeholder="请选择" style="width:180px;margin-right: 15px;" size="large">
+          <el-option v-for="dict in options.materialTypeOptions" :key="dict.dictValue" :label="dict.dictLabel"
+            :value="dict.dictValue">
+            <dict-tag :options="options.materialTypeOptions" :value="dict.dictValue" />
+          </el-option>
+        </el-select>
+        <el-button @click="upload.open = false" size="large">{{ $t('btn.cancel') }}</el-button>
+        <el-button type="primary" @click="submitFileForm" size="large">{{ $t('btn.submit') }}</el-button>
       </template>
     </el-dialog>
   </div>
@@ -441,6 +455,9 @@ const upload = reactive({
   // 上传的地址
   url: import.meta.env.VITE_APP_BASE_API + '/business/sapdeliverrecord/importData'
 })
+const uploadPara = reactive({
+  category: '外协件'
+})
 // 导入按钮操作
 function handleImport() {
   upload.title = '交验单导入'
@@ -471,7 +488,7 @@ const handleFileSuccess = (response, file, fileList) => {
 /** 文件上传失败处理 */
 const handleFileError = (Error, file, fileList) => {
   upload.isUploading = false
-  proxy.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + Error.msg + '</div>', '导入错误', {
+  proxy.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>文件:《" + file.name + "》导入错误,请检查文件。<br/>请确认:<br/>交验单号<br/>采购订单<br/>生产令号<br/>行项目<br/>规格型号<br/>关键件标识<br/>交验单数量<br/>抽检数量<br/>以上内容在表格中正确无误。" + '</div>', '导入错误', {
     dangerouslyUseHTMLString: true
   })
 }

+ 1 - 1
ZRAdmin-vue-main/src/views/index_v1.vue

@@ -322,7 +322,7 @@ provide('chartPie_category4', chartPie_category4)
 
 const queryParams = ref({
   pageNum: 1,
-  pageSize: 20,
+  pageSize: 8,
   title: undefined,
   operName: undefined,
   businessType: undefined,