瀏覽代碼

发货管理部分功能

landydb 2 月之前
父節點
當前提交
4de477c2bf

+ 124 - 0
src/views/modules/common/contract-component.vue

@@ -0,0 +1,124 @@
+<template>
+    <div>
+      <el-select
+        v-model="value"
+        ref="select"
+        placeholder="请选择"
+        clearable
+        filterable
+        remote
+        :remote-method="remoteMethod"
+        @change = "onChange"
+        @focus="cancelReadOnly"
+        @hook:mounted="cancelReadOnly"
+        @visible-change="cancelReadOnly">
+        <el-option
+          v-for="item in options"
+          :key="item.value"
+          :label="item.projectName"
+          :value="item.value">
+        </el-option>
+        <el-option v-if="options.length > 0" label="加载更多" style="font-style: italic; color: #8a979e" value="undefined" @click.native="handleClick()"></el-option>
+      </el-select>
+    </div>
+</template>
+
+<script>
+  export default {
+    name: 'contract-component',
+    props: {
+      cusId: {
+        type: String,
+        default: ''
+      }
+    },
+    model: {
+      prop: 'contractId',
+      event: 'cusSelected'
+    },
+    data () {
+      return {
+        value: '',
+        current: 1,
+        size: 10,
+        name: '',
+        options: [],
+        loading: false,
+        noMore: false
+      }
+    },
+    mounted () {
+      this.init()
+    },
+    watch: {
+      cusId (value) {
+        this.value = value
+      }
+    },
+    methods: {
+      async init () {
+        this.getList()
+      },
+      remoteMethod (query) {
+        this.options = []
+        this.current = 1
+        this.name = query
+        this.getList()
+      },
+      getList () {
+        this.$http({
+          url: this.$http.adornUrl(`/biz-service/cusContractBook/list`),
+          method: 'get',
+          params: this.$http.adornParams({
+            'current': this.current,
+            'size': this.size,
+            'projectName': this.name
+          })
+        }).then(({data}) => {
+          if (data && data.code === '200') {
+            if (this.current > data.data.pages) {
+              return
+            }
+            data.data.records.forEach(item => {
+              this.options.push({
+                label: item.contractName,
+                value: item.contractId,
+                projectName: item.projectName
+              })
+            })
+          } else {
+            this.options = []
+          }
+        })
+      },
+      handleClick () {
+        this.loadMore()
+      },
+      loadMore () {
+        this.current ++
+        this.getList()
+      },
+      onChange (item) {
+        if (item === 'undefined') {
+          this.value = null
+        }
+        this.$emit('cusSelected', item)
+      },
+      cancelReadOnly (onOff) {
+        this.$nextTick(() => {
+          if (!onOff) {
+            const input = this.$refs.select.$el.querySelector('.el-input__inner')
+            const timer = setTimeout(() => {
+              input.removeAttribute('readonly')
+              clearTimeout(timer)
+            }, 200)
+          }
+        })
+      }
+    }
+  }
+</script>
+
+<style scoped>
+
+</style>

+ 312 - 0
src/views/modules/order/dispatch-add.vue

@@ -0,0 +1,312 @@
+<template>
+  <div>
+    <div class="my-title">{{ !id ? '新增' : display ? '详情' : '修改' }}</div>
+    <!-- 表单 -->
+    <el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="auto">
+      <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"/>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-row>
+        <div class="title">发货时间</div>
+        <el-table :data="dataForm.list" border style="width: 100%;">
+          <el-table-column label="序号" type="index" width="50" align="center">
+          </el-table-column>
+          <el-table-column prop="productName" header-align="center" align="center" label="名称">
+          </el-table-column>
+          <el-table-column prop="productSpec" header-align="center" align="center" label="型号/规格">
+          </el-table-column>
+          <el-table-column prop="deliverCode" header-align="center" align="center" label="编号">
+          </el-table-column>
+          <el-table-column prop="batchNumber" header-align="center" align="center" label="批次号">
+          </el-table-column>
+          <el-table-column prop="deliverCnt" header-align="center" align="center" label="数量">
+          </el-table-column>
+          <el-table-column prop="price" header-align="center" align="center" label="单价">
+          </el-table-column>
+          <el-table-column prop="amount" header-align="center" align="center" label="总价">
+          </el-table-column>
+          <el-table-column prop="notes" header-align="center" align="center" label="备注">
+          </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>
+            </template>
+          </el-table-column>
+        </el-table>
+        <el-row style="text-align: center; margin-top: 10px;">
+          <el-button v-show="!display" type="primary" icon="el-icon-plus" @click="addDeliverList"></el-button>
+        </el-row>
+      </el-row>
+    </el-form>
+    <span slot="footer" class="dialog-footer">
+      <el-button @click="onChose">取消</el-button>
+      <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>
+  </div>
+</template>
+
+<script>
+  import ContractComponent from '../common/contract-component'
+export default {
+  name: 'dispatch-add',
+  components: { ContractComponent },
+  computed: {},
+  data() {
+    return {
+      productListVisible: false,
+      drawListVisible: false,
+      materialCompVisible: false,
+      visible: false,
+      display: false,
+      addItemVisible: false,
+      listingList: [],
+      dataList: [],
+      id: 0,
+      whMaterialRecords: [],
+      dataForm: {
+        list: []
+      },
+      selectedItems: [],
+      dataRule: {
+        contractId: [{ required: true, message: '请选择', trigger: 'blur' }],
+      },
+    }
+  },
+  methods: {
+    onChose() {
+      this.$emit('onChose')
+    },
+    async init(id, display) {
+      
+    },
+    uploadSuccess(fileList) {
+      this.fileList = fileList
+    },
+    // 添加组合物料
+    addProduct() {
+      this.productListVisible = true
+      this.$nextTick(() => {
+        this.$refs.productList.init()
+      })
+    },
+    addProductItems(items) {
+      // this.productDetails = []
+      items.forEach((item) => {
+        this.addProductItem(item)
+      })
+    },
+    addProductItem(item) {
+      let productId = item.productId
+      if (!this.productDetails.some(item => item.productId === productId)) {
+        this.productDetails.push({
+          ...item
+        })
+      }
+    },
+    deleteProductHandle(productId) {
+      this.productDetails.splice(this.productDetails.findIndex((item) => item.productId === productId), 1)
+    },
+    validateField(type) {
+      this.$refs.dataForm.validateField(type)
+    },
+    // 表单提交
+    dataFormSubmit() {
+      this.$refs['dataForm'].validate((valid) => {
+        if (valid) {
+          this.$http({
+            url: this.$http.adornUrl(`/biz-service/deliver/save`),
+            method: 'post',
+            data: this.$http.adornData(this.dataForm.list)
+          }).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)
+            }
+          })
+        } else {
+          // this.$message.error('请检查输入参数')
+        }
+      })
+    },
+    // 添加发货清单
+    addDeliverList() {
+      this.addItemVisible = true
+      this.search()
+    },
+    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)
+            }
+        })
+    },
+    //选择数量变化时
+    itemSelectionChangeHandle(val){
+        this.selectedItems = val
+    },
+    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
+            }
+        }
+
+        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.addItemVisible = false
+    }
+  }
+}
+</script>
+
+<style scoped lang="scss">
+.my-row {
+  margin-bottom: 0px;
+}
+.title {
+    margin-bottom: 5px;
+}
+
+/deep/ .el-input-number--mini {
+    width:100px;
+}
+</style>

+ 301 - 42
src/views/modules/order/dispatch-detail.vue

@@ -1,24 +1,256 @@
 <template>
   <div>
     <div class="my-title">查看</div>
-    <el-form
-      :model="dataForm"
-      :rules="dataRule"
-      ref="dataForm"
-      label-width="auto"
-    >
-      <el-row
-        class="my-row"
-        style="height: 350px; background-color: #efefef;"
-      >
-        <work-flow
-          ref="workFlow"
-          :nodeData="workFlowData"
-          :selectOperator="true"
-          :disabled="true"
-        ></work-flow>
-      </el-row>
-    </el-form>
+    <div style="margin-left: 20px;margin-right: 20px">
+      <e-desc title="" column="3">
+        <e-desc-item label="项目名称">{{ dataForm.projectName }}</e-desc-item>
+        <e-desc-item label="客户名称">{{ dataForm.customerName }}</e-desc-item>
+        <e-desc-item label="总价">{{ dataForm.amount }}</e-desc-item>
+      </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>
+        <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="arriveCnt"
+          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>
+      <div class="my-line">出库单</div>
+      <!-- 工作流 -->
+      <div v-show="dataForm.workFlowBusinessExt">
+        <el-steps :active="activeNo" finish-status="success" align-center style="margin-bottom: 20px">
+          <template v-for="(item, i) in stepList">
+            <el-step :icon="item.icon" :title="item.title" :description="item.description"></el-step>
+          </template>
+        </el-steps>
+        <el-collapse style="margin-bottom: 20px">
+          <el-collapse-item>
+            <template slot="title">
+              <span style="color: red">审批日志(展开查看更多):</span>
+            </template>
+            <template v-for="(item, i) in logList">
+              <div>{{++i}}:{{item.approverName}}  {{item.createTime}}  {{item.approvalValue}}</div>
+            </template>
+          </el-collapse-item>
+        </el-collapse>
+      </div>
+      <div class="my-line">基本信息</div>
+      <e-desc title="" column="3" v-for="item in dataForm.list" :key="item.recordId">
+        <e-desc-item label="编码">{{ item.deliverCode }}</e-desc-item>
+        <e-desc-item label="出入库申请人">{{ item.creatorId }}</e-desc-item>
+        <e-desc-item label="申请人部门">{{ item.creatorId }}</e-desc-item>
+      </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>
+        <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>
+        <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>
+        <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>
+        <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>
+        <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>
+        <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>
+        <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>
+          </template>
+        </el-table-column>
+        <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>
+          </template>
+        </el-table-column>
+        <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>
+          </template>
+        </el-table-column>
+        <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>
+        <el-table-column
+          prop="notes"
+          header-align="center"
+          align="center"
+          width="140"
+          :show-tooltip-when-overflow="true"
+          label="备注">
+        </el-table-column>
+      </el-table>
+    </div>
     <span slot="footer" class="dialog-footer">
       <el-button @click="onChose">返回</el-button>
     </span>
@@ -26,22 +258,34 @@
 </template>
 
 <script>
-import WorkFlow from '@/components/work-flow/home'
-import { getProductionDetail } from '@/api/sale'
+import EDesc from '../common/e-desc'
+import EDescItem from '../common/e-desc-item'
+import { dealStepData, dealStepLogs } from '@/api/util'
+import ApproveComponent from '../common/approve-component'
 export default {
   name: 'dispatch-detail',
   components: {
-    WorkFlow
+    EDesc,
+    EDescItem,
+    ApproveComponent
   },
   data () {
     return {
-      dataForm: {},
+      isFlow: true,
+      stepList: [],
+      logList: [],
+      activeNo: 0,
+      dataForm: {
+        projectName:'',
+        customerName:'',
+        amount:'',
+        workFlowBusinessExt: {},
+        workFlowProcessStepList: [],
+        list:[],
+        list2: []
+      },
       id: 0,
       dataRule: {},
-      workFlowData: {
-        nodeList: [],
-        lineList: []
-      }
     }
   },
   methods: {
@@ -50,32 +294,47 @@ export default {
     },
     async init (id) {
       this.id = id || 0
-      this.dataForm = {}
+      this.data = []
       this.getDetails()
     },
     getDetails () {
-      getProductionDetail(this.id).then(({data}) => {
-        if (data && data.code === '200' && data.data) {
-          this.dataForm = { ...this.dataForm }
-          // 流程图展示
-          this.workFlowData = {
-            nodeList: data.data.nodeList,
-            lineList: data.data.lineList
+      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
+
+                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)
           }
-        } else {
-          this.$message.error(data.msg)
-          this.onChose()
-        }
-      })
-    }
+        })
+    },
   }
 }
 </script>
 
 <style scoped>
   .my-line{
-    border-bottom: 1px solid #c0c4cc;
-    margin-bottom: 10px;
+    margin: 20px 0 6px;
   }
   .title{
     padding: 10px 0 ;

+ 51 - 72
src/views/modules/order/dispatch.vue

@@ -1,29 +1,17 @@
 <!-- 发货管理 -->
 <template>
   <div class="order">
-    <template v-if="!noticeChangeVisible && !attachVisible && !arrivedVisible && !detailVisible">
+    <template v-if="!noticeChangeVisible && !attachVisible && !arrivedVisible && !detailVisible && !addVisible">
       <el-form :inline="true" :model="dataForm" @keyup.enter.native="queryData()">
-        <el-form-item label="名称" prop="productName">
-          <el-input v-model="dataForm.productName" placeholder="名称" clearable></el-input>
+        <el-form-item label="项目名称" prop="productName">
+          <el-input v-model="dataForm.productName" placeholder="项目名称" clearable></el-input>
         </el-form-item>
-        <el-form-item label="任务单编码" prop="orderCode">
-          <el-input v-model="dataForm.orderCode" placeholder="任务单编码" clearable></el-input>
-        </el-form-item>
-        <el-form-item label="生产状态" prop="state">
-          <el-select
-            v-model="dataForm.state"
-            remote
-            placeholder="请选择">
-            <el-option
-              v-for="item in optionsState"
-              :key="item.code"
-              :label="item.value"
-              :value="item.code">
-            </el-option>
-          </el-select>
+        <el-form-item label="客户名称" prop="customerName">
+          <el-input v-model="dataForm.customerName" placeholder="客户名称" clearable></el-input>
         </el-form-item>
         <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-form-item>
       </el-form>
@@ -40,12 +28,12 @@
           align="center">
         </el-table-column>
         <el-table-column
-          prop="orderCode"
+          prop="projectName"
           header-align="center"
           align="center"
           min-width="140"
           :show-tooltip-when-overflow="true"
-          label="任务单编码">
+          label="项目名称">
         </el-table-column>
         <el-table-column
           prop="customerName"
@@ -55,24 +43,6 @@
           :show-tooltip-when-overflow="true"
           label="客户名称">
         </el-table-column>
-        <el-table-column
-          fixed="right"
-          prop="contractNumber"
-          header-align="center"
-          align="center"
-          min-width="160"
-          :show-tooltip-when-overflow="true"
-          label="生产编号">
-        </el-table-column>
-        <el-table-column
-          fixed="right"
-          header-align="center"
-          align="center"
-          min-width="80"
-          :formatter="stateFormat"
-          :show-tooltip-when-overflow="true"
-          label="生产状态">
-        </el-table-column>
         <el-table-column
           prop="productName"
           header-align="center"
@@ -82,12 +52,12 @@
           label="物料名称">
         </el-table-column>
         <el-table-column
-          prop="cnt"
+          prop="productSpec"
           header-align="center"
           align="center"
-          min-width="120"
-          :show-overflow-tooltip="true"
-          label="数量">
+          min-width="160"
+          :show-tooltip-when-overflow="true"
+          label="规格">
         </el-table-column>
         <el-table-column
           prop="deliverCnt"
@@ -101,22 +71,25 @@
           prop="arriveCnt"
           header-align="center"
           align="center"
-          min-width="160"
+          min-width="120"
+          :show-overflow-tooltip="true"
           label="送达数量">
         </el-table-column>
         <el-table-column
-          prop="deliveryDate"
+          prop="price"
           header-align="center"
           align="center"
           min-width="160"
-          label="交期时间">
+          :show-tooltip-when-overflow="true"
+          label="总价">
         </el-table-column>
         <el-table-column
-          prop="batchNumber"
+          prop="notes"
           header-align="center"
           align="center"
           min-width="160"
-          label="批次号">
+          :show-tooltip-when-overflow="true"
+          label="备注">
         </el-table-column>
         <el-table-column
           prop="state"
@@ -149,17 +122,24 @@
             <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>
         <el-table-column
           fixed="right"
           header-align="center"
           align="center"
-          width="160"
+          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) === 2 || Number(scope.row.state) === 3)" type="text" size="small" @click="sendHandle(scope.row.deliverId, scope.row.cnt)">发货</el-button>
-            <el-button v-if="isAuth('order:deliver:arrive') && Number(scope.row.state) === 3" type="text" size="small" @click="arriveHandle(scope.row.deliverId, scope.row.cnt)">送达</el-button>
+            <el-button v-if="isAuth('order:deliver:send') && Number(scope.row.state) === 1" type="text" size="small" @click="sendHandle(scope.row.deliverId, scope.row.cnt)">导出</el-button>
+            <el-button v-if="isAuth('order:deliver:arrive') && Number(scope.row.state) === 1" type="text" size="small" @click="arriveHandle(scope.row.deliverId, scope.row.cnt)">送达</el-button>
+            <el-button v-if="isAuth('order:deliver:delete') && Number(scope.row.state) === 1" type="text" size="small" @click="arriveHandle(scope.row.deliverId, scope.row.cnt)">删除</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -173,8 +153,8 @@
         layout="total, sizes, prev, pager, next, jumper">
       </el-pagination>
     </template>
-<!--    <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>-->
-<!--    <detail v-if="detailVisible" ref="detail"/>-->
+   <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"/>
     <!-- 发货通知设置弹窗 -->
@@ -182,7 +162,7 @@
     <!--送达弹窗 -->
     <dispatch-arrived v-if="arrivedVisible" ref="arrivedPage" @onChose="onChose" @refreshDataList="getDataList"/>
     <!-- 发货详情 -->
-    <prod-management-details v-if="detailVisible" ref="detail" @onChose="onChose"/>
+    <!-- <prod-management-details v-if="detailVisible" ref="detail" @onChose="onChose"/> -->
     <!-- 确定发货 -->
     <dispatching v-if="dispatchVisible" ref="dispatching" @refreshDataList="getDataList"/>
   </div>
@@ -197,6 +177,7 @@ import DispatchArrived from './dispatch-arrived'
 import DispatchDetail from './dispatch-detail'
 import ProdManagementDetails from '@/views/modules/production/prod-management-details'
 import Dispatching from '@/views/modules/order/dispatching'
+import DispatchAdd from './dispatch-add'
 export default {
     // 发货管理
   name: 'dispatch',
@@ -207,9 +188,11 @@ export default {
     PreviewComponent,
     NoticeChangeSetting,
     DispatchArrived,
-    DispatchDetail
+    DispatchDetail,
+    DispatchAdd
   },
   created () {
+    console.log(11111)
     this.queryData()
   },
   data () {
@@ -226,24 +209,13 @@ export default {
       arrivedVisible: false,
       detailVisible: false,
       dispatchVisible: false,
+      addVisible: false,
       optionsState: [
         {
-          code: null, value: '全部'
-        },
-        {
-          code: '0', value: '待排产'
-        },
-        {
-          code: '1', value: '生产中'
-        },
-        {
-          code: '2', value: '已完成'
+          code: '1', value: '发货中'
         },
         {
-          code: '3', value: '发货中'
-        },
-        {
-          code: '4', value: '已送达'
+          code: '2', value: '已送达'
         }
       ]
     }
@@ -255,6 +227,7 @@ export default {
       this.arrivedVisible = false
       this.detailVisible = false
       this.dispatchVisible = false
+      this.addVisible = false
     },
       // 查询
     queryData () {
@@ -268,8 +241,7 @@ export default {
         'current': this.pageIndex,
         'size': this.pageSize,
         'productName': this.dataForm.productName ? this.dataForm.productName : null,
-        'orderCode': this.dataForm.orderCode ? this.dataForm.orderCode : null,
-        'state': this.dataForm.state ? this.dataForm.state : null
+        'customerName': this.dataForm.customerName ? this.dataForm.customerName : null
       }
       getDispatchList(params).then(({data}) => {
         if (data && data.code === '200') {
@@ -301,7 +273,14 @@ export default {
     detailHandle (row) {
       this.detailVisible = true
       this.$nextTick(() => {
-        this.$refs.detail.init(row.prodProductionId, 3)
+        this.$refs.detail.init(row.deliverId)
+      })
+    },
+    // 新增发货
+    addHandle(){
+      this.addVisible = true
+      this.$nextTick(() => {
+        this.$refs.add.init()
       })
     },
     // 发货通知人设置

+ 2 - 2
src/views/modules/tech/product-add-or-update.vue

@@ -113,7 +113,7 @@
           </el-form-item>
         </el-col>
       </el-row>
-      <el-row>
+      <!-- <el-row>
         <div class="title"> 关联图纸</div>
         <el-table :data="drawingList" border style="width: 100%;">
           <el-table-column label="序号" type="index" width="50" align="center">
@@ -136,7 +136,7 @@
         <el-row style="text-align: center; margin-top: 10px;">
           <el-button v-show="!display" type="primary" icon="el-icon-plus" @click="addDrawingList"></el-button>
         </el-row>
-      </el-row>
+      </el-row> -->
       <el-row class="my-row">
         <el-form-item label="是否组合物料" prop="displayProductList">
           <el-switch v-model="displayProductList" active-color="#13ce66" inactive-color="#ff4949" active-text="是"

+ 13 - 0
src/views/modules/tech/product-detail.vue

@@ -53,6 +53,9 @@
           <el-table-column label="序号" type="index" width="50" align="center">
           </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>
+            </template>
           </el-table-column>
           <el-table-column prop="drawingNo" header-align="center" align="center" label="图号">
           </el-table-column>
@@ -240,6 +243,16 @@ export default {
               }
             })
           }
+          this.dataForm.proDrawings = [
+            {
+              drawingName: "工艺流程-总检.png",
+              attachList: [{
+              url: "工艺流程-总检_c74f67c27ca1526e60f9c6d622af08e6.png",
+              id: "工艺流程-总检_c74f67c27ca1526e60f9c6d622af08e6.png"
+              }]
+            }
+          ]
+
           // 初始化审批Form
           this.showApproveForm(businessType, this.id)
         }