From 1980a84b1aeabf2fda317b1c8ffd0a3cc1ba2b26 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期二, 12 三月 2024 15:54:54 +0800
Subject: [PATCH] 完成产品追溯,成品库存、成品出库修改

---
 src/views/plan/customerorder/technology-form.vue  |  119 ++++++++++++++
 src/views/warehouse/FinishedWarehousing/index.vue |    5 
 vue.config.js                                     |    2 
 src/views/plan/customerorder/index.vue            |   10 +
 src/api/quality/finishedDelivery.js               |    2 
 src/api/warehouse/finishedOutcome.js              |    9 +
 src/views/warehouse/FinishedGoods/index.vue       |  105 +++++-------
 src/views/product/producttraceability/index.vue   |  227 +++++++++++++++++++++-------
 8 files changed, 356 insertions(+), 123 deletions(-)

diff --git a/src/api/quality/finishedDelivery.js b/src/api/quality/finishedDelivery.js
index 258847b..31bb380 100644
--- a/src/api/quality/finishedDelivery.js
+++ b/src/api/quality/finishedDelivery.js
@@ -6,4 +6,4 @@
     method: 'get',
     params: query
   })
-}
\ No newline at end of file
+}
diff --git a/src/api/warehouse/finishedOutcome.js b/src/api/warehouse/finishedOutcome.js
new file mode 100644
index 0000000..00c6bfd
--- /dev/null
+++ b/src/api/warehouse/finishedOutcome.js
@@ -0,0 +1,9 @@
+import request from '@/router/axios'
+
+export function finishedOutcome(query) {
+    return request({
+      url: '/mes/finishedOutcome/page',
+      method: 'get',
+      params: query
+    })
+  }
diff --git a/src/views/plan/customerorder/index.vue b/src/views/plan/customerorder/index.vue
index 4ba8c0f..a9f5500 100644
--- a/src/views/plan/customerorder/index.vue
+++ b/src/views/plan/customerorder/index.vue
@@ -57,6 +57,12 @@
             @click="() => (exportDialogVisible = true)"
             >瀵煎嚭鍙拌处</el-button
           >
+          <!-- <el-button
+            style="margin-left: 10px"
+            type="primary"
+            @click="() => ($refs.technology.init())"
+            >缂栧啓鎶�鏈氦搴曞崟</el-button
+          > -->
         </template>
       </ttable>
       <!-- 寮圭獥, 鏃ユ湡閫夋嫨 -->
@@ -347,6 +353,7 @@
         ></el-table-column>
       </el-table>
     </el-dialog>
+    <technology-form ref="technology"></technology-form>
   </div>
 </template>
 
@@ -358,6 +365,7 @@
 } from '@/api/plan/customerOrderInterrelated'
 import ConfirmPullCustomerorder from './confirm-pull-customerorder'
 import TableForm from './customerorder-form'
+import TechnologyForm from './technology-form.vue'
 import TableFormDEesc from './customerorder-form-desc'
 import SampleTableForm from './sample-customerorder-form'
 import { mapGetters } from 'vuex'
@@ -400,6 +408,7 @@
       interrelatedOrderId: null,
       interrelatedOrderData: [],
       showInterrelatedOrderDialog: false,
+      technologyDialog:true,
       uniqueStateArr: [],
       dataForm: {
         selectTime: null,
@@ -963,6 +972,7 @@
     SalesPartBatchDialog,
     TableFormDEesc,
     CustomerorderReturnDialog,
+    TechnologyForm,
   },
   computed: {
     ...mapGetters(['permissions']),
diff --git a/src/views/plan/customerorder/technology-form.vue b/src/views/plan/customerorder/technology-form.vue
new file mode 100644
index 0000000..e86e8d5
--- /dev/null
+++ b/src/views/plan/customerorder/technology-form.vue
@@ -0,0 +1,119 @@
+<template>
+    <el-dialog
+      top="10vh"
+      width="80%"
+      title="缂栧啓鎶�鏈氦搴曞崟"
+      :close-on-click-modal="false"
+      :visible.sync="visible"
+      v-if="visible"
+    >
+      <el-form :model="dataForm" :rules="dataRule" ref="dataForm" class="l-mes">
+        <el-form-item label="">
+          <!-- <el-date-picker
+            v-model="dataForm.selectTime"
+            type="datetime"
+            placeholder="閫夋嫨鏃ユ湡鏃堕棿"
+            value-format="yyyy-MM-dd HH:mm:ss"
+          >
+          </el-date-picker> -->
+          <rich-text
+                editorId="fwb001122"
+                :richContent="remark"
+                @contentChange="contentChange"
+            ></rich-text>
+        </el-form-item>
+      </el-form>
+
+      <div slot="footer" class="dialog-footer">
+        <el-button type="info" @click="visible = false">鍙栨秷</el-button>
+        <el-button
+          type="primary"
+          :disabled="isSubmit"
+          v-thinclick="`dataFormSubmit`"
+          >纭畾</el-button
+        >
+      </div>
+    </el-dialog>
+  </template>
+
+  <script>
+  import { otcCustomerOrderSync } from '@/api/plan/customerorder'
+  import RichText from '@/views/common/rich-text.vue'
+
+  export default {
+    components: { RichText },
+    data() {
+      return {
+        visible: false,
+        dataForm: {
+          selectTime: null
+        },
+        dataRule: {},
+        isSubmit: false,
+        remark:''
+      }
+    },
+    methods: {
+      init() {
+        this.visible = true
+      },
+      dataFormSubmit() {
+        this.isSubmit = true
+        if (this.dataForm.selectTime != null && this.dataForm.selectTime != '') {
+          otcCustomerOrderSync({
+            selectTime: this.dataForm.selectTime,
+            pathCode: '0'
+          })
+            .then((response) => {
+              const resData = response.data
+              if (resData.code === 0) {
+                this.$message.success('鎷夊彇閿�鍞鍗曟垚鍔燂紱' + resData.msg)
+                this.visible = false
+                this.isSubmit = false
+                this.dataForm.selectTime = null
+                this.$emit('refreshDataList')
+              } else {
+                this.$message.success('鎷夊彇閿�鍞鍗曞け璐�')
+                this.isSubmit = false
+              }
+            })
+            .catch((error) => {
+              this.isSubmit = false
+              console.error(error)
+            })
+        } else {
+          this.isSubmit = false
+          this.$message.error('璇峰厛閫夋嫨鏃ユ湡')
+        }
+      },
+      contentChange(e){
+        console.log(1111,e)
+      }
+    }
+  }
+  </script>
+  <style scoped lang="scss">
+  .mps-table .el-table__row > td {
+    border: none;
+  }
+
+  .mps-table::before {
+    height: 0px;
+  }
+  /*
+  瀛楃涓茶繃闀挎椂锛岄殣钘忔樉绀虹渷鐣ュ彿
+  */
+  .inline-el-hidden {
+    display: block;
+    width: 93%;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+    margin: 0 auto;
+  }
+  ::v-deep .quill-editor{
+    .ql-container{
+        min-height:  400px!important;
+    }
+  }
+  </style>
diff --git a/src/views/product/producttraceability/index.vue b/src/views/product/producttraceability/index.vue
index 9ba6bc5..a4b1dd2 100644
--- a/src/views/product/producttraceability/index.vue
+++ b/src/views/product/producttraceability/index.vue
@@ -344,7 +344,110 @@
           </el-tab-pane> -->
           <el-tab-pane label="妫�娴嬩俊鎭�" name="妫�娴嬩俊鎭�">
             <div style="margin-top:10px;">
-              <el-tabs type="card">
+                <div class="process" v-if="process">
+                    <el-divider
+                    class="pane-divider"
+                    direction="vertical"
+                    ></el-divider>
+                    <span style="font-size:14px;font-weight:bold"
+                    >杩囩▼妫�</span>
+                    <div style="font-size: 12px;margin-top: 10px;margin-left: 10px;">鏍峰搧鍚嶏細<span style="font-weight: 700;">{{process.sampleName}}</span></div>
+                    <el-table
+                    stripe
+                    :data="process.sampleItem"
+                    :height="paramsTableHeight"
+                    :header-cell-style="paramsTableHeaderStyle0"
+                    :row-class-name="tableRowClassName"
+                    class="taskinfo-params-table"
+                    style="margin: 10px;width: 95%;"
+                  >
+                    <el-table-column
+                      prop="father"
+                      label="椤圭洰"
+                      align="center"
+                      min-width="75px"
+                    />
+                    <el-table-column
+                      prop="name"
+                      label="鎸囨爣"
+                      align="center"
+                      min-width="100px"
+                    />
+                    <el-table-column
+                      prop="result"
+                      label="缁撴灉"
+                      align="center"
+                      min-width="60px"
+                    >
+                      <template slot-scope="scope">
+                        {{
+                          scope.row.isQualified == 0
+                            ? '涓嶅悎鏍�'
+                            : '鍚堟牸'
+                        }}
+                      </template>
+                    </el-table-column>
+                    <el-table-column
+                      prop="userName"
+                      label="妫�楠屼汉"
+                      align="center"
+                      min-width="90px"
+                    />
+                  </el-table>
+                </div>
+                <div class="product" v-if="finished" :class="{checkMore:process}">
+                    <el-divider
+                    class="pane-divider"
+                    direction="vertical"
+                    ></el-divider>
+                    <span style="font-size:14px;font-weight:bold"
+                    >浜у搧妫�</span>
+                    <div style="font-size: 12px;margin-top: 10px;margin-left: 10px;">鏍峰搧鍚嶏細<span style="font-weight: 700;">{{finished.sampleName}}</span></div>
+                    <el-table
+                    stripe
+                    :data="finished.sampleItem"
+                    :height="paramsTableHeight"
+                    :header-cell-style="paramsTableHeaderStyle0"
+                    :row-class-name="tableRowClassName"
+                    class="taskinfo-params-table"
+                    style="margin: 10px;width: 95%;"
+                  >
+                    <el-table-column
+                      prop="father"
+                      label="椤圭洰"
+                      align="center"
+                      min-width="75px"
+                    />
+                    <el-table-column
+                      prop="name"
+                      label="鎸囨爣"
+                      align="center"
+                      min-width="100px"
+                    />
+                    <el-table-column
+                      prop="result"
+                      label="缁撴灉"
+                      align="center"
+                      min-width="60px"
+                    >
+                      <template slot-scope="scope">
+                        {{
+                          scope.row.isQualified == 0
+                            ? '涓嶅悎鏍�'
+                            : '鍚堟牸'
+                        }}
+                      </template>
+                    </el-table-column>
+                    <el-table-column
+                      prop="userName"
+                      label="妫�楠屼汉"
+                      align="center"
+                      min-width="90px"
+                    />
+                  </el-table>
+                </div>
+                <!-- <p v-show="!process&&!finished">鏆傛棤鏁版嵁</p> -->
+              <!-- <el-tabs type="card">
                 <el-tab-pane
                   v-for="(item, index) in checkItemList"
                   :key="item.reportTypeLabel"
@@ -423,25 +526,7 @@
                     </el-table-column>
                   </el-table>
                 </el-tab-pane>
-                <!--<el-tab-pane label="闄勪欢">
-                  <el-upload
-                    drag
-                    ref="upload"
-                    action="/mes/reportSample/upload"
-                    :headers="headers"
-                    :auto-upload="true"
-                    :file-list="fileList"
-                    list-type="text"
-                    :on-preview="handlePreview"
-                    :with-credentials="true"
-                  >
-                    <i class="el-icon-upload"></i>
-                    <div class="el-upload__text">
-                      灏嗘枃浠舵嫋鍒版澶勶紝鎴�<em>鐐瑰嚮涓婁紶</em>
-                    </div>
-                  </el-upload>
-                </el-tab-pane>-->
-              </el-tabs>
+              </el-tabs> -->
             </div>
           </el-tab-pane>
           <el-tab-pane label="鐢熶骇璁板綍" name="鐢熶骇璁板綍">
@@ -981,6 +1066,9 @@
 .taskinfo-params-table >>> td {
   padding: 3px 0px;
 }
+.checkMore{
+    margin-top: 20px;
+}
 </style>
 <script>
 import {
@@ -1129,7 +1217,9 @@
       traceType: 'posite',
       reportTypeOptions: [],
       checkItemList: [],
-      mouldRecordList: []
+      mouldRecordList: [],
+      finished:null,
+      process:null
     }
   },
   mounted() {
@@ -1332,39 +1422,51 @@
                   _that.currProductTracking = {}
                 }
                 // 妫�娴嬩俊鎭�
-                const sampleItemList = data.data.sampleItems
-                if (sampleItemList != null && sampleItemList.length > 0) {
-                  _that.paramValues = sampleItemList
-                  _that.checkItemList = []
-                  sampleItemList.forEach((item) => {
-                    const reportTypeLabel = _that.reportTypeOptions.find(
-                      (el) => {
-                        return item.reportType == el.value
-                      }
-                    )
-                    if (reportTypeLabel) {
-                      const existCheckItem = _that.checkItemList.find(
-                        (checkItem) => {
-                          return (
-                            reportTypeLabel.label == checkItem.reportTypeLabel
-                          )
-                        }
-                      )
-                      if (existCheckItem) {
-                        existCheckItem.itemList.push(item)
-                      } else {
-                        _that.checkItemList.push({
-                          reportTypeLabel: reportTypeLabel.label,
-                          itemList: [item]
-                        })
-                      }
-                    }
-                  })
-                  // reportTypeOptions
-                } else {
-                  _that.paramValues = []
-                  _that.checkItemList = []
+                const sampleItems = data.data.sampleItems
+                // 妫�娴嬩俊鎭�-杩囩▼妫�
+                if(sampleItems&&sampleItems.process&&sampleItems.process.length>0){
+                    _that.process = sampleItems.process[0]
+                }else{
+                    _that.process = null
                 }
+                // 妫�娴嬩俊鎭�-浜у搧妫�
+                if(sampleItems&&sampleItems.finished&&sampleItems.finished.length>0){
+                    _that.finished = sampleItems.finished[0]
+                }else{
+                    _that.finished = null
+                }
+                // if (sampleItemList != null && sampleItemList.length > 0) {
+                //   _that.paramValues = sampleItemList
+                //   _that.checkItemList = []
+                //   sampleItemList.forEach((item) => {
+                //     const reportTypeLabel = _that.reportTypeOptions.find(
+                //       (el) => {
+                //         return item.reportType == el.value
+                //       }
+                //     )
+                //     if (reportTypeLabel) {
+                //       const existCheckItem = _that.checkItemList.find(
+                //         (checkItem) => {
+                //           return (
+                //             reportTypeLabel.label == checkItem.reportTypeLabel
+                //           )
+                //         }
+                //       )
+                //       if (existCheckItem) {
+                //         existCheckItem.itemList.push(item)
+                //       } else {
+                //         _that.checkItemList.push({
+                //           reportTypeLabel: reportTypeLabel.label,
+                //           itemList: [item]
+                //         })
+                //       }
+                //     }
+                //   })
+                //   // reportTypeOptions
+                // } else {
+                //   _that.paramValues = []
+                //   _that.checkItemList = []
+                // }
                 _that.currOperateTask = data.data.operationTask
                 if (_that.currOperateTask == null) {
                   _that.currOperateTask = {
@@ -1392,11 +1494,11 @@
                   _that.productRecordParamValues = []
                   _that.paramTabs = []
                 } else {
-                  // 宸ユ淇℃伅
-                  _that.getStepRecords({
-                    id: _that.currOperateTask.id,
-                    sn: nodeData.batchNo.split('SN鍙�:')[1]
-                  })
+                  // 宸ユ淇℃伅--鎶ラ敊娉ㄩ噴鎺変簡
+                //   _that.getStepRecords({
+                //     id: _that.currOperateTask.id,
+                //     sn: nodeData.batchNo.split('SN鍙�:')[1]
+                //   })
                   // 宸ヨ壓鍙傛暟淇℃伅
                   _that.queryTechnologyInfo(_that.currOperateTask.id)
                   // 鐢熶骇璁板綍
@@ -1616,6 +1718,15 @@
       }
       return headerStyle
     },
+    paramsTableHeaderStyle0({ row, column, rowIndex, columnIndex }) {
+      let headerStyle = 'background:#599ef4;color:#fff;'
+      if (columnIndex === 0) {
+        headerStyle += 'border-radius: 6px 0px 0px 0px;'
+      } else if (columnIndex === 3) {
+        headerStyle += 'border-radius: 0px 6px 0px 0px;'
+      }
+      return headerStyle
+    },
     tableRowClassName({ row, rowIndex }) {
       if (rowIndex % 2 === 1) {
         return 'stripe-row'
diff --git a/src/views/warehouse/FinishedGoods/index.vue b/src/views/warehouse/FinishedGoods/index.vue
index 2207225..c652a3d 100644
--- a/src/views/warehouse/FinishedGoods/index.vue
+++ b/src/views/warehouse/FinishedGoods/index.vue
@@ -4,8 +4,9 @@
         <ttable
         :table="table"
         :isShowHide="true"
+        :ajaxFun="ajaxFun"
         :prelang="prelang"
-        :options="options" 
+        :options="options"
         ref="processconfiguration"
         >
         <template #toolbar></template>
@@ -16,9 +17,11 @@
 
 <script>
 import ttable from '@/views/common/ztt-table.vue'
+import { finishedOutcome } from '@/api/warehouse/finishedOutcome'
 export default {
     data(){
         return {
+            ajaxFun: finishedOutcome,
             prelang: 'operation',
             dataListLoading: false,
             options: {
@@ -44,104 +47,84 @@
                 column: [
                   {
                     minWidth: '140',
-                    prop: 'material',
-                    label: '璁㈠崟缂栫爜',
+                    prop: 'outBatchNo',
+                    label: '鎵规鍙�',
                     isTrue: true,
                     isSearch: true,
                     searchInfoType: 'text',
                   },
                   {
                     minWidth: '140',
-                    prop: 'type',
+                    prop: 'parNo',
+                    label: '浜у搧缂栧彿',
+                    isTrue: true,
+                    isSearch: true,
+                    searchInfoType: 'text',
+                  },{
+                    minWidth: '140',
+                    prop: 'partName',
                     label: '浜у搧鍚嶇О',
                     isTrue: true,
                     isSearch: true,
                     searchInfoType: 'text',
                   },{
                     minWidth: '140',
-                    prop: 'oo',
-                    label: '浜у搧鍨嬪彿',
-                    isTrue: true,
-                    isSearch: true,
-                    searchInfoType: 'text',
-                  },{
-                    minWidth: '140',
-                    prop: 'materhhooial',
-                    label: '璐ㄩ噺杩芥函鍙�',
+                    prop: 'specs',
+                    label: '瑙勬牸鍨嬪彿',
                     isTrue: true,
                     isSearch: true,
                     searchInfoType: 'text',
                   },
                   {
                     minWidth: '140',
-                    prop: 'mateuurial',
-                    label: '瀹㈡埛鍚嶇О',
+                    prop: 'unit',
+                    label: '鍗曚綅',
                     isTrue: true,
                     isSearch: true,
                     searchInfoType: 'text',
                   },
                   {
                     minWidth: '140',
-                    prop: 'materoiial',
-                    label: '宸ヨ壓鏂囦欢缂栧彿',
-                    isTrue: true,
-                    isSearch: true,
-                    searchInfoType: 'text',
-                  },
-                  {
-                    minWidth: '140',
-                    prop: 'matperoial',
-                    label: '搴撲綅鍙�',
-                    isTrue: true,
-                    isSearch: true,
-                    searchInfoType: 'text',
-                  },
-                  {
-                    minWidth: '140',
-                    prop: 'materpial',
-                    label: '浜у搧鍚嶇О',
-                    isTrue: true,
-                    isSearch: true,
-                    searchInfoType: 'text',
-                  },
-                  {
-                    minWidth: '130',
-                    width: '150',
-                    prop: 'dealTime',
-                    label: '瀹℃牳鏃堕棿',
-                    sort: true,
-                    isTrue: true,
-                    isSearch: true,
-                    searchInfoType: 'datetimerange',
-                    // formatter: this.formatDateTime,
-                },
-                {
-                    minWidth: '140',
-                    prop: 'maial',
+                    prop: 'number',
                     label: '鏁伴噺',
+                    isTrue: true,
+                    isSearch: true,
+                    searchInfoType: 'text',
+                  },
+                  {
+                    minWidth: '140',
+                    prop: 'c莽reateTime',
+                    label: '鍑哄簱鏃堕棿',
+                    isTrue: true,
+                    isSearch: true,
+                    searchInfoType: 'text',
+                    searchInfoType: 'datetimerange',
+                    formatter: this.formatDateTime,
+                  },
+                  {
+                    minWidth: '140',
+                    prop: 'createUser',
+                    label: '鍒涘缓浜�',
                     isTrue: true,
                     isSearch: true,
                     searchInfoType: 'text',
                   },
                 ],
                 toolbar: [
-                  {
-                    text: '鑾峰彇IFS鎴愬搧搴�',
-                    type: 'primary',
-                    // fun: this.addOrUpdateHandle
-                  },
+
                 ],
                 // operator: [],
                 // operatorConfig: {}
             },
        }
     },
-    medthods: {},
-//     computed: {
-//     ...mapGetters(['permissions'])
-//   },
+    medthods: {
+      formatDateTime(row, column, cellValue) {
+          return cellValue ? fecha.format(new Date(cellValue), 'yyyy-MM-dd') : ''
+      },
+    },
     components: {
     ttable
     },
 }
-</script>
\ No newline at end of file
+</script>
diff --git a/src/views/warehouse/FinishedWarehousing/index.vue b/src/views/warehouse/FinishedWarehousing/index.vue
index 7fbd608..b49dc54 100644
--- a/src/views/warehouse/FinishedWarehousing/index.vue
+++ b/src/views/warehouse/FinishedWarehousing/index.vue
@@ -4,9 +4,9 @@
       <ttable
         :table="table"
         :isShowHide="true"
+        :ajaxFun="ajaxFun"
         :prelang="prelang"
         :options="options"
-        :dataListLoading="false"
         ref="processconfiguration"
       >
         <template #toolbar></template>
@@ -24,6 +24,7 @@
     return {
       ajaxFun: productPage,
       prelang: 'operation',
+      dataListLoading: false,
       options: {
         height: 300, // 榛樿楂樺害-涓轰簡琛ㄥご鍥哄畾
         stripe: true, // 鏄惁涓烘枒椹汗 table
@@ -206,4 +207,4 @@
     ttable
   },
 }
-</script>
\ No newline at end of file
+</script>
diff --git a/vue.config.js b/vue.config.js
index 2b66e9c..4f8c558 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -7,7 +7,7 @@
 // const url = 'http://192.168.2.7:9999'
 // const url = 'https://ztms-mes.chinaztt.cn/'
 
-const url = 'http://192.168.23.249:9999'
+const url = 'http://192.168.0.104:9999'
 
 
 const localUrl = 'http://localhost:8089'

--
Gitblit v1.9.3