From 8afbe0b83915dc417cea62221782e7ce15c00c78 Mon Sep 17 00:00:00 2001
From: 王震 <10952869+daywangzhen@user.noreply.gitee.com>
Date: 星期一, 04 十二月 2023 17:19:42 +0800
Subject: [PATCH] Merge branch 'master' of http://114.132.189.42:9002/r/mes-ocea-before

---
 src/views/quality/packageinspect/index.vue |  231 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 231 insertions(+), 0 deletions(-)

diff --git a/src/views/quality/packageinspect/index.vue b/src/views/quality/packageinspect/index.vue
new file mode 100644
index 0000000..a575e60
--- /dev/null
+++ b/src/views/quality/packageinspect/index.vue
@@ -0,0 +1,231 @@
+<!--
+  -    Copyright (c) 2018-2025, ztt All rights reserved.
+  -
+  - Redistribution and use in source and binary forms, with or without
+  - modification, are permitted provided that the following conditions are met:
+  -
+  - Redistributions of source code must retain the above copyright notice,
+  - this list of conditions and the following disclaimer.
+  - Redistributions in binary form must reproduce the above copyright
+  - notice, this list of conditions and the following disclaimer in the
+  - documentation and/or other materials provided with the distribution.
+  - Neither the name of the pig4cloud.com developer nor the names of its
+  - contributors may be used to endorse or promote products derived from
+  - this software without specific prior written permission.
+  - Author: ztt
+  -->
+  <template>
+    <div class="mod-config">
+        <basic-container>
+            <ttable 
+            :table="table"
+            :resultData="resultData"
+            @handleSelectionChange="handleSelectionChange"
+            :prelang="prelang"
+            :options="options"
+            :ajaxFun="ajaxFun"
+            ref="packageInspectTable">
+            <template #toolbar>
+            </template>
+            </ttable>
+        </basic-container>
+        <!-- 寮圭獥, 鏂板 / 淇敼 -->
+        <!-- <RawMaterialForm
+            v-if="addOrUpdateVisible"
+            ref="addOrUpdate"
+            @refreshDataList="getData"
+        ></RawMaterialForm> -->
+    </div>
+</template>
+<script>
+import ttable from '@/views/common/ztt-table.vue'
+import { fetchList,deleteById } from '@/api/quality/packageInspect'
+// import RawMaterialForm from './rawMaterial-form'
+import * as fecha from 'element-ui/lib/utils/date'
+import { mapGetters } from 'vuex'
+  export default {
+    data() {
+        return {
+            resultData:[],
+            addOrUpdateVisible: false,
+            type: [1],
+            multipleSelection: [],
+            prelang: 'packageInspect',
+            ajaxFun: fetchList,
+            options: {
+                height: 300, // 榛樿楂樺害-涓轰簡琛ㄥご鍥哄畾
+                stripe: true, // 鏄惁涓烘枒椹汗 table
+                highlightCurrentRow: false, // 鏄惁瑕侀珮浜綋鍓嶈
+                border: true, // 鏄惁鏈夌旱鍚戣竟妗�
+                lazy: false, // 鏄惁闇�瑕佹噿鍔犺浇
+                fit: true, // 鍒楃殑瀹藉害鏄惁鑷拺寮�
+                multiSelect: true, //
+                seqNo: true,
+                isRefresh: true, // 鏄惁鏄剧ず鍒锋柊鎸夐挳
+                isShowHide: true, // 鏄惁鏄剧ず鏄惧奖鎸夐挳H
+                isSearch: true, // 楂樼骇鏌ヨ鎸夐挳
+                defaultOrderBy: { column: 'createTime', direction: 'desc' },
+            },
+            table: {
+                total: 0,
+                currentPage: 1,
+                pageSize: 20,
+                data: [],
+                // 鏍囬
+                column: [
+                    {
+                        minWidth: '180',
+                        prop: 'packInsNo',
+                        label: '鍖呰妫�楠岀紪鍙�',
+                        isTrue: true,
+                        isSearch: true,
+                        searchInfoType: 'text',
+                        render: { fun: this.addOrUpdateHandle }
+                    },
+                    {
+                        minWidth: '180',
+                        prop: 'packageNo',
+                        label: '鍖呰缂栫爜',
+                        isTrue: true,
+                        isSearch: true,
+                        searchInfoType: 'text'
+                    },
+                    {
+                        minWidth: '180',
+                        prop: 'contractNo',
+                        label: '鍚堝悓鍙�',
+                        isTrue: true,
+                        isSearch: true,
+                        searchInfoType: 'text'
+                    },
+                    {
+                        minWidth: '180',
+                        prop: 'projectName',
+                        label: '椤圭洰鍚嶇О',
+                        isTrue: true,
+                        isSearch: true,
+                        searchInfoType: 'text'
+                    },
+                    {
+                        minWidth: '180',
+                        prop: 'customerName',
+                        label: '瀹㈡埛鍚嶇О',
+                        isTrue: true,
+                        isSearch: true,
+                        searchInfoType: 'text'
+                    },
+                    {
+                        minWidth: '180',
+                        prop: 'createTime',
+                        label: '鎶ユ鏃ユ湡',
+                        isTrue: true,
+                        sort: true,
+                        isSearch: true,
+                        searchInfoType: 'text',
+                        formatter: this.formatDateTime,
+                    },
+                    {
+                        minWidth: '180',
+                        prop: 'createUser',
+                        label: '鎶ユ浜�',
+                        isTrue: true,
+                        isSearch: true,
+                        searchInfoType: 'text'
+                    },
+                    {
+                        minWidth: '200',
+                        prop: 'result',
+                        label: '缁撹',
+                        isTrue: true,
+                        isSearch: true,
+                        searchInfoType: 'text'
+                    },
+                ],
+                toolbar: [
+                    // {
+                    //     text: '鏂板',
+                    //     type: 'primary',
+                    //     fun: this.addOrUpdateHandle
+                    // },
+                ],
+                operator: [
+                {
+                    text: '浣滃簾',
+                    type: 'text',
+                    size: 'small',
+                    fun: this.deleteHandle
+                }],
+                operatorConfig: {
+                fixed: 'right',
+                label: '鎿嶄綔',
+                width: 100,
+                minWidth: 100
+                },
+            },
+        }
+    },
+    components: {
+        ttable,
+    },
+    created() { },
+    computed: {
+        ...mapGetters(['permissions'])
+    },
+    watch:{
+
+    },
+    methods:{
+        // 鍒犻櫎
+        deleteHandle(row) {
+            const _than = this
+            this.$confirm('鏄惁纭鍒犻櫎鍖呰缂栧彿銆�' + row.packInsNo+'銆戠殑鏁版嵁锛�' , '鎻愮ず', {
+                confirmButtonText: '纭畾',
+                cancelButtonText: '鍙栨秷',
+                closeOnClickModal: false,
+                type: 'warning'
+            }).then(function() {
+                deleteById(row.id).then((response)=>{
+                    var data = response.data
+                    if (data.code == 0) {
+                        _than.$message.success('鍒犻櫎鎴愬姛')
+                    } else {
+                        _than.$message.error('鍒犻櫎澶辫触')
+                    }
+                    _than.getData()
+                })
+            }).catch((error) => {
+                console.log(error);
+            })
+        },
+        // 鏂板 / 淇敼
+        addOrUpdateHandle(row) {
+            this.$router.push({
+                name: 'packageInspectForm',
+                query: { 
+                    id: row == null ? null : row.id
+                 },
+                 params:{resultVal : row.result=='' ? null : row.result}
+            })
+        },
+        formatResult(row, column, cellValue){
+            if(cellValue != undefined || cellValue != null){
+                if(cellValue == '涓嶅悎鏍�'){
+                    return "<span style='color:#E84738;'>涓嶅悎鏍�</span>"
+                }
+                return "<span style='color:#34BD66;'>鍚堟牸</span>"
+            }
+        },
+        formatDateTime(row, column, cellValue) {
+            return cellValue ? fecha.format(new Date(cellValue), 'yyyy-MM-dd') : ''
+        },
+        getData() {
+            this.$refs.packageInspectTable.getDataList()
+        },
+        // table鑷甫浜嬩欢
+        handleSelectionChange(val) {
+            this.multipleSelection = val
+        },
+    }
+  }
+  </script>
+  
\ No newline at end of file

--
Gitblit v1.9.3