Browse Source

销售出库修改

wengyuwen 4 years ago
parent
commit
04f17ef62a
2 changed files with 110 additions and 111 deletions
  1. 109 110
      src/views/purchaseIssue/index.vue
  2. 1 1
      src/views/warehouse/inStock/index.vue

+ 109 - 110
src/views/purchaseIssue/index.vue

@@ -83,69 +83,69 @@
       ref="ApprovalComments"
       @refreshDataList="returnData"
     ></approval-comments>
-    <el-dialog
-      title="打印采购"
-      :visible.sync="dialogVisible"
-      :fullscreen="true"
-      style="padding: 0;margin:0"
-      width="70%">
-      <div ref="print">
-        <table class="table table-striped table-bordered" align="center" valign="center">
-          <tr>
-            <td style="font-size: 24px;font-weight:bold" class="column" colspan="6">采购表</td>
-          </tr>
-          <tr>
-            <td class="column" style="width: 10%;">项目</td>
-            <td class="column" style="width: 25%;">{{formList.projectName}}</td>
-            <td class="column" style="width: 10%;">供应商</td>
-            <td class="column" style="width: 25%;">{{ formList.corpName }}</td>
-            <td class="column" style="width: 25%;" colspan="2">日期:{{formList.fBsdate}}</td>
-          </tr>
-        </table>
-        <table class="table table-striped table-bordered" align="center" valign="center">
-          <tr>
-            <td class="column" style="width: 15%;border-top: none;">品名</td>
-            <td class="column" style="width: 15%;border-top: none;">单价</td>
-            <td class="column" style="width: 15%;border-top: none;">采购计划(斤)</td>
-            <td class="column" style="width: 15%;border-top: none;">实际重量(斤)</td>
-            <td class="column" style="width: 15%;border-top: none;">金额</td>
-            <td class="column" style="width: 20%;border-top: none;">备注</td>
-          </tr>
-          <tr v-for="(item,index) in this.contentList" :key="index">
-            <td class="column">{{item.feeName}}</td>
-            <td class="column">{{item.fUnitprice}}</td>
-            <td class="column">{{item.fPurchase}}</td>
-            <td class="column">{{item.fQty}}</td>
-            <td class="column">{{item.fAmount}}</td>
-            <td class="column">{{item.remark}}</td>
-          </tr>
-        </table>
-        <table class="table table-striped table-bordered" align="center" valign="center">
-          <tr>
-            <td colspan="6" style="border-top: none;" class="column"></td>
-          </tr>
-          <tr>
-            <td class="column" style="width: 25%;">采购人签字</td>
-            <td class="column" style="width: 25%;">厨房主管签字</td>
-            <td class="column" style="width: 25%;">验收人签字</td>
-            <td class="column" style="width: 25%;">主管签字</td>
-          </tr>
-          <tr>
-            <td class="column" style="width: 25%;height: 37px;"></td>
-            <td class="column" style="width: 25%;"></td>
-            <td class="column" style="width: 25%;"></td>
-            <td class="column" style="width: 25%;"></td>
-          </tr>
-          <tr>
-            <td colspan="4" style="border-top: none;font-weight:bold;text-align: right;padding-right: 10%;font-size: 16px;" class="column">{{ formList.fsbuName }}</td>
-          </tr>
-        </table>
-      </div>
-      <span slot="footer" class="dialog-footer">
-    <el-button @click="dialogVisible = false">取 消</el-button>
-    <el-button type="primary" @click="Printing">打印</el-button>
-  </span>
-    </el-dialog>
+<!--    <el-dialog-->
+<!--      title="打印采购"-->
+<!--      :visible.sync="dialogVisible"-->
+<!--      :fullscreen="true"-->
+<!--      style="padding: 0;margin:0"-->
+<!--      width="70%">-->
+<!--      <div ref="print">-->
+<!--        <table class="table table-striped table-bordered" align="center" valign="center">-->
+<!--          <tr>-->
+<!--            <td style="font-size: 24px;font-weight:bold" class="column" colspan="6">采购表</td>-->
+<!--          </tr>-->
+<!--          <tr>-->
+<!--            <td class="column" style="width: 10%;">项目</td>-->
+<!--            <td class="column" style="width: 25%;">{{formList.projectName}}</td>-->
+<!--            <td class="column" style="width: 10%;">供应商</td>-->
+<!--            <td class="column" style="width: 25%;">{{ formList.corpName }}</td>-->
+<!--            <td class="column" style="width: 25%;" colspan="2">日期:{{formList.fBsdate}}</td>-->
+<!--          </tr>-->
+<!--        </table>-->
+<!--        <table class="table table-striped table-bordered" align="center" valign="center">-->
+<!--          <tr>-->
+<!--            <td class="column" style="width: 15%;border-top: none;">品名</td>-->
+<!--            <td class="column" style="width: 15%;border-top: none;">单价</td>-->
+<!--            <td class="column" style="width: 15%;border-top: none;">采购计划(斤)</td>-->
+<!--            <td class="column" style="width: 15%;border-top: none;">实际重量(斤)</td>-->
+<!--            <td class="column" style="width: 15%;border-top: none;">金额</td>-->
+<!--            <td class="column" style="width: 20%;border-top: none;">备注</td>-->
+<!--          </tr>-->
+<!--          <tr v-for="(item,index) in this.contentList" :key="index">-->
+<!--            <td class="column">{{item.feeName}}</td>-->
+<!--            <td class="column">{{item.fUnitprice}}</td>-->
+<!--            <td class="column">{{item.fPurchase}}</td>-->
+<!--            <td class="column">{{item.fQty}}</td>-->
+<!--            <td class="column">{{item.fAmount}}</td>-->
+<!--            <td class="column">{{item.remark}}</td>-->
+<!--          </tr>-->
+<!--        </table>-->
+<!--        <table class="table table-striped table-bordered" align="center" valign="center">-->
+<!--          <tr>-->
+<!--            <td colspan="6" style="border-top: none;" class="column"></td>-->
+<!--          </tr>-->
+<!--          <tr>-->
+<!--            <td class="column" style="width: 25%;">采购人签字</td>-->
+<!--            <td class="column" style="width: 25%;">厨房主管签字</td>-->
+<!--            <td class="column" style="width: 25%;">验收人签字</td>-->
+<!--            <td class="column" style="width: 25%;">主管签字</td>-->
+<!--          </tr>-->
+<!--          <tr>-->
+<!--            <td class="column" style="width: 25%;height: 37px;"></td>-->
+<!--            <td class="column" style="width: 25%;"></td>-->
+<!--            <td class="column" style="width: 25%;"></td>-->
+<!--            <td class="column" style="width: 25%;"></td>-->
+<!--          </tr>-->
+<!--          <tr>-->
+<!--            <td colspan="4" style="border-top: none;font-weight:bold;text-align: right;padding-right: 10%;font-size: 16px;" class="column">{{ formList.fsbuName }}</td>-->
+<!--          </tr>-->
+<!--        </table>-->
+<!--      </div>-->
+<!--      <span slot="footer" class="dialog-footer">-->
+<!--    <el-button @click="dialogVisible = false">取 消</el-button>-->
+<!--    <el-button type="primary" @click="Printing">打印</el-button>-->
+<!--  </span>-->
+<!--    </el-dialog>-->
   </div>
 </template>
 
@@ -163,7 +163,7 @@ import {
   warehouse,
   listDelete,
   tableDeleteQuery,
-  confirmDeletion, pleaseCheck
+  confirmDeletion, pleaseCheck, revoke
 } from '@/api/purchaseRequest/index'
 import Cookies from 'js-cookie'
 
@@ -486,12 +486,6 @@ export default {
           icon: 'el-icon-edit-outline',
           name: '请核',
           disabled: false
-        },{
-          type: 'primary',
-          size: 'mini',
-          icon: 'el-icon-edit-outline',
-          name: '查看审批',
-          disabled: false
         },
         {
           type: 'info',
@@ -673,7 +667,6 @@ export default {
     this.getRow(data)
     this.query(this.formDataList)
     productName().then(res => {
-      console.log(res)
       if (res.code === 200) {
         for (let item in res.rows) {
           this.listData.fFeeid.push({
@@ -681,11 +674,9 @@ export default {
             value: res.rows[item].fId
           })
         }
-        console.log(this.listData)
       }
     })
     this.getDicts('data_unitfees').then(res => {
-      console.log(res.data)
       for (let item in res.data) {
         this.listData.fFeeunitid.push({
           label: res.data[item].dictLabel,
@@ -694,7 +685,6 @@ export default {
       }
     })
     this.getDicts('f_paymode').then(res => {
-      console.log(res)
       for (let item in res.data) {
         this.listData.fStltypeid.push({
           label: res.data[item].dictLabel,
@@ -703,17 +693,14 @@ export default {
       }
     })
     this.getDicts('f_deliveryCategory').then(res => {
-      console.log(res)
       for (let item in res.data) {
         this.dataList.fMarketTypid.push({
           label: res.data[item].dictLabel,
           value: JSON.parse(res.data[item].dictValue)
         })
-        console.log(this.listData.fMarketTypid)
       }
     })
     queryItem().then(res => {
-      console.log(res)
       for (let item in res.data) {
         this.dataList.fGoodsid.push({
           label: res.data[item].projectName,
@@ -726,7 +713,6 @@ export default {
     })
     //查询仓库
     warehouse().then(res => {
-      console.log(res)
       for (let item in res.rows) {
         this.dataList.fWarehouseid.push({
           label: res.rows[item].fName,
@@ -740,11 +726,8 @@ export default {
   methods: {
     homePage(){
       let date = this.$route.query
-      console.log(date)
       if (this.$route.query.list){
-        console.log(this.contentButton)
         this.contentButton.push(JSON.parse(this.$route.query.list))
-        console.log(this.contentButton)
         let scope = {
           row:{
             fId:JSON.parse(this.$route.query.data).billId
@@ -792,18 +775,15 @@ export default {
     },
 
     handleSizeChange(val) {
-      // console.log(`每页 ${val} 条`);
       this.formDataList.pageSize = val
       this.query(this.formDataList)
     },
     handleCurrentChange(val) {
-      // console.log(`当前页: ${val}`);
       this.formDataList.pageNum = val
       this.query(this.formDataList)
     },
     //计算金额
     totalAmount(scope) {
-      console.log(scope)
       if (scope.row.fUnitprice && scope.row.fQty) {
         scope.row.fAmount = (scope.row.fUnitprice * scope.row.fQty).toFixed(2)
       }
@@ -811,7 +791,6 @@ export default {
     //查询公司
     fCompany(name) {
       company(name).then(res => {
-        console.log(res)
         if (name == 1) {
           this.dataList.fCorpid = []
           for (let item in res.data) {
@@ -841,7 +820,6 @@ export default {
     //查询列数据
     getRow(data,list) {
       select(data).then((res) => {
-        console.log(res)
         if (data.tableName === '销售出库详情') {
           if (res.data.length != 0) {
             this.purchaseList.columnList = res.data.filter((e) => e.checked == 0)
@@ -867,7 +845,6 @@ export default {
           } else {
             // this.waitFor = true
             this.queryList.columnList = this.listStyle
-            console.log(this.queryList.columnList.fFeeid)
             this.setRowList = this.listStyle
           }
           this.pageDisplay = true
@@ -878,15 +855,30 @@ export default {
         if (list){
           this.$refs.avatar.form = list.warehouseBills
           this.contentList = list.tWarehousebillsfees
+          if(this.$refs.avatar.form.fBillstatus == 4){
+            this.contentButton.push({
+              type: 'danger',
+              size: 'mini',
+              icon: 'el-icon-arrow-left',
+              name: '撤销审批',
+              disabled: false
+            })
+          }else if(this.$refs.avatar.form.fBillstatus > 3){
+            this.contentButton.push({
+              type: 'primary',
+                size: 'mini',
+              icon: 'el-icon-edit-outline',
+              name: '查看审批',
+              disabled: false
+            })
+          }
         }
       })
     },
     returnToForm(row) {
-      console.log(row, 111)
     },
     //查看
     viewMethod(scope) {
-      console.log(scope)
       this.contentOption.forEach(item => item.disabled = true)
       this.contentStyle.forEach(item => item.disabled = true)
       viewSingle(scope.row.fId).then(res => {
@@ -936,13 +928,10 @@ export default {
     },
     //修改
     modification(scope) {
-      console.log(scope)
     },
     //删除
     deletion(scope) {
-      console.log(scope.row.fId)
       tableDeleteQuery(scope.row.fId).then(res => {
-        console.log(res)
         this.$confirm(res.msg == 1 ? '主表数据为空' : (res.msg == 2 ? '主表有数据' : '未知状态') + '是否永久删除该条数据?', '提示', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
@@ -965,7 +954,6 @@ export default {
     },
     //选择框
     selectionbox(selection) {
-      console.log(selection)
     },
     addOrUpdateHand() {
       this.addOrUpdateVisib = true;
@@ -980,32 +968,30 @@ export default {
       for(let li in this.contentList){
         this.$refs.avatar.form.fMoney += Number(this.contentList[li].fAmount)
       }
-      console.log(this.dataList.fGoodsid)
       this.dataList.fGoodsid.forEach(item => {
         if (item.value == this.$refs.avatar.form.fGoodsid) {
           this.$refs.avatar.form.fCorpid = item.fCorpid
         }
       })
-      console.log(this.$refs.avatar.form)
       formData.append('tWarehousebills', JSON.stringify(this.$refs.avatar.form))
       formData.append('tWarehousebillsfees', JSON.stringify(this.contentList))
       formData.append('fBilltype', 'XS')
       submit(formData).then(res => {
         if (res.code == 200) {
           this.$message.success('保存成功')
-          console.log(res.data.warehouseBills)
           this.$refs.avatar.form = res.data.warehouseBills
           this.contentList = res.data.tWarehousebillsCntrs
-          console.log(this.dataList, this.contentList)
           if (item == 1){
             this.dialogVisible = true
+          }else if(item == 2){
+            this.$refs.avatar.form = {}
+            this.pageDisplay = true
           }
         }
       })
     },
     //表单选中后触发
     selectTrigger(name, list, id) {
-      console.log(list, id)
       if (name == 'fGoodsid') {
         for (let item in list) {
           if (list[item].value == id) {
@@ -1021,7 +1007,6 @@ export default {
     },
     //所以按钮
     buttonList(row) {
-      console.log(row)
       let data
       switch (row.name) {
         case '新增':
@@ -1045,14 +1030,14 @@ export default {
         case '保存':
           this.$refs.avatar.submitForm('submit')
           break
-        case '打印':
-          if (!this.$refs.avatar.form.fId){
-            this.$message.error('未保存,不允许打印');
-          }else {
-            this.formList = this.$refs.avatar.form
-            this.submitAndSave(1)
-          }
-          break
+        // case '打印':
+        //   if (!this.$refs.avatar.form.fId){
+        //     this.$message.error('未保存,不允许打印');
+        //   }else {
+        //     this.formList = this.$refs.avatar.form
+        //     this.submitAndSave(1)
+        //   }
+        //   break
         case '修改':
           this.contentButton.forEach(item =>{
             if (this.$refs.avatar.form.fBillstatus >= 4){
@@ -1107,7 +1092,7 @@ export default {
               cancelButtonText: '取消',
               type: 'warning'
             }).then(() => {
-              this.submitAndSave()
+              this.submitAndSave(2)
             }).catch(() => {
               data = {
                 tableName: this.queryList.tableName,
@@ -1131,10 +1116,25 @@ export default {
         case '审批':
           this.addOrUpdateHand()
           break
+        case '撤销审批':
         default:
           this.$message.error('该按钮暂无功能')
       }
     },
+    //撤销审批
+    revocationOfApproval(){
+      let data = {
+        id: this.$refs.avatar.form.fId,
+        actId: 550,
+        billId: this.$refs.avatar.form.fId,
+      };
+      revoke(data).then(res=>{
+        if(res.code == 200){
+          this.$message.success("撤销成功");
+
+        }
+      })
+    },
     // 显示搜索条件、点击后会调用此方法
     showSearch() {
       console.log('到我了')
@@ -1142,7 +1142,6 @@ export default {
     },
     //搜索、重置、展开
     feedback(res) {
-      console.log(res)
       if (res == '展开') {
         if (this.inDex == 4) {
           this.inDex = this.formOption.length
@@ -1153,6 +1152,7 @@ export default {
         this.$refs.avatar.submitForm()
       } else if (res == '重置') {
         this.$refs.avatar.form = {}
+        this.$refs.avatar.submitForm()
       }
     },
     //表单验证通过执行搜索
@@ -1172,7 +1172,6 @@ export default {
     },
     //详情表内容移出
     deletRows(index, rows) {
-      console.log(index, rows)
       if (rows[index].fId) {
         deleteQuery(this.$refs.avatar.form.fId, this.$refs.avatar.form.fDateChanged).then(res => {
           if (res.code === 200) {

+ 1 - 1
src/views/warehouse/inStock/index.vue

@@ -627,7 +627,7 @@ export default {
           index:'6',
           span:6,
           label: 'fSbu',
-          name:"付款单位",
+          name:"出票单位",
           form:1,
           width:200,
           labelSize:'80',