pengyh 1 rok pred
rodič
commit
9dc38286fd

+ 38 - 6
src/views/auxiliaryFittings/salesManagement/oldPartsReturnFactory/index.vue

@@ -21,7 +21,7 @@
           </div>
         </template-page>
       </div>
-      <div v-if="~['add', 'edit', 'detail'].indexOf(activeKey)" style="box-sizing: border-box;padding: 16px;">
+      <div v-if="~['add', 'edit', 'detail', 'confirm'].indexOf(activeKey)" style="box-sizing: border-box;padding: 16px;">
         <div>
           <zj-form-container ref="formRef" :form-data="formData">
             <zj-form-module title="单据信息" :form-data="formData" :form-items="formItems">
@@ -31,11 +31,11 @@
           </zj-form-container>
           <div slot="footer" class="dialog-footer">
             <el-button size="mini" @click="data.removeTab">取 消</el-button>
-            <el-button v-if="openType == 0 && !~['OK', 'FAIL'].indexOf(formData.flag)" size="mini" type="primary"
-              @click="quedingbaocun(data.removeTab)">保存</el-button>
-            <el-button v-if="openType == 1 && formData.flag == 'SUBMIT'" size="mini" type="primary"
+            <el-button v-if="openType == 0 || formData.flag == 'SAVE'" size="mini" type="primary"
+              @click="quedingbaocun(data.removeTab)">{{formData.flag == 'SAVE'?'提交':'保存'}}</el-button>
+            <el-button v-if="openType == 3 && formData.flag == 'SUBMIT'" size="mini" type="primary"
               @click="shenbi(data.removeTab, 'OK')">审核通过</el-button>
-            <el-button v-if="openType == 1 && formData.flag == 'SUBMIT'" size="mini" type="primary"
+            <el-button v-if="openType == 3 && formData.flag == 'SUBMIT'" size="mini" type="primary"
               @click="shenbi(data.removeTab, 'FAIL')">审核失败</el-button>
           </div>
         </div>
@@ -284,7 +284,7 @@ export default {
         },
         edit: {
           conditions: ({ row, index, column }) => {
-            return !~['OK', 'FAIL'].indexOf(row.flag)
+            return row.flag == 'SAVE'
           },
           click: ({ row, index, column }) => {
             this.$refs.tabPage.addTab({
@@ -298,6 +298,7 @@ export default {
               triggerEvent: () => {
                 this.handleClose()
                 this.$nextTick(() => {
+					this.openType = 2;
                   websitPartsFactoryRetDetail({ id: row.partsRetId }).then(res => {
                     Object.assign(this.formData, res.data, {
                       fileUrl: res.data.fileUrl ? res.data.fileUrl.split(",").map(url => ({ url })) : [],
@@ -312,6 +313,37 @@ export default {
             })
           }
         },
+		confirm: {
+			conditions: ({ row, index, column }) => {
+			  return row.flag == 'SUBMIT'
+			},
+		  click: ({ row, index, column }) => {
+		    this.$refs.tabPage.addTab({
+		      // 对应显示的模块
+		      activeKey: "confirm",
+		      // 唯一标识
+		      key: "confirm",
+		      // 页签名称
+		      label: "确认",
+		      // 打开时事件
+		      triggerEvent: () => {
+		        this.handleClose()
+		        this.$nextTick(() => {
+		          this.openType = 3;
+		          websitPartsFactoryRetDetail({ id: row.partsRetId }).then(res => {
+		            Object.assign(this.formData, res.data, {
+		              fileUrl: res.data.fileUrl ? res.data.fileUrl.split(",").map(url => ({ url })) : [],
+		              websitPartsRetItems: res.data.websitPartsRetItemList
+		            })
+		            this.openForm()
+		          })
+		        })
+		      },
+		      // 关闭时事件
+		      closeEvent: () => { }
+		    })
+		  }
+		},
         // printTp: {
         //   click: ({ row, index, column }) => {