|
@@ -127,6 +127,14 @@
|
|
|
<detailsFabric-drawer ref="detailsFabricDrawer" :father="bb" @ok="modalFormOk"></detailsFabric-drawer>
|
|
|
<editFabric-drawer ref="editFabricDrawer" :father="cc" @ok="modalFormOk"></editFabric-drawer>
|
|
|
</div>
|
|
|
+ <!-- 导入确认框 -->
|
|
|
+ <div>
|
|
|
+ <a-modal :visible="visible" title="是否继续导入" @ok="handleOk" @cancel="handleCancel">
|
|
|
+ <ul>
|
|
|
+ <li v-for="(item,index) in message" :key="index">{{item}}</li>
|
|
|
+ </ul>
|
|
|
+ </a-modal>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -138,7 +146,7 @@ import moment from 'moment'
|
|
|
import addFabricDrawer from '@views/packing-list/packinglist-fabrics/addFabricDrawer.vue'
|
|
|
import detailsFabricDrawer from '@views/packing-list/packinglist-fabrics/detailsFabricDrawer.vue'
|
|
|
import editFabricDrawer from '@views/packing-list/packinglist-fabrics/editFabricDrawer.vue'
|
|
|
-import { fabricList,fabricListId,deleteFabricList,submitList,cancelSubmit,bitchSubmit,bitchCancelSubmit,synchronizationData,upload} from '@api/document/packing-list/packinglist-fabrics'
|
|
|
+import { fabricList,fabricListId,deleteFabricList,submitList,cancelSubmit,bitchSubmit,bitchCancelSubmit,synchronizationData,upload,fileDetail} from '@api/document/packing-list/packinglist-fabrics'
|
|
|
|
|
|
export default {
|
|
|
name: 'FabricList', // 装箱单-面料
|
|
@@ -246,7 +254,9 @@ export default {
|
|
|
],
|
|
|
|
|
|
fabricListData: [],
|
|
|
-
|
|
|
+ visible:false,
|
|
|
+ file:{},
|
|
|
+ message:[],//导入文件信息
|
|
|
selectedRowKeys: [], // 勾选航
|
|
|
loading: false, // 表格加载
|
|
|
|
|
@@ -274,13 +284,38 @@ export default {
|
|
|
uploadFlie(file) {
|
|
|
const formData = new FormData()
|
|
|
formData.append('file', file.file)
|
|
|
- upload(formData).then(res => {
|
|
|
+ fileDetail(formData).then(res => {
|
|
|
+ this.loading = false
|
|
|
if (res.success) {
|
|
|
- this.getFabricList()
|
|
|
+ this.visible = true
|
|
|
+ this.message = res.message.split(';').filter((element) => {
|
|
|
+ return element !== "";
|
|
|
+ });
|
|
|
+ this.file = file
|
|
|
}else{
|
|
|
this.$message.error(res.message);
|
|
|
}
|
|
|
})},
|
|
|
+ //继续导入
|
|
|
+ handleOk(){
|
|
|
+ const formData = new FormData()
|
|
|
+ formData.append('file', this.file.file)
|
|
|
+ upload(formData).then(res => {
|
|
|
+ this.visible = false
|
|
|
+ if (res.success) {
|
|
|
+ this.$message.success('导入成功')
|
|
|
+ this.getFabricList()
|
|
|
+ }else{
|
|
|
+ this.$message.error(res.message);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //取消导入
|
|
|
+ handleCancel(){
|
|
|
+ this.visible = false
|
|
|
+ this.loading = false
|
|
|
+ },
|
|
|
+
|
|
|
//分页查询
|
|
|
getFabricList(){
|
|
|
this.$nextTick(() => {
|