Browse Source

修正控制台错误

chrislee 4 months ago
parent
commit
4f10abdc81

+ 104 - 140
src/views/modules/order/dispatch-add.vue

@@ -6,7 +6,7 @@
       <el-row class="my-row">
         <el-col :span="8">
           <el-form-item label="项目号" prop="contractId">
-            <contract-component v-model="dataForm.contractId" :contract-id="dataForm.contractId"/>
+            <contract-component v-model="dataForm.contractId" :contract-id="dataForm.contractId" />
           </el-form-item>
         </el-col>
       </el-row>
@@ -33,8 +33,7 @@
           </el-table-column>
           <el-table-column fixed="right" header-align="center" align="center" width="80" label="操作">
             <template slot-scope="scope">
-              <el-button style="color: red" type="text" size="small"
-                @click="removeItem(scope.$index)">移除</el-button>
+              <el-button style="color: red" type="text" size="small" @click="removeItem(scope.$index)">移除</el-button>
             </template>
           </el-table-column>
         </el-table>
@@ -48,94 +47,56 @@
       <el-button v-if="!display" type="primary" @click="dataFormSubmit()" v-reClick>确定</el-button>
     </span>
 
-    <el-dialog 
-        title="添加" 
-        width="70%"
-        :close-on-click-modal="false"
-        :visible.sync="addItemVisible">
-        <div>
-            <el-form :inline="true" :model="dataForm" @keyup.enter.native="search()">
-                <el-form-item label="名称/图号">
-                    <el-input v-model="dataForm.materialName" placeholder="名称" clearable/>
-                </el-form-item>
-                <el-form-item>
-                    <el-button @click="search()">查询</el-button>
-                </el-form-item>
-            </el-form>
-            <el-table border :data="whMaterialRecords" @selection-change="itemSelectionChangeHandle">
-                <el-table-column type="selection"></el-table-column>
-                <el-table-column
-                    label="序号"
-                    type="index"
-                    width="50"
-                    align="center">
-                </el-table-column>
-                <el-table-column
-                    prop="orderName"
-                    header-align="center"
-                    align="center"
-                    min-width="100"
-                    :show-tooltip-when-overflow="true"
-                    label="名称">
-                </el-table-column>
-                <el-table-column
-                    prop="mapNumber"
-                    header-align="center"
-                    align="center"
-                    min-width="100"
-                    :show-tooltip-when-overflow="true"
-                    label="图号">
-                </el-table-column>
-                <el-table-column
-                    prop="specifications"
-                    header-align="center"
-                    align="center"
-                    min-width="100"
-                    :show-tooltip-when-overflow="true"
-                    label="规格">
-                </el-table-column>
-                <el-table-column
-                    prop="cnt"
-                    header-align="center"
-                    align="center"
-                    min-width="50"
-                    :show-tooltip-when-overflow="true"
-                    label="数量">
-                </el-table-column>
-                 <el-table-column
-                    prop="cnt2"
-                    header-align="center"
-                    align="center"
-                    min-width="80"
-                    :show-tooltip-when-overflow="true"
-                    label="发货数量">
-                    <template slot-scope="scope">
-                        <el-input-number v-model="scope.row.cnt2" size="mini"></el-input-number>
-                    </template>
-                </el-table-column>
-                <el-table-column
-                    prop="notes"
-                    header-align="center"
-                    align="center"
-                    min-width="100"
-                    :show-tooltip-when-overflow="true"
-                    label="备注">
-                    <template slot-scope="scope">
-                        <el-input v-model="scope.row.notes"></el-input>
-                    </template>
-                </el-table-column>
-            </el-table>
-        </div>
-        <span slot="footer">
-            <el-button @click="addItemVisible = false">取 消</el-button>
-            <el-button type="primary" @click="addItemSubmit">确 定</el-button>
-        </span>
+    <el-dialog title="添加" width="70%" :close-on-click-modal="false" :visible.sync="addItemVisible">
+      <div>
+        <el-form :inline="true" :model="dataForm" @keyup.enter.native="search()">
+          <el-form-item label="名称/图号">
+            <el-input v-model="dataForm.materialName" placeholder="名称" clearable />
+          </el-form-item>
+          <el-form-item>
+            <el-button @click="search()">查询</el-button>
+          </el-form-item>
+        </el-form>
+        <el-table border :data="whMaterialRecords" @selection-change="itemSelectionChangeHandle">
+          <el-table-column type="selection"></el-table-column>
+          <el-table-column label="序号" type="index" width="50" align="center">
+          </el-table-column>
+          <el-table-column prop="orderName" header-align="center" align="center" min-width="100"
+            :show-tooltip-when-overflow="true" label="名称">
+          </el-table-column>
+          <el-table-column prop="mapNumber" header-align="center" align="center" min-width="100"
+            :show-tooltip-when-overflow="true" label="图号">
+          </el-table-column>
+          <el-table-column prop="specifications" header-align="center" align="center" min-width="100"
+            :show-tooltip-when-overflow="true" label="规格">
+          </el-table-column>
+          <el-table-column prop="cnt" header-align="center" align="center" min-width="50"
+            :show-tooltip-when-overflow="true" label="数量">
+          </el-table-column>
+          <el-table-column prop="cnt2" header-align="center" align="center" min-width="80"
+            :show-tooltip-when-overflow="true" label="发货数量">
+            <template slot-scope="scope">
+              <el-input-number v-model="scope.row.cnt2" size="mini"></el-input-number>
+            </template>
+          </el-table-column>
+          <el-table-column prop="notes" header-align="center" align="center" min-width="100"
+            :show-tooltip-when-overflow="true" label="备注">
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.notes"></el-input>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+      <span slot="footer">
+        <el-button @click="addItemVisible = false">取 消</el-button>
+        <el-button type="primary" @click="addItemSubmit">确 定</el-button>
+      </span>
     </el-dialog>
   </div>
 </template>
 
 <script>
-  import ContractComponent from '../common/contract-component'
+import ContractComponent from '../common/contract-component'
 export default {
   name: 'dispatch-add',
   components: { ContractComponent },
@@ -166,7 +127,7 @@ export default {
       this.$emit('onChose')
     },
     async init(id, display) {
-      
+
     },
     uploadSuccess(fileList) {
       this.fileList = fileList
@@ -234,65 +195,67 @@ export default {
     removeItem(index) {
       this.dataForm.list.splice(index, 1)
     },
-    search(){
-        this.$http({
-            url: this.$http.adornUrl(`/biz-service/stock-mg-ctl/list`),
-            method: 'get',
-            params: this.$http.adornParams({
-                'current': 1,
-                'size': 10,
-                'materialName': this.dataForm.materialName
-            })
-        }).then(({data}) => {
-            if (data && data.code === '200') {
-                this.whMaterialRecords = data.data.records
-                this.whMaterialRecords.forEach(item => item.cnt2 = 0)
-            } else {
-                this.$message.error(data.msg)
-            }
+    search() {
+      this.$http({
+        url: this.$http.adornUrl(`/biz-service/stock-mg-ctl/list`),
+        method: 'get',
+        params: this.$http.adornParams({
+          'current': 1,
+          'size': 10,
+          'materialName': this.dataForm.materialName
         })
+      }).then(({ data }) => {
+        if (data && data.code === '200') {
+          this.whMaterialRecords = data.data.records
+          this.whMaterialRecords.forEach(item => {
+            item.cnt2 = 0;
+          });
+        } else {
+          this.$message.error(data.msg)
+        }
+      })
     },
-    //选择数量变化时
-    itemSelectionChangeHandle(val){
-        this.selectedItems = val
+    // 选择数量变化时
+    itemSelectionChangeHandle(val) {
+      this.selectedItems = val
     },
-    addItemSubmit(){
-        //判断是否有选择数据
-        if(this.selectedItems.length == 0) {
-            this.$message.error("请勾选数据")
-            return 
-        }
+    addItemSubmit() {
+      // 判断是否有选择数据
+      if (this.selectedItems.length === 0) {
+        this.$message.error("请勾选数据")
+        return
+      }
 
-        for (let index = 0; index < this.selectedItems.length; index++) {
-            const element = this.selectedItems[index];
-            if(element.cnt2 <= 0){
-                this.$message.error("第" + (index + 1) + "条发货数量不能小于等于0")
-                return
-            }
+      for (let index = 0; index < this.selectedItems.length; index++) {
+        const element = this.selectedItems[index];
+        if (element.cnt2 <= 0) {
+          this.$message.error("第" + (index + 1) + "条发货数量不能小于等于0")
+          return
         }
+      }
 
-        let data =  this.selectedItems.map(item => {
-            let temp = {
-                productName: item.materialName,
-                productNumber: '',
-                productSpec: item.specifications,
-                deleverCode: item.materialCode,
-                batchNumber: (item.whBatchInfoList == null || item.whBatchInfoList.length == 0) ? '' : item.whBatchInfoList[0].batchNumber,
-                deliverCnt: item.cnt2,
-                price: (item.whBatchInfoList == null || item.whBatchInfoList.length == 0) ? '' : item.whBatchInfoList[0].price,
-                notes: item.notes,
-                mapNumber: item.mapNumber,
-                materialId: item.materialId,
-                unit: item.unitName
-            }
-            temp.amount = temp.deliverCnt * temp.price
-            temp.contractId = this.dataForm.contractId
-            return temp
-        })
+      let data = this.selectedItems.map(item => {
+        let temp = {
+          productName: item.materialName,
+          productNumber: '',
+          productSpec: item.specifications,
+          deleverCode: item.materialCode,
+          batchNumber: (item.whBatchInfoList == null || item.whBatchInfoList.length === 0) ? '' : item.whBatchInfoList[0].batchNumber,
+          deliverCnt: item.cnt2,
+          price: (item.whBatchInfoList === null || item.whBatchInfoList.length === 0) ? '' : item.whBatchInfoList[0].price,
+          notes: item.notes,
+          mapNumber: item.mapNumber,
+          materialId: item.materialId,
+          unit: item.unitName
+        }
+        temp.amount = temp.deliverCnt * temp.price
+        temp.contractId = this.dataForm.contractId
+        return temp
+      })
 
-        this.dataForm.list = data
+      this.dataForm.list = data
 
-        this.addItemVisible = false
+      this.addItemVisible = false
     }
   }
 }
@@ -302,11 +265,12 @@ export default {
 .my-row {
   margin-bottom: 0px;
 }
+
 .title {
-    margin-bottom: 5px;
+  margin-bottom: 5px;
 }
 
 /deep/ .el-input-number--mini {
-    width:100px;
+  width: 100px;
 }
 </style>

+ 131 - 178
src/views/modules/order/dispatch-arrived.vue

@@ -1,200 +1,153 @@
 <template>
   <div>
-      <div class="my-title">送达</div>
-      <!-- 表单 -->
-      <el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="auto">
-        <el-table :data="dataForm.list" border>
-          <el-table-column
-            label="序号"
-            type="index"
-            width="50"
-            align="center">
-          </el-table-column>
-          <el-table-column
-            prop="productName"
-            header-align="center"
-            align="center"
-            min-width="140"
-            :show-tooltip-when-overflow="true"
-            label="名称">
-          </el-table-column>
-          <el-table-column
-            prop="productSpec"
-            header-align="center"
-            align="center"
-            min-width="140"
-            :show-tooltip-when-overflow="true"
-            label="型号/规格">
-          </el-table-column>
-          <el-table-column
-            prop="productNumber"
-            header-align="center"
-            align="center"
-            min-width="140"
-            :show-tooltip-when-overflow="true"
-            label="编号">
-          </el-table-column>
-          <el-table-column
-            prop="batchNumber"
-            header-align="center"
-            align="center"
-            min-width="140"
-            :show-tooltip-when-overflow="true"
-            label="批次号">
-          </el-table-column>
-          <el-table-column
-            prop="deliverCnt"
-            header-align="center"
-            align="center"
-            min-width="140"
-            :show-tooltip-when-overflow="true"
-            label="数量">
-          </el-table-column>
-          <el-table-column
-            prop="price"
-            header-align="center"
-            align="center"
-            min-width="140"
-            :show-tooltip-when-overflow="true"
-            label="单价">
-          </el-table-column>
-          <el-table-column
-            prop="amount"
-            header-align="center"
-            align="center"
-            min-width="140"
-            :show-tooltip-when-overflow="true"
-            label="总价">
-          </el-table-column>
-          <el-table-column
-            prop="notes"
-            header-align="center"
-            align="center"
-            min-width="140"
-            :show-tooltip-when-overflow="true"
-            label="备注">
-          </el-table-column>
-          <el-table-column
-            fixed="right"
-            prop="arriveCnt"
-            header-align="center"
-            align="center"
-            min-width="140"
-            :show-tooltip-when-overflow="true"
-            label="送达数量">
-            <template slot-scope="scope">
-              <el-input-number v-model="scope.row.arriveCnt" size="mini"></el-input-number>
-            </template>
-          </el-table-column>
-        </el-table>
-        <el-form-item label="签收附件" prop="attachList">
-            <upload-component :accept="'*'" v-model="dataForm.attachList" />
-          </el-form-item>
-      </el-form>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="onChose">取消</el-button>
-        <el-button type="primary" @click="dataFormSubmit()" v-reClick>确定</el-button>
-      </span>
+    <div class="my-title">送达</div>
+    <!-- 表单 -->
+    <el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="auto">
+      <el-table :data="dataForm.list" border>
+        <el-table-column label="序号" type="index" width="50" align="center">
+        </el-table-column>
+        <el-table-column prop="productName" header-align="center" align="center" min-width="140"
+          :show-tooltip-when-overflow="true" label="名称">
+        </el-table-column>
+        <el-table-column prop="productSpec" header-align="center" align="center" min-width="140"
+          :show-tooltip-when-overflow="true" label="型号/规格">
+        </el-table-column>
+        <el-table-column prop="productNumber" header-align="center" align="center" min-width="140"
+          :show-tooltip-when-overflow="true" label="编号">
+        </el-table-column>
+        <el-table-column prop="batchNumber" header-align="center" align="center" min-width="140"
+          :show-tooltip-when-overflow="true" label="批次号">
+        </el-table-column>
+        <el-table-column prop="deliverCnt" header-align="center" align="center" min-width="140"
+          :show-tooltip-when-overflow="true" label="数量">
+        </el-table-column>
+        <el-table-column prop="price" header-align="center" align="center" min-width="140"
+          :show-tooltip-when-overflow="true" label="单价">
+        </el-table-column>
+        <el-table-column prop="amount" header-align="center" align="center" min-width="140"
+          :show-tooltip-when-overflow="true" label="总价">
+        </el-table-column>
+        <el-table-column prop="notes" header-align="center" align="center" min-width="140"
+          :show-tooltip-when-overflow="true" label="备注">
+        </el-table-column>
+        <el-table-column fixed="right" prop="arriveCnt" header-align="center" align="center" min-width="140"
+          :show-tooltip-when-overflow="true" label="送达数量">
+          <template slot-scope="scope">
+            <el-input-number v-model="scope.row.arriveCnt" size="mini"></el-input-number>
+          </template>
+        </el-table-column>
+      </el-table>
+      <el-form-item label="签收附件" prop="attachList">
+        <upload-component :accept="'*'" v-model="dataForm.attachList" />
+      </el-form-item>
+    </el-form>
+    <span slot="footer" class="dialog-footer">
+      <el-button @click="onChose">取消</el-button>
+      <el-button type="primary" @click="dataFormSubmit()" v-reClick>确定</el-button>
+    </span>
   </div>
 </template>
 
 <script>
-  import UploadComponent from '../common/upload-component-v2'
+import UploadComponent from '../common/upload-component-v2'
 
 export default {
-    name: 'dispatch-arrived',
-    components: { UploadComponent },
-    data () {
-      return {
-        visible: false,
-        id: 0,
-        fileList: [],
-        dataForm: {
-          list:[],
-          attachList:[]
-        },
-        max: 0,
-        dataRule: {
-          attachList: [{ required: true, message: '请上传签收附件', trigger: 'blur' }]
-        }
+  name: 'dispatch-arrived',
+  components: { UploadComponent },
+  data() {
+    return {
+      visible: false,
+      id: 0,
+      fileList: [],
+      dataForm: {
+        list: [],
+        attachList: []
+      },
+      max: 0,
+      dataRule: {
+        attachList: [{ required: true, message: '请上传签收附件', trigger: 'blur' }]
       }
+    }
+  },
+  methods: {
+    onChose() {
+      this.visible = false
+      this.$emit('onChose')
     },
-    methods: {
-      onChose () {
-        this.visible = false
-        this.$emit('onChose')
-      },
-      async init (id) {
-        this.id = id
-        this.getDetails()
-      },
-      getDetails () {
-        this.$http({
-            url: this.$http.adornUrl(`/biz-service/deliver/info/${this.id}`),
-            method: 'get',
-          }).then(({data}) => {
+    async init(id) {
+      this.id = id
+      this.getDetails()
+    },
+    getDetails() {
+      this.$http({
+        url: this.$http.adornUrl(`/biz-service/deliver/info/${this.id}`),
+        method: 'get',
+      }).then(({ data }) => {
+        if (data && data.code === '200') {
+          this.dataForm.list = data.data
+          this.dataForm.list.forEach(t => { t.arriveCnt = t.deliverCnt })
+        } else {
+          this.$message.error(data.msg)
+        }
+      })
+    },
+    uploadSuccess(fileList) {
+      this.fileList = fileList
+    },
+    validateField(type) {
+      this.$refs.dataForm.validateField(type)
+    },
+    // 表单提交
+    dataFormSubmit() {
+      this.$refs['dataForm'].validate((valid) => {
+        if (valid) {
+          let submitData = this.dataForm.list.map(t => ({
+            arriveCnt: t.arriveCnt,
+            deliverId: t.deliverId,
+            contractId: t.contractId
+          }))
+          let attachList = []
+
+          for (let i = 0; i < this.dataForm.attachList.length; i++) {
+            attachList.push({
+              fileName: this.dataForm.attachList[i].name,
+              url: this.dataForm.attachList[i].url
+            })
+          }
+
+          submitData.map(t => {
+            t.attachList = attachList;
+            return t;
+          });
+
+          this.$http({
+            url: this.$http.adornUrl(`/biz-service/deliver/arrive`),
+            method: 'post',
+            data: this.$http.adornData(submitData)
+          }).then(({ data }) => {
             if (data && data.code === '200') {
-                this.dataForm.list = data.data
-                this.dataForm.list.map(t => t.arriveCnt = t.deliverCnt)
+              this.$message({
+                message: '操作成功',
+                type: 'success',
+                duration: 1500,
+                onClose: () => {
+                  this.onChose()
+                  this.$emit('refreshDataList')
+                }
+              })
             } else {
-                this.$message.error(data.msg)
+              this.$message.error(data.msg)
             }
           })
-      },
-      uploadSuccess (fileList) {
-        this.fileList = fileList
-      },
-      validateField (type) {
-        this.$refs.dataForm.validateField(type)
-      },
-      // 表单提交
-      dataFormSubmit () {
-        this.$refs['dataForm'].validate((valid) => {
-          if (valid) {
-            let submitData = this.dataForm.list.map(t => ({
-              arriveCnt: t.arriveCnt,
-              deliverId: t.deliverId,
-              contractId: t.contractId
-            }))
-            let attachList = []
-
-            for (let i = 0; i < this.dataForm.attachList.length; i++) {
-              attachList.push({
-                fileName: this.dataForm.attachList[i].name,
-                url: this.dataForm.attachList[i].url
-              })
-            }
-
-            submitData.map(t => t.attachList = attachList)
-   
-            this.$http({
-              url: this.$http.adornUrl(`/biz-service/deliver/arrive`),
-              method: 'post',
-              data: this.$http.adornData(submitData)
-            }).then(({data}) => {
-              if (data && data.code === '200') {
-                this.$message({
-                  message: '操作成功',
-                  type: 'success',
-                  duration: 1500,
-                  onClose: () => {
-                    this.onChose()
-                    this.$emit('refreshDataList')
-                  }
-                })
-              } else {
-                this.$message.error(data.msg)
-              }
-            })
-          }
-        })
-      }
+        }
+      })
     }
   }
+}
 </script>
 
 <style scoped lang="scss">
 /deep/ .el-input-number--mini {
-    width:100px;
+  width: 100px;
 }
 </style>

+ 89 - 216
src/views/modules/order/dispatch-detail.vue

@@ -9,75 +9,31 @@
       </e-desc>
       <div class="my-line">发货明细</div>
       <el-table :data="dataForm.list" border>
-        <el-table-column
-          label="序号"
-          type="index"
-          width="50"
-          align="center">
+        <el-table-column label="序号" type="index" width="50" align="center">
         </el-table-column>
-        <el-table-column
-          prop="productName"
-          header-align="center"
-          align="center"
-          min-width="140"
-          :show-tooltip-when-overflow="true"
-          label="名称">
+        <el-table-column prop="productName" header-align="center" align="center" min-width="140"
+          :show-tooltip-when-overflow="true" label="名称">
         </el-table-column>
-        <el-table-column
-          prop="productSpec"
-          header-align="center"
-          align="center"
-          min-width="140"
-          :show-tooltip-when-overflow="true"
-          label="型号/规格">
+        <el-table-column prop="productSpec" header-align="center" align="center" min-width="140"
+          :show-tooltip-when-overflow="true" label="型号/规格">
         </el-table-column>
-        <el-table-column
-          prop="productNumber"
-          header-align="center"
-          align="center"
-          min-width="140"
-          :show-tooltip-when-overflow="true"
-          label="编号">
+        <el-table-column prop="productNumber" header-align="center" align="center" min-width="140"
+          :show-tooltip-when-overflow="true" label="编号">
         </el-table-column>
-        <el-table-column
-          prop="batchNumber"
-          header-align="center"
-          align="center"
-          min-width="140"
-          :show-tooltip-when-overflow="true"
-          label="批次号">
+        <el-table-column prop="batchNumber" header-align="center" align="center" min-width="140"
+          :show-tooltip-when-overflow="true" label="批次号">
         </el-table-column>
-        <el-table-column
-          prop="deliverCnt"
-          header-align="center"
-          align="center"
-          min-width="140"
-          :show-tooltip-when-overflow="true"
-          label="数量">
+        <el-table-column prop="deliverCnt" header-align="center" align="center" min-width="140"
+          :show-tooltip-when-overflow="true" label="数量">
         </el-table-column>
-        <el-table-column
-          prop="price"
-          header-align="center"
-          align="center"
-          min-width="140"
-          :show-tooltip-when-overflow="true"
-          label="单价">
+        <el-table-column prop="price" header-align="center" align="center" min-width="140"
+          :show-tooltip-when-overflow="true" label="单价">
         </el-table-column>
-        <el-table-column
-          prop="amount"
-          header-align="center"
-          align="center"
-          min-width="140"
-          :show-tooltip-when-overflow="true"
-          label="总价">
+        <el-table-column prop="amount" header-align="center" align="center" min-width="140"
+          :show-tooltip-when-overflow="true" label="总价">
         </el-table-column>
-        <el-table-column
-          prop="notes"
-          header-align="center"
-          align="center"
-          min-width="140"
-          :show-tooltip-when-overflow="true"
-          label="备注">
+        <el-table-column prop="notes" header-align="center" align="center" min-width="140"
+          :show-tooltip-when-overflow="true" label="备注">
         </el-table-column>
       </el-table>
       <div class="my-line">出库单</div>
@@ -94,7 +50,7 @@
               <span style="color: red">审批日志(展开查看更多):</span>
             </template>
             <template v-for="(item, i) in logList">
-              <div>{{++i}}:{{item.approverName}}  {{item.createTime}}  {{item.approvalValue}}</div>
+              <div>{{+ + i }}:{{ item.approverName }} {{ item.createTime }} {{ item.approvalValue }}</div>
             </template>
           </el-collapse-item>
         </el-collapse>
@@ -107,147 +63,66 @@
       </e-desc>
       <div class="my-line">出入库详情</div>
       <el-table :data="dataForm.list2" border>
-        <el-table-column
-          label="序号"
-          type="index"
-          align="center"
-          width="50"
-        >
+        <el-table-column label="序号" type="index" align="center" width="50">
         </el-table-column>
-        <el-table-column
-          prop="orderName"
-          header-align="center"
-          align="center"
-          width="160"
-          :show-tooltip-when-overflow="true"
-          label="任务单">
+        <el-table-column prop="orderName" header-align="center" align="center" width="160"
+          :show-tooltip-when-overflow="true" label="任务单">
         </el-table-column>
-        <el-table-column
-          prop="materialName"
-          header-align="center"
-          align="center"
-          width="160"
-          :show-tooltip-when-overflow="true"
-          label="名称">
+        <el-table-column prop="materialName" header-align="center" align="center" width="160"
+          :show-tooltip-when-overflow="true" label="名称">
         </el-table-column>
-        <el-table-column
-          prop="categoryName"
-          header-align="center"
-          align="center"
-          label="类别">
+        <el-table-column prop="categoryName" header-align="center" align="center" label="类别">
         </el-table-column>
-        <el-table-column
-          prop="unitName"
-          header-align="center"
-          align="center"
-          label="单位">
+        <el-table-column prop="unitName" header-align="center" align="center" label="单位">
         </el-table-column>
-        <el-table-column
-          prop="specifications"
-          header-align="center"
-          align="center"
-          label="规格">
+        <el-table-column prop="specifications" header-align="center" align="center" label="规格">
         </el-table-column>
-        <el-table-column
-          prop="batchNumber"
-          header-align="center"
-          align="center"
-          width="140"
-          :show-tooltip-when-overflow="true"
-          label="炉(批)号">
+        <el-table-column prop="batchNumber" header-align="center" align="center" width="140"
+          :show-tooltip-when-overflow="true" label="炉(批)号">
         </el-table-column>
-        <el-table-column
-          prop="mapNumber"
-          header-align="center"
-          align="center"
-          width="140"
-          :show-tooltip-when-overflow="true"
-          label="图号">
+        <el-table-column prop="mapNumber" header-align="center" align="center" width="140"
+          :show-tooltip-when-overflow="true" label="图号">
         </el-table-column>
-        <el-table-column
-          prop="materials"
-          header-align="center"
-          align="center"
-          width="140"
-          :show-tooltip-when-overflow="true"
-          label="材料牌号">
+        <el-table-column prop="materials" header-align="center" align="center" width="140"
+          :show-tooltip-when-overflow="true" label="材料牌号">
         </el-table-column>
-        <el-table-column
-          prop="price"
-          header-align="center"
-          align="center"
-          label="单价">
+        <el-table-column prop="price" header-align="center" align="center" label="单价">
         </el-table-column>
-        <el-table-column
-          prop="cnt"
-          header-align="center"
-          align="center"
-          label="数量">
+        <el-table-column prop="cnt" header-align="center" align="center" label="数量">
         </el-table-column>
-        <el-table-column
-          prop="-"
-          header-align="center"
-          align="center"
-          label="金额">
+        <el-table-column prop="-" header-align="center" align="center" label="金额">
           <template slot-scope="scope">
             <span>{{ scope.row.price * scope.row.cnt }}</span>
           </template>
         </el-table-column>
-        <el-table-column
-          prop="source"
-          header-align="center"
-          align="center"
-          width="140"
-          :show-tooltip-when-overflow="true"
-          label="来源">
+        <el-table-column prop="source" header-align="center" align="center" width="140"
+          :show-tooltip-when-overflow="true" label="来源">
         </el-table-column>
-        <el-table-column
-          header-align="center"
-          align="center"
-          width="120"
-          label="原材料材质报告">
+        <el-table-column header-align="center" align="center" width="120" label="原材料材质报告">
           <template slot-scope="scope">
-            <el-button :disabled="!scope.row.attachTextureList || scope.row.attachTextureList.length === 0" type="text" size="small" @click="attachDetails(scope.row.attachTextureList)">查看</el-button>
+            <el-button :disabled="!scope.row.attachTextureList || scope.row.attachTextureList.length === 0" type="text"
+              size="small" @click="attachDetails(scope.row.attachTextureList)">查看</el-button>
           </template>
         </el-table-column>
-        <el-table-column
-          header-align="center"
-          align="center"
-          label="原厂合格证">
+        <el-table-column header-align="center" align="center" label="原厂合格证">
           <template slot-scope="scope">
-            <el-button :disabled="!scope.row.attachCertificateList || scope.row.attachCertificateList.length === 0" type="text" size="small" @click="attachDetails(scope.row.attachCertificateList)">查看</el-button>
+            <el-button :disabled="!scope.row.attachCertificateList || scope.row.attachCertificateList.length === 0"
+              type="text" size="small" @click="attachDetails(scope.row.attachCertificateList)">查看</el-button>
           </template>
         </el-table-column>
-        <el-table-column
-          header-align="center"
-          align="center"
-          label="复验报告">
+        <el-table-column header-align="center" align="center" label="复验报告">
           <template slot-scope="scope">
-            <el-button :disabled="!scope.row.attachReviewList || scope.row.attachReviewList.length === 0" type="text" size="small" @click="attachDetails(scope.row.attachReviewList)">查看</el-button>
+            <el-button :disabled="!scope.row.attachReviewList || scope.row.attachReviewList.length === 0" type="text"
+              size="small" @click="attachDetails(scope.row.attachReviewList)">查看</el-button>
           </template>
         </el-table-column>
-        <el-table-column
-          prop="expirationTime"
-          header-align="center"
-          align="center"
-          width="160"
-          label="到期时间">
+        <el-table-column prop="expirationTime" header-align="center" align="center" width="160" label="到期时间">
         </el-table-column>
-        <el-table-column
-          prop="conversionName"
-          header-align="center"
-          align="center"
-          width="140"
-          :show-tooltip-when-overflow="true"
-          label="是否换算">
+        <el-table-column prop="conversionName" header-align="center" align="center" width="140"
+          :show-tooltip-when-overflow="true" label="是否换算">
         </el-table-column>
-        <el-table-column
-          prop="notes"
-          header-align="center"
-          align="center"
-          width="140"
-          :show-tooltip-when-overflow="true"
-          label="备注">
+        <el-table-column prop="notes" header-align="center" align="center" width="140"
+          :show-tooltip-when-overflow="true" label="备注">
         </el-table-column>
       </el-table>
     </div>
@@ -269,19 +144,19 @@ export default {
     EDescItem,
     ApproveComponent
   },
-  data () {
+  data() {
     return {
       isFlow: true,
       stepList: [],
       logList: [],
       activeNo: 0,
       dataForm: {
-        projectName:'',
-        customerName:'',
-        amount:'',
+        projectName: '',
+        customerName: '',
+        amount: '',
         workFlowBusinessExt: {},
         workFlowProcessStepList: [],
-        list:[],
+        list: [],
         list2: []
       },
       id: 0,
@@ -289,54 +164,52 @@ export default {
     }
   },
   methods: {
-    onChose () {
+    onChose() {
       this.$emit('onChose')
     },
-    async init (id) {
+    async init(id) {
       this.id = id || 0
       this.data = []
       this.getDetails()
     },
-    getDetails () {
+    getDetails() {
       this.$http({
-          url: this.$http.adornUrl(`/biz-service/deliver/info/${this.id}`),
-          method: 'get',
-        }).then(({data}) => {
-          if (data && data.code === '200') {
-              this.dataForm.list = data.data
-              if(this.dataForm.list.length > 0){
-                this.dataForm.list2 = this.dataForm.list[0].whMaterialRecords
+        url: this.$http.adornUrl(`/biz-service/deliver/info/${this.id}`),
+        method: 'get',
+      }).then(({ data }) => {
+        if (data && data.code === '200') {
+          this.dataForm.list = data.data
+          if (this.dataForm.list.length > 0) {
+            this.dataForm.list2 = this.dataForm.list[0].whMaterialRecords
 
-                this.dataForm.projectName = data.data[0].projectName
-                this.dataForm.customerName = data.data[0].customerName
-                this.dataForm.amount = data.data[0].amount
-                this.dataForm.workFlowBusinessExt = data.data[0].whMaterialRecords[0].workFlowBusinessExt
-                this.dataForm.workFlowProcessStepList = data.data[0].whMaterialRecords[0].workFlowProcessStepList
-              }
-
-              if (this.dataForm.workFlowBusinessExt) {
-                dealStepData(this.dataForm.workFlowBusinessExt.workFlowProcessStepList, this.stepList)
-                dealStepLogs(this.dataForm.workFlowBusinessExt.processLogList, this.logList)
-              }
-              if (this.dataForm.workFlowProcessStepList) {
-                this.activeNo = Number(this.dataForm.workFlowProcessStepList.activeNo)
-              }
-
-             
-          } else {
-              this.$message.error(data.msg)
+            this.dataForm.projectName = data.data[0].projectName
+            this.dataForm.customerName = data.data[0].customerName
+            this.dataForm.amount = data.data[0].amount
+            this.dataForm.workFlowBusinessExt = data.data[0].whMaterialRecords[0].workFlowBusinessExt
+            this.dataForm.workFlowProcessStepList = data.data[0].whMaterialRecords[0].workFlowProcessStepList
+          }
+          if (this.dataForm.workFlowBusinessExt) {
+            dealStepData(this.dataForm.workFlowBusinessExt.workFlowProcessStepList, this.stepList)
+            dealStepLogs(this.dataForm.workFlowBusinessExt.processLogList, this.logList)
           }
-        })
+          if (this.dataForm.workFlowProcessStepList) {
+            this.activeNo = Number(this.dataForm.workFlowProcessStepList.activeNo)
+          }
+        } else {
+          this.$message.error(data.msg)
+        }
+      })
     },
   }
 }
 </script>
 
 <style scoped>
-  .my-line{
-    margin: 20px 0 6px;
-  }
-  .title{
-    padding: 10px 0 ;
-  }
+.my-line {
+  margin: 20px 0 6px;
+}
+
+.title {
+  padding: 10px 0;
+}
 </style>

+ 68 - 145
src/views/modules/order/dispatch.vue

@@ -12,159 +12,84 @@
         <el-form-item>
           <el-button @click="queryData()">查询</el-button>
           <el-button v-if="isAuth('order:deliver:add')" type="primary" @click="addHandle()">新增发货单</el-button>
-          <el-button v-if="isAuth('order:deliver:noteChangeConfig')" type="primary" @click="setNoticeChangeHandel()">发货通知人设置</el-button>
+          <el-button v-if="isAuth('order:deliver:noteChangeConfig')" type="primary"
+            @click="setNoticeChangeHandel()">发货通知人设置</el-button>
         </el-form-item>
       </el-form>
-      <el-table
-        :data="dataList"
-        border
-        v-loading="dataListLoading"
-        @selection-change="selectionChangeHandle"
+      <el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle"
         style="width: 100%;">
-        <el-table-column
-          label="序号"
-          type="index"
-          width="50"
-          align="center">
+        <el-table-column label="序号" type="index" width="50" align="center">
         </el-table-column>
-        <el-table-column
-          prop="projectName"
-          header-align="center"
-          align="center"
-          min-width="140"
-          :show-tooltip-when-overflow="true"
-          label="项目名称">
+        <el-table-column prop="projectName" header-align="center" align="center" min-width="140"
+          :show-tooltip-when-overflow="true" label="项目名称">
         </el-table-column>
-        <el-table-column
-          prop="customerName"
-          header-align="center"
-          align="center"
-          min-width="140"
-          :show-tooltip-when-overflow="true"
-          label="客户名称">
+        <el-table-column prop="customerName" header-align="center" align="center" min-width="140"
+          :show-tooltip-when-overflow="true" label="客户名称">
         </el-table-column>
-        <el-table-column
-          prop="productName"
-          header-align="center"
-          align="center"
-          min-width="140"
-          :show-tooltip-when-overflow="true"
-          label="物料名称">
+        <el-table-column prop="productName" header-align="center" align="center" min-width="140"
+          :show-tooltip-when-overflow="true" label="物料名称">
         </el-table-column>
-        <el-table-column
-          prop="productSpec"
-          header-align="center"
-          align="center"
-          min-width="160"
-          :show-tooltip-when-overflow="true"
-          label="规格">
+        <el-table-column prop="productSpec" header-align="center" align="center" min-width="160"
+          :show-tooltip-when-overflow="true" label="规格">
         </el-table-column>
-        <el-table-column
-          prop="deliverCnt"
-          header-align="center"
-          align="center"
-          min-width="160"
-          :show-tooltip-when-overflow="true"
-          label="送货数量">
+        <el-table-column prop="deliverCnt" header-align="center" align="center" min-width="160"
+          :show-tooltip-when-overflow="true" label="送货数量">
         </el-table-column>
-        <el-table-column
-          prop="arriveCnt"
-          header-align="center"
-          align="center"
-          min-width="120"
-          :show-overflow-tooltip="true"
-          label="送达数量">
+        <el-table-column prop="arriveCnt" header-align="center" align="center" min-width="120"
+          :show-overflow-tooltip="true" label="送达数量">
         </el-table-column>
-        <el-table-column
-          prop="price"
-          header-align="center"
-          align="center"
-          min-width="160"
-          :show-tooltip-when-overflow="true"
-          label="总价">
+        <el-table-column prop="price" header-align="center" align="center" min-width="160"
+          :show-tooltip-when-overflow="true" label="总价">
         </el-table-column>
-        <el-table-column
-          prop="notes"
-          header-align="center"
-          align="center"
-          min-width="160"
-          :show-tooltip-when-overflow="true"
-          label="备注">
+        <el-table-column prop="notes" header-align="center" align="center" min-width="160"
+          :show-tooltip-when-overflow="true" label="备注">
         </el-table-column>
-        <el-table-column
-          prop="state"
-          header-align="center"
-          align="center"
-          min-width="160"
-          label="状态">
-        >
-          <template slot-scope="scope">{{stateFormat(scope.row)}}</template>
+        <el-table-column prop="state" header-align="center" align="center" min-width="160" label="状态">
+          >
+          <template slot-scope="scope">{{ stateFormat(scope.row) }}</template>
         </el-table-column>
-        <el-table-column
-          prop="consignmentDate"
-          header-align="center"
-          align="center"
-          min-width="160"
-          label="发货时间">
+        <el-table-column prop="consignmentDate" header-align="center" align="center" min-width="160" label="发货时间">
         </el-table-column>
-        <el-table-column
-          prop="arriveDate"
-          header-align="center"
-          align="center"
-          min-width="160"
-          label="送达时间">
+        <el-table-column prop="arriveDate" header-align="center" align="center" min-width="160" label="送达时间">
         </el-table-column>
-        <el-table-column
-          header-align="center"
-          align="center"
-          label="签收附件">
+        <el-table-column header-align="center" align="center" label="签收附件">
           <template slot-scope="scope">
-            <el-button :disabled="!scope.row.attachList || scope.row.attachList.length === 0" type="text" size="small" @click="attachDetails(scope.row)">查看</el-button>
+            <el-button :disabled="!scope.row.attachList || scope.row.attachList.length === 0" type="text" size="small"
+              @click="attachDetails(scope.row)">查看</el-button>
           </template>
         </el-table-column>
-        <el-table-column
-          prop="recordCode"
-          header-align="center"
-          align="center"
-          min-width="160"
-          label="出库单编码">
+        <el-table-column prop="recordCode" header-align="center" align="center" min-width="160" label="出库单编码">
         </el-table-column>
-        <el-table-column
-          fixed="right"
-          header-align="center"
-          align="center"
-          width="180"
-          label="操作">
+        <el-table-column fixed="right" header-align="center" align="center" width="180" label="操作">
           <template slot-scope="scope">
-            <el-button v-if="isAuth('order:deliver:info')" type="text" size="small" @click="detailHandle(scope.row)">查看</el-button>
-            <el-button v-if="isAuth('order:deliver:send') && Number(scope.row.state) === 1" type="text" size="small" @click="sendHandle(scope.row.deliverId)">导出</el-button>
-            <el-button v-if="isAuth('order:deliver:arrive') && Number(scope.row.state) === 1" type="text" size="small" @click="arriveHandle(scope.row.deliverId)">送达</el-button>
-            <el-button v-if="isAuth('order:deliver:delete') && Number(scope.row.state) === 1" type="text" size="small" @click="arriveHandle(scope.row.deliverId)">删除</el-button>
+            <el-button v-if="isAuth('order:deliver:info')" type="text" size="small"
+              @click="detailHandle(scope.row)">查看</el-button>
+            <el-button v-if="isAuth('order:deliver:send') && Number(scope.row.state) === 1" type="text" size="small"
+              @click="sendHandle(scope.row.deliverId)">导出</el-button>
+            <el-button v-if="isAuth('order:deliver:arrive') && Number(scope.row.state) === 1" type="text" size="small"
+              @click="arriveHandle(scope.row.deliverId)">送达</el-button>
+            <el-button v-if="isAuth('order:deliver:delete') && Number(scope.row.state) === 1" type="text" size="small"
+              @click="arriveHandle(scope.row.deliverId)">删除</el-button>
           </template>
         </el-table-column>
       </el-table>
-      <el-pagination
-        @size-change="sizeChangeHandle"
-        @current-change="currentChangeHandle"
-        :current-page="pageIndex"
-        :page-sizes="[10, 20, 50, 100]"
-        :page-size="pageSize"
-        :total="totalPage"
+      <el-pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" :current-page="pageIndex"
+        :page-sizes="[10, 20, 50, 100]" :page-size="pageSize" :total="totalPage"
         layout="total, sizes, prev, pager, next, jumper">
       </el-pagination>
     </template>
-   <dispatch-add v-if="addVisible" ref="add" @onChose="onChose" @refreshDataList="getDataList"/>
-   <dispatch-detail v-if="detailVisible" ref="detail" @onChose="onChose"/>
+    <dispatch-add v-if="addVisible" ref="add" @onChose="onChose" @refreshDataList="getDataList" />
+    <dispatch-detail v-if="detailVisible" ref="detail" @onChose="onChose" />
     <!-- 文件预览 -->
-    <attach-detail v-if="attachVisible" ref="attachDetail" @onChose="onChose"/>
+    <attach-detail v-if="attachVisible" ref="attachDetail" @onChose="onChose" />
     <!-- 发货通知设置弹窗 -->
-    <notice-change-setting v-if="noticeChangeVisible" ref="noticeChangeSetting" @onChose="onChose"/>
+    <notice-change-setting v-if="noticeChangeVisible" ref="noticeChangeSetting" @onChose="onChose" />
     <!--送达弹窗 -->
-    <dispatch-arrived v-if="arrivedVisible" ref="arrivedPage" @onChose="onChose" @refreshDataList="getDataList"/>
+    <dispatch-arrived v-if="arrivedVisible" ref="arrivedPage" @onChose="onChose" @refreshDataList="getDataList" />
     <!-- 发货详情 -->
     <!-- <prod-management-details v-if="detailVisible" ref="detail" @onChose="onChose"/> -->
     <!-- 确定发货 -->
-    <dispatching v-if="dispatchVisible" ref="dispatching" @refreshDataList="getDataList"/>
+    <dispatching v-if="dispatchVisible" ref="dispatching" @refreshDataList="getDataList" />
   </div>
 </template>
 
@@ -179,7 +104,7 @@ import ProdManagementDetails from '@/views/modules/production/prod-management-de
 import Dispatching from '@/views/modules/order/dispatching'
 import DispatchAdd from './dispatch-add'
 export default {
-    // 发货管理
+  // 发货管理
   name: 'dispatch',
   components: {
     Dispatching,
@@ -191,11 +116,11 @@ export default {
     DispatchDetail,
     DispatchAdd
   },
-  created () {
+  created() {
     console.log(11111)
     this.queryData()
   },
-  data () {
+  data() {
     return {
       dataForm: {},
       dataList: [],
@@ -221,7 +146,7 @@ export default {
     }
   },
   methods: {
-    onChose () {
+    onChose() {
       this.attachVisible = false
       this.noticeChangeVisible = false
       this.arrivedVisible = false
@@ -229,13 +154,13 @@ export default {
       this.dispatchVisible = false
       this.addVisible = false
     },
-      // 查询
-    queryData () {
+    // 查询
+    queryData() {
       this.pageIndex = 1
       this.getDataList()
     },
-      // 获取数据列表
-    getDataList () {
+    // 获取数据列表
+    getDataList() {
       this.dataListLoading = true
       let params = {
         'current': this.pageIndex,
@@ -243,7 +168,7 @@ export default {
         'productName': this.dataForm.productName ? this.dataForm.productName : null,
         'customerName': this.dataForm.customerName ? this.dataForm.customerName : null
       }
-      getDispatchList(params).then(({data}) => {
+      getDispatchList(params).then(({ data }) => {
         if (data && data.code === '200') {
           this.dataList = data.data.records
           this.totalPage = Number(data.data.total)
@@ -254,65 +179,65 @@ export default {
         this.dataListLoading = false
       })
     },
-      // 每页数
-    sizeChangeHandle (val) {
+    // 每页数
+    sizeChangeHandle(val) {
       this.pageSize = val
       this.pageIndex = 1
       this.getDataList()
     },
-      // 当前页
-    currentChangeHandle (val) {
+    // 当前页
+    currentChangeHandle(val) {
       this.pageIndex = val
       this.getDataList()
     },
     // 多选
-    selectionChangeHandle (val) {
+    selectionChangeHandle(val) {
       this.dataListSelections = val
     },
     // 详情
-    detailHandle (row) {
+    detailHandle(row) {
       this.detailVisible = true
       this.$nextTick(() => {
         this.$refs.detail.init(row.deliverId)
       })
     },
     // 新增发货
-    addHandle(){
+    addHandle() {
       this.addVisible = true
       this.$nextTick(() => {
         this.$refs.add.init()
       })
     },
     // 发货通知人设置
-    setNoticeChangeHandel () {
+    setNoticeChangeHandel() {
       this.noticeChangeVisible = true
       this.$nextTick(() => {
         this.$refs.noticeChangeSetting.init()
       })
     },
     // 附件
-    attachDetails (row) {
+    attachDetails(row) {
       this.attachVisible = true
       this.$nextTick(() => {
         this.$refs.attachDetail.init(row.attachList)
       })
     },
     // 送达
-    arriveHandle (deliverId) {
+    arriveHandle(deliverId) {
       this.arrivedVisible = true
       this.$nextTick(() => {
         this.$refs.arrivedPage.init(deliverId)
       })
     },
     // 发货
-    sendHandle (deliverId, cnt) {
+    sendHandle(deliverId, cnt) {
       this.dispatchVisible = true
       this.$nextTick(() => {
         this.$refs.dispatching.init(deliverId, cnt)
       })
     },
     // 转换属性“状态”
-    stateFormat (row) {
+    stateFormat(row) {
       if (this.optionsState) {
         for (let i = 0; i < this.optionsState.length; i++) {
           if (this.optionsState[i].code === row.state) {
@@ -325,6 +250,4 @@ export default {
 }
 </script>
 
-<style scoped>
-
-</style>
+<style scoped></style>

+ 4 - 3
src/views/modules/tech/product-detail.vue

@@ -54,7 +54,8 @@
           </el-table-column>
           <el-table-column prop="drawingName" header-align="center" align="center" label="图纸名称">
             <template slot-scope="scope">
-              <a style="cursor:pointer" @click="previewFile(scope.row.drawingName, scope.row.attachList[0].url)">{{scope.row.drawingName}}</a>
+              <a style="cursor:pointer"
+                @click="previewFile(scope.row.drawingName, scope.row.attachList[0].url)">{{ scope.row.drawingName }}</a>
             </template>
           </el-table-column>
           <el-table-column prop="drawingNo" header-align="center" align="center" label="图号">
@@ -247,8 +248,8 @@ export default {
             {
               drawingName: "工艺流程-总检.png",
               attachList: [{
-              url: "工艺流程-总检_c74f67c27ca1526e60f9c6d622af08e6.png",
-              id: "工艺流程-总检_c74f67c27ca1526e60f9c6d622af08e6.png"
+                url: "工艺流程-总检_c74f67c27ca1526e60f9c6d622af08e6.png",
+                id: "工艺流程-总检_c74f67c27ca1526e60f9c6d622af08e6.png"
               }]
             }
           ]