chris 3 jaren geleden
bovenliggende
commit
00f17147fd

+ 10 - 1
src/api/sale.js

@@ -115,7 +115,7 @@ export function getOutsourceList (params) {
 // 委外详情
 export function getOutsourceDetail (id) {
   return request({
-    url: request.adornUrl(`/biz-service/purCommDetail/PurCommInfo/${id}`),
+    url: request.adornUrl(`/biz-service/purCommDetail/info/${id}`),
     method: 'get'
   })
 }
@@ -128,6 +128,15 @@ export function getOutsourceDetailByProId (id) {
   })
 }
 
+// 委外详情(按排产ID查询)
+export function getOutsourceDetailByScheduleId (data) {
+  return request({
+    url: request.adornUrl(`/biz-service/purCommDetail/infoBatch`),
+    method: 'post',
+    data
+  })
+}
+
 // 通过委外申请ID查询数据
 export function getPurCommInfo (id) {
   return request({

+ 128 - 0
src/views/modules/common/doc-component.vue

@@ -0,0 +1,128 @@
+<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.label"
+          :value="item.value">
+        </el-option>
+        <el-option v-if="noMore" label="加载更多" disabled style="font-style: italic; color: #8a979e" value="undefined" @click.native="handleClick()"></el-option>
+      </el-select>
+    </div>
+</template>
+
+<script>
+  export default {
+    name: 'doc-component',
+    props: {
+      docId: {
+        type: String,
+        default: ''
+      }
+    },
+    model: {
+      prop: 'docId',
+      event: 'change'
+    },
+    data () {
+      return {
+        value: [],
+        current: 1,
+        size: 10,
+        name: '',
+        options: [],
+        loading: false,
+        noMore: false
+      }
+    },
+    watch: {
+      docId (value) {
+        this.value = value
+      }
+    },
+    mounted () {
+      this.init()
+    },
+    methods: {
+      async init () {
+        this.getList()
+      },
+      remoteMethod (query) {
+        this.options = []
+        this.current = 1
+        this.name = query
+        this.getList()
+      },
+      getList () {
+        this.$http({
+          url: this.$http.adornUrl(`/file-service/document-ctl/list`),
+          method: 'get',
+          params: this.$http.adornParams({
+            'current': this.current,
+            'size': this.size,
+            'fileName': this.name
+          })
+        }).then(({data}) => {
+          if (data && data.code === '200') {
+            if (this.current > data.data.pages) {
+              return
+            }
+            this.noMore = data.data.records.length >= 10
+            data.data.records.forEach(item => {
+              this.options.push({
+                label: item.fileName,
+                value: item.docId,
+                fileType: item.fileType,
+                url: item.url
+              })
+            })
+          } else {
+            this.options = []
+          }
+        })
+      },
+      handleClick () {
+        this.loadMore()
+      },
+      loadMore () {
+        this.current ++
+        this.getList()
+      },
+      onChange (item) {
+        if (item === 'undefined') {
+          this.value = null
+        }
+        this.$emit('change', 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>
+.el-select{
+  width: 100%;
+}
+</style>

+ 3 - 1
src/views/modules/production/scheduling.vue

@@ -243,8 +243,10 @@
       // 委外生产
       outsourceHandle (id) {
         this.outsourceVisible = true
+        let ids = []
+        ids.push(id)
         this.$nextTick(() => {
-          this.$refs.outsource.init(id, 2)
+          this.$refs.outsource.init(id, ids)
         })
       }
     }

+ 211 - 0
src/views/modules/sale/add-product.vue

@@ -0,0 +1,211 @@
+<template>
+  <div>
+    <el-dialog
+      :title="!id ? '新增': display ? '详情' : '新增或修改'"
+      width="70%"
+      :close-on-click-modal="false"
+      :visible.sync="visible">
+      <el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="100px">
+        <el-row class="my-row">
+          <el-col :span="8">
+            <el-form-item label="产品名称" prop="productName">
+              <el-input v-model="dataForm.productName" :disabled="true" placeholder="产品名称"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="产品编号" prop="prodCode">
+              <el-input v-model="dataForm.prodCode" :disabled="true" placeholder="产品编号"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="型号及规格" prop="productSpec">
+              <el-input v-model="dataForm.productSpec" :disabled="true" placeholder="型号及规格"></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row class="my-row">
+          <el-col :span="8">
+            <el-form-item label="数量" prop="cnt">
+              <el-input-number v-model="dataForm.cnt" :disabled="display" :min="1"/>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="单位" prop="unitName">
+              <el-input v-model="dataForm.unitName" :disabled="display" placeholder="单位"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="委外期限" prop="deadline">
+              <el-date-picker
+                v-model="dataForm.deadline"
+                value-format="yyyy-MM-dd"
+                type="date">
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row class="my-row">
+          <el-col :span="8">
+            <el-form-item label="批次号" prop="batchNumber">
+              <el-input v-model="dataForm.batchNumber" :disabled="display" placeholder="批次号"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="到料时间" prop="arrivedTime">
+              <el-date-picker
+                v-model="dataForm.arrivedTime"
+                value-format="yyyy-MM-dd"
+                type="date">
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="合格数量" prop="qualifiedCnt">
+              <el-input-number v-model="dataForm.qualifiedCnt" :disabled="display" :min="1"/>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row class="my-row">
+          <el-col :span="8">
+            <el-form-item label="不含税单价" prop="price">
+              <el-input-number v-model="dataForm.price" :disabled="display" :precision="1" :step="1" :min="0"/>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="含税单价" prop="taxPrice">
+              <el-input-number v-model="dataForm.taxPrice" :disabled="display" :precision="1" :step="1" :min="0"/>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="含税总价" prop="taxAmount">
+              <span>{{ (dataForm.cnt*dataForm.taxPrice).toFixed(2) }}</span>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row class="my-row">
+          <el-col :span="8">
+            <el-form-item label="税率" prop="taxRateVal">
+              <el-input-number :step="1" :min="0" v-model="dataForm.taxRateVal" :disabled="display"/>
+              %
+            </el-form-item>
+          </el-col>
+          <el-col :span="16">
+            <el-form-item label="要求说明" prop="specificationExplian">
+              <el-input v-model="dataForm.specificationExplian" :disabled="display" placeholder="要求说明"></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row class="my-row">
+          <el-form-item label="备注" prop="notes">
+            <el-input type="textarea" v-model="dataForm.notes" :disabled="display" placeholder="备注"></el-input>
+          </el-form-item>
+        </el-row>
+        <el-row class="my-row">
+          <el-form-item label="工艺文件" prop="docId">
+            <doc-component v-model="dataForm.docId" :doc-id.sync="dataForm.docId" @change="docChanged"></doc-component>
+          </el-form-item>
+        </el-row>
+        <el-row class="my-row">
+          <upload-component :title="'附件'" :accept="'*'" :file-obj-list="fileList" @uploadSuccess="uploadSuccess"/>
+        </el-row>
+      </el-form>
+      <span slot="footer">
+        <el-button @click="visible = false">取消</el-button>
+        <el-button v-if="!display" type="primary" @click="dataFormSubmit()">确定</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+  import UploadComponent from '../common/upload-component'
+  import DocComponent from '../common/doc-component'
+  export default {
+    name: 'add-product',
+    components: {DocComponent, UploadComponent},
+    data () {
+      return {
+        visible: false,
+        display: false,
+        dataList: [],
+        transferData: {},
+        dataForm: {},
+        id: 0,
+        taxRateVal: 0,
+        dataRule: {
+          productName: [{ required: true, message: '产品名称不能为空', trigger: 'blur' }],
+          prodCode: [{ required: true, message: '产品编号不能为空', trigger: 'blur' }],
+          productSpec: [{ required: true, message: '型号规格不能为空', trigger: 'blur' }],
+          batchNumber: [{ required: true, message: '批次号不能为空', trigger: 'blur' }],
+          specificationExplian: [{ required: true, message: '要求说明不能为空', trigger: 'blur' }],
+          docId: [{ required: true, message: '请选择工艺文件', trigger: 'change' }]
+        },
+        fileList: [] // 附件
+      }
+    },
+    methods: {
+      async init (id, display, transferData) {
+        this.fileList = []
+        this.dataForm = {
+          cnt: 1,
+          price: 0,
+          taxPrice: 0,
+          taxRateVal: 0
+        }
+        this.visible = true
+        this.id = id || Math.round(Math.random() * 1000000)
+        this.display = display
+        if (!id) return
+        this.dataForm = transferData
+        // 附件
+        if (transferData.attachList && transferData.attachList.length > 0) {
+          transferData.attachList.forEach((item) => {
+            this.fileList.push({
+              name: item.fileName,
+              url: item.url,
+              id: item.url
+            })
+          })
+        }
+        this.dataForm.taxRateVal = this.dataForm.taxRate ? (Number(this.dataForm.taxRate * 100)).toFixed(0) : 0
+      },
+      // 表单提交
+      dataFormSubmit () {
+        let fList = this.fileList
+        if (fList.length > 0) {
+          this.dataForm.attachList = []
+          for (let i = 0; i < fList.length; i++) {
+            this.dataForm.attachList.push({
+              fileName: fList[i].name,
+              url: fList[i].url
+            })
+          }
+        } else {
+          this.$message.error('请上传文件')
+          return
+        }
+        this.$refs['dataForm'].validate((valid) => {
+          if (valid) {
+            this.dataForm.detailId = this.id
+            this.dataForm.taxAmount = (this.dataForm.cnt * this.dataForm.taxPrice).toFixed(2)
+            this.dataForm.taxRate = this.dataForm.taxRateVal ? (Number(this.dataForm.taxRateVal / 100)).toFixed(2) : 0
+            this.visible = false
+            console.log('dataForm: ' + JSON.stringify(this.dataForm))
+            this.$emit('addItem', this.dataForm)
+          }
+        })
+      },
+      uploadSuccess (fileList) {
+        this.fileList = fileList
+      },
+      docChanged (item) {
+        if (!item) return
+        this.dataForm.technologyFile = item.label
+      }
+    }
+  }
+</script>
+
+<style scoped>
+
+</style>

+ 263 - 36
src/views/modules/sale/outsource-add-or-update.vue

@@ -37,71 +37,241 @@
               </el-form-item>
             </el-col>
           </el-row>
+          <div class="title"><span style="color: red">*</span> 委外产品明细</div>
+          <el-row class="my-row">
+            <el-table
+              :data="productDetails"
+              border
+              style="width: 100%;">
+              <el-table-column
+                label="序号"
+                type="index"
+                width="50"
+                align="center">
+              </el-table-column>
+              <el-table-column
+                prop="detailId"
+                label="ID"
+                v-if="false">
+              </el-table-column>
+              <el-table-column
+                prop="productName"
+                header-align="center"
+                align="center"
+                min-width="120"
+                label="产品名称">
+              </el-table-column>
+              <el-table-column
+                prop="prodCode"
+                header-align="center"
+                align="center"
+                min-width="120"
+                label="产品编号">
+              </el-table-column>
+              <el-table-column
+                prop="productSpec"
+                header-align="center"
+                align="center"
+                min-width="120"
+                label="型号及规格">
+              </el-table-column>
+              <el-table-column
+                prop="cnt"
+                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="deadline"
+                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="120"
+                :show-tooltip-when-overflow="true"
+                label="批次号">
+              </el-table-column>
+              <el-table-column
+                prop="specificationExplian"
+                header-align="center"
+                align="center"
+                min-width="120"
+                :show-tooltip-when-overflow="true"
+                label="要求说明">
+              </el-table-column>
+              <el-table-column
+                prop="arrivedTime"
+                header-align="center"
+                align="center"
+                min-width="140"
+                :show-tooltip-when-overflow="true"
+                label="到料时间">
+              </el-table-column>
+              <el-table-column
+                prop="qualifiedCnt"
+                header-align="center"
+                align="center"
+                label="合格数量">
+              </el-table-column>
+              <el-table-column
+                prop="technologyFile"
+                header-align="center"
+                align="center"
+                min-width="160"
+                :show-tooltip-when-overflow="true"
+                label="工艺文件">
+              </el-table-column>
+              <el-table-column
+                prop="attachList"
+                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>
+                </template>
+              </el-table-column>
+              <el-table-column
+                prop="price"
+                header-align="center"
+                align="center"
+                min-width="100"
+                label="不含税单价">
+              </el-table-column>
+              <el-table-column
+                prop="taxPrice"
+                header-align="center"
+                align="center"
+                label="含税单价">
+              </el-table-column>
+              <el-table-column
+                prop="taxAmount"
+                header-align="center"
+                align="center"
+                label="含税总价">
+              </el-table-column>
+              <el-table-column
+                prop="taxRate"
+                header-align="center"
+                align="center"
+                :formatter="formatPercent"
+                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="150"
+                label="操作">
+                <template slot-scope="scope">
+                  <el-button type="text" size="small" @click="addProductHandle(scope.row, false)">编辑</el-button>
+                  <el-button style="color: red" type="text" size="small" @click="deleteProductHandle(scope.row.detailId)">删除</el-button>
+                </template>
+              </el-table-column>
+            </el-table>
+          </el-row>
+          <el-row>
+            <span>合计(含税): {{totalAmount}}</span>
+          </el-row>
+          <el-row style="text-align: center; margin-top: 10px;">
+            <el-button type="primary" icon="el-icon-plus" @click="addMaterial"></el-button>
+          </el-row>
         </el-form>
         <span slot="footer" class="dialog-footer">
           <el-button @click="onChose">取消</el-button>
           <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
         </span>
+      <!-- 新增物品 -->
+      <Add v-show="addProductVisible" ref="comAddProduct" @addItem="addProductCallback"/>
+      <attach-detail v-if="attachVisible" ref="attachDetail" @onChose="onChose"/>
     </div>
 </template>
 
 <script>
-  import UploadComponent from '../common/upload-component'
-  import { getOutsourceDetail, getOutsourceDetailByProId } from '@/api/sale'
+  import { getOutsourceDetail, getOutsourceDetailByScheduleId } from '@/api/sale'
   import { getDictList } from '@/api/dict'
+  import Add from './add-product'
+  import AttachDetail from '../common/attach-detail'
 
 export default {
     name: 'outsource-add-or-update',
     components: {
-      UploadComponent
-    },
-    computed: {
-      orgId: {
-        get () { return this.$store.state.user.orgId }
-      }
+      Add, AttachDetail
     },
     data () {
       return {
         id: 0,
-        idType: 0, // ID类型:1 委外ID,2 排产ID
         dataForm: {},
         dataRule: {
-          // reCode: [{ required: true, message: '请选择合同评审编码', trigger: 'change' }],
-          // contractNumber: [{ required: true, message: '合同号不能为空', trigger: 'blur' }],
-          // deliveryTime: [{ required: true, message: '合同交期不能为空', trigger: 'change' }]
+          payType: [{ required: true, message: '请选择付款方式', trigger: 'change' }],
+          commissionType: [{ required: true, message: '请选择委外类别', trigger: 'change' }]
         },
         optionsType: [],
-        fileList: []
+        totalAmount: 0,
+        addProductVisible: false,
+        productDetails: [],
+        prodProductionIds: [], // 排产ID的集合
+        attachVisible: false
       }
     },
     methods: {
       onChose () {
         this.$emit('onChose')
       },
-      async init (id, type) {
-        this.idType = type || 1
-        this.fileList = []
-        this.dataForm = {}
+      async init (id, prodProductionIds) {
+        if (prodProductionIds) {
+          this.prodProductionIds = prodProductionIds
+        }
+        this.productDetails = []
+        this.dataForm = {
+          payType: '1'
+        }
         this.id = id || 0
         // 获取委外类别列表
         this.getType()
         // 详情
         if (!id) return
-        await (this.idType === 1 ? getOutsourceDetail(this.id) : getOutsourceDetailByProId(this.id)).then(({data}) => {
-          if (data && data.code === '200') {
-            this.dataForm = data.data
-            // 附件
-            if (data.data.attachList) {
-              data.data.attachList.forEach((item) => {
-                this.fileList.push({
-                  name: item.fileName,
-                  url: item.url,
-                  id: item.url
+        if (this.prodProductionIds.length > 0) {
+          await getOutsourceDetailByScheduleId({'prodProductionIds': this.prodProductionIds}).then(({data}) => {
+            if (data && data.code === '200' && data.data) {
+              this.productDetails = data.data
+              if (this.productDetails && this.productDetails.length > 0) {
+                this.productDetails.forEach((item) => {
+                  item.detailId = Math.round(Math.random() * 1000000)
                 })
-              })
+              }
             }
-          }
-        })
+          })
+        } else {
+          await getOutsourceDetail(this.id).then(({data}) => {
+            if (data && data.code === '200' && data.data) {
+              this.dataForm = data.data
+              this.productDetails = data.data.purCommissionDetails
+              if (this.productDetails && this.productDetails.length > 0) {
+                this.productDetails.forEach((item) => {
+                  item.detailId = Math.round(Math.random() * 1000000)
+                })
+              }
+            }
+          })
+        }
       },
       // 获取类别
       getType () {
@@ -111,9 +281,6 @@ export default {
           }
         })
       },
-      uploadSuccess (fileList) {
-        this.fileList = fileList
-      },
       validateField (type) {
         this.$refs.dataForm.validateField(type)
       },
@@ -121,12 +288,22 @@ export default {
       dataFormSubmit () {
         this.$refs['dataForm'].validate((valid) => {
           if (valid) {
+            let action = ''
+            if (this.prodProductionIds.length > 0) {
+              action = `/biz-service/purCommDetail/save`
+            } else {
+              action = `/biz-service/purCommDetail/${!this.id ? 'save' : 'update'}`
+            }
             // 产品明细
-            //
             this.$http({
-              url: this.$http.adornUrl(`/biz-service/purCommDetail/${!this.id ? 'save' : 'update'}`),
+              url: this.$http.adornUrl(action),
               method: 'post',
-              data: this.$http.adornData({...this.dataForm, applierId: this.$store.state.user.id, orgId: this.$store.state.user.orgId})
+              data: this.$http.adornData({
+                ...this.dataForm,
+                purCommissionDetails: this.productDetails,
+                applierId: this.$store.state.user.id,
+                orgId: this.$store.state.user.orgId
+              })
             }).then(({data}) => {
               if (data && data.code === '200') {
                 this.$message({
@@ -144,6 +321,56 @@ export default {
             })
           }
         })
+      },
+      addMaterial () {
+        this.addProductVisible = true
+        this.$nextTick(() => {
+          this.$refs.comAddProduct.init()
+        })
+      },
+      addProductHandle (row, disable) {
+        this.addProductVisible = true
+        this.$nextTick(() => {
+          this.$refs.comAddProduct.init(row.detailId, disable, row)
+        })
+      },
+      deleteProductHandle (detailId) {
+        if (!detailId) return
+        this.productDetails.splice(this.productDetails.findIndex((item) => item.detailId === detailId))
+        this.calTotal()
+      },
+      addProductCallback (data) {
+        if (!data) return
+        this.addProductVisible = false
+        let i = this.productDetails.findIndex((item) => item.detailId === data.detailId)
+        if (i > -1) {
+          this.productDetails.splice(i)
+        }
+        this.productDetails.push(data)
+        this.calTotal()
+      },
+      calTotal () {
+        let total = 0
+        if (this.productDetails) {
+          this.productDetails.forEach((item) => {
+            total += item.taxAmount ? Number(item.taxAmount) : 0
+          })
+        }
+        this.totalAmount = total
+      },
+      // 百分比
+      formatPercent (row) {
+        if (!row.taxRate) return ''
+        let str = (Number(row.taxRate * 100)).toFixed(0)
+        str += '%'
+        return str
+      },
+      // 附件
+      attachDetails (row) {
+        this.attachVisible = true
+        this.$nextTick(() => {
+          this.$refs.attachDetail.init(row.attachList)
+        })
       }
     }
   }

+ 13 - 22
src/views/modules/sale/outsource-detail.vue

@@ -40,7 +40,7 @@
       </e-desc>
       <e-desc title="委外产品明细">
         <el-table
-          :data="dataForm.purCommissionDetailVos"
+          :data="dataForm.purCommissionDetails"
           border
           style="width: 100%;">
           <el-table-column
@@ -55,27 +55,24 @@
             v-if="false">
           </el-table-column>
           <el-table-column
-            prop="goodsName"
+            prop="productName"
             header-align="center"
             align="center"
             min-width="120"
-            :show-tooltip-when-overflow="true"
             label="产品名称">
           </el-table-column>
           <el-table-column
-            prop="goodsId"
+            prop="prodCode"
             header-align="center"
             align="center"
             min-width="120"
-            :show-tooltip-when-overflow="true"
             label="产品编号">
           </el-table-column>
           <el-table-column
-            prop="specification"
+            prop="productSpec"
             header-align="center"
             align="center"
             min-width="120"
-            :show-tooltip-when-overflow="true"
             label="型号及规格">
           </el-table-column>
           <el-table-column
@@ -94,7 +91,7 @@
             prop="deadline"
             header-align="center"
             align="center"
-            min-width="160"
+            min-width="140"
             :show-tooltip-when-overflow="true"
             label="委外期限">
           </el-table-column>
@@ -102,15 +99,15 @@
             prop="batchNumber"
             header-align="center"
             align="center"
-            min-width="140"
+            min-width="120"
             :show-tooltip-when-overflow="true"
             label="批次号">
           </el-table-column>
           <el-table-column
-            prop="notes"
+            prop="specificationExplian"
             header-align="center"
             align="center"
-            min-width="140"
+            min-width="120"
             :show-tooltip-when-overflow="true"
             label="要求说明">
           </el-table-column>
@@ -126,15 +123,13 @@
             prop="qualifiedCnt"
             header-align="center"
             align="center"
-            min-width="140"
-            :show-tooltip-when-overflow="true"
             label="合格数量">
           </el-table-column>
           <el-table-column
             prop="technologyFile"
             header-align="center"
             align="center"
-            min-width="140"
+            min-width="160"
             :show-tooltip-when-overflow="true"
             label="工艺文件">
           </el-table-column>
@@ -170,17 +165,13 @@
             prop="taxRate"
             header-align="center"
             align="center"
+            :formatter="formatPercent"
             label="税率">
-            <template slot-scope="scope">
-              <span>{{scope.row.taxRate?(Number(scope.row.taxRate * 100)).toFixed(0):''}}</span>%
-            </template>
           </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>
         </el-table>
@@ -220,13 +211,13 @@
         idsPayType: [],
         optionsPayType: [
           {
-            code: '0', value: '对公转账'
+            code: '1', value: '对公转账'
           },
           {
-            code: '1', value: '先行垫付'
+            code: '2', value: '先行垫付'
           },
           {
-            code: '2', value: '财务预支'
+            code: '3', value: '财务预支'
           }
         ]
       }

+ 4 - 4
src/views/modules/sale/outsource.vue

@@ -174,12 +174,12 @@
           prop="applyTime"
           header-align="center"
           align="center"
-          min-width="140"
+          min-width="160"
           :show-tooltip-when-overflow="true"
           label="申请时间">
         </el-table-column>
         <el-table-column
-          prop="purchaseCommission.applier"
+          prop="applier"
           header-align="center"
           align="center"
           min-width="140"
@@ -187,7 +187,7 @@
           label="申请人">
         </el-table-column>
         <el-table-column
-          prop="purchaseCommission.orgName"
+          prop="orgName"
           header-align="center"
           align="center"
           min-width="140"
@@ -224,7 +224,7 @@
           label="操作">
           <template slot-scope="scope">
             <el-button v-if="isAuth('pur:commDetail:info')" type="text" size="small" @click="detailHandle(scope.row.purchaseId)">查看</el-button>
-            <el-button v-if="isAuth('pur:commDetail:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.purComDetailId)">编辑</el-button>
+            <el-button v-if="isAuth('pur:commDetail:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.purchaseId)">编辑</el-button>
             <el-button v-if="isAuth('pur:commDetail:updatePurCommissionDetail') && (Number(scope.row.purchaseState) === 1)" type="text" size="small" @click="outsourceHandle(scope.row.purComDetailId)">委外</el-button>
             <el-button v-if="isAuth('pur:commDetail:infoPutIn') && (Number(scope.row.purchaseState) === 2)" type="text" size="small" @click="inBound(scope.row.purComDetailId, false)">入库</el-button>
             <el-button v-if="isAuth('pur:commDetail:infoPutInAgain') && (Number(scope.row.purchaseState) === 5)" type="text" size="small" @click="inBound(scope.row.purComDetailId, false)">再次入库</el-button>