|  | @@ -19,6 +19,15 @@
 | 
	
		
			
				|  |  |            v-if="disabled"
 | 
	
		
			
				|  |  |          >编 辑</el-button>
 | 
	
		
			
				|  |  |          <el-button
 | 
	
		
			
				|  |  | +          v-if="form.id && loginUser === form.handingUser && form.confirmStatus !== 1"
 | 
	
		
			
				|  |  | +          type="primary"
 | 
	
		
			
				|  |  | +          size="small"
 | 
	
		
			
				|  |  | +          class="el-button--small-yh"
 | 
	
		
			
				|  |  | +          :loading="btnLoading"
 | 
	
		
			
				|  |  | +          @click="submitConfirm"
 | 
	
		
			
				|  |  | +          :disabled="!form.id || disabled"
 | 
	
		
			
				|  |  | +        >提交确认</el-button>
 | 
	
		
			
				|  |  | +        <el-button
 | 
	
		
			
				|  |  |            v-if="checker && form.status != 3"
 | 
	
		
			
				|  |  |            type="primary"
 | 
	
		
			
				|  |  |            size="small"
 | 
	
	
		
			
				|  | @@ -35,7 +44,7 @@
 | 
	
		
			
				|  |  |          <el-button
 | 
	
		
			
				|  |  |            type="primary"
 | 
	
		
			
				|  |  |            v-if="!checkDisabled"
 | 
	
		
			
				|  |  | -          :disabled="!form.id || disabled"
 | 
	
		
			
				|  |  | +          :disabled="!form.id || disabled || form.confirmStatus !== 1"
 | 
	
		
			
				|  |  |            size="small"
 | 
	
		
			
				|  |  |            @click="pleaseCheck"
 | 
	
		
			
				|  |  |            :loading="btnLoading"
 | 
	
	
		
			
				|  | @@ -70,9 +79,48 @@
 | 
	
		
			
				|  |  |                v-model="form.corpId"
 | 
	
		
			
				|  |  |                @getCorpData="getKHData"
 | 
	
		
			
				|  |  |                corpType="KH"
 | 
	
		
			
				|  |  | -              :disabled="disabled || checkDisabled"
 | 
	
		
			
				|  |  | +              :disabled="disabled || checkDisabled || confirmDisabled"
 | 
	
		
			
				|  |  |              />
 | 
	
		
			
				|  |  |            </template>
 | 
	
		
			
				|  |  | +          <template slot="chargeStatus">
 | 
	
		
			
				|  |  | +            <el-switch
 | 
	
		
			
				|  |  | +              v-model="form.chargeStatus"
 | 
	
		
			
				|  |  | +              active-text="是"
 | 
	
		
			
				|  |  | +              inactive-text="否"
 | 
	
		
			
				|  |  | +              :active-value="1"
 | 
	
		
			
				|  |  | +              :inactive-value="0"
 | 
	
		
			
				|  |  | +              :disabled="disabled || checkDisabled || confirmDisabled"
 | 
	
		
			
				|  |  | +              @change="chargeStatusChange"
 | 
	
		
			
				|  |  | +            ></el-switch>
 | 
	
		
			
				|  |  | +          </template>
 | 
	
		
			
				|  |  | +          <template slot="handingUser">
 | 
	
		
			
				|  |  | +            <el-select
 | 
	
		
			
				|  |  | +              v-model="form.handingUser"
 | 
	
		
			
				|  |  | +              filterable
 | 
	
		
			
				|  |  | +              clearable
 | 
	
		
			
				|  |  | +              size="small"
 | 
	
		
			
				|  |  | +              placeholder="请选择"
 | 
	
		
			
				|  |  | +              :disabled="disabled || checkDisabled || form.chargeStatus == 0 || confirmDisabled"
 | 
	
		
			
				|  |  | +              @change="handingUserChange"
 | 
	
		
			
				|  |  | +            >
 | 
	
		
			
				|  |  | +              <el-option
 | 
	
		
			
				|  |  | +                v-for="(item,index) in userList"
 | 
	
		
			
				|  |  | +                :key="index"
 | 
	
		
			
				|  |  | +                :label="item.realName"
 | 
	
		
			
				|  |  | +                :value="item.id"
 | 
	
		
			
				|  |  | +              ></el-option>
 | 
	
		
			
				|  |  | +            </el-select>
 | 
	
		
			
				|  |  | +          </template>
 | 
	
		
			
				|  |  | +          <template slot="external">
 | 
	
		
			
				|  |  | +            <el-switch
 | 
	
		
			
				|  |  | +              v-model="form.external"
 | 
	
		
			
				|  |  | +              active-text="是"
 | 
	
		
			
				|  |  | +              inactive-text="否"
 | 
	
		
			
				|  |  | +              :active-value="1"
 | 
	
		
			
				|  |  | +              :inactive-value="0"
 | 
	
		
			
				|  |  | +              :disabled="disabled || checkDisabled || confirmDisabled"
 | 
	
		
			
				|  |  | +            ></el-switch>
 | 
	
		
			
				|  |  | +          </template>
 | 
	
		
			
				|  |  |          </avue-form>
 | 
	
		
			
				|  |  |        </basic-container>
 | 
	
		
			
				|  |  |        <containerTitle title="详情内容"/>
 | 
	
	
		
			
				|  | @@ -91,7 +139,7 @@
 | 
	
		
			
				|  |  |                icon="el-icon-plus"
 | 
	
		
			
				|  |  |                size="small"
 | 
	
		
			
				|  |  |                @click.stop="newDetails"
 | 
	
		
			
				|  |  | -              :disabled="disabled || checkDisabled"
 | 
	
		
			
				|  |  | +              :disabled="disabled || checkDisabled || confirmDisabled"
 | 
	
		
			
				|  |  |              >录入明细</el-button>
 | 
	
		
			
				|  |  |              <el-button
 | 
	
		
			
				|  |  |                type="info"
 | 
	
	
		
			
				|  | @@ -106,13 +154,13 @@
 | 
	
		
			
				|  |  |                icon="el-icon-edit"
 | 
	
		
			
				|  |  |                type="text"
 | 
	
		
			
				|  |  |                @click="rowCell(row, index)"
 | 
	
		
			
				|  |  | -              :disabled="disabled || checkDisabled"
 | 
	
		
			
				|  |  | +              :disabled="disabled || checkDisabled || confirmDisabled"
 | 
	
		
			
				|  |  |              >{{ row.$cellEdit ? "保存" : "修改" }}</el-button>
 | 
	
		
			
				|  |  |              <el-button
 | 
	
		
			
				|  |  |                size="small"
 | 
	
		
			
				|  |  |                icon="el-icon-upload"
 | 
	
		
			
				|  |  |                type="text"
 | 
	
		
			
				|  |  | -              :disabled="disabled || checkDisabled"
 | 
	
		
			
				|  |  | +              :disabled="disabled || checkDisabled || confirmDisabled"
 | 
	
		
			
				|  |  |                @click="annexOpen(row, index)"
 | 
	
		
			
				|  |  |              >附件</el-button>
 | 
	
		
			
				|  |  |              <el-button
 | 
	
	
		
			
				|  | @@ -120,7 +168,7 @@
 | 
	
		
			
				|  |  |                icon="el-icon-delete"
 | 
	
		
			
				|  |  |                type="text"
 | 
	
		
			
				|  |  |                @click="rowDel(row, index)"
 | 
	
		
			
				|  |  | -              :disabled="disabled || checkDisabled"
 | 
	
		
			
				|  |  | +              :disabled="disabled || checkDisabled || confirmDisabled"
 | 
	
		
			
				|  |  |              >删除</el-button>
 | 
	
		
			
				|  |  |            </template>
 | 
	
		
			
				|  |  |            <template slot="quantity" slot-scope="{ row, index }">
 | 
	
	
		
			
				|  | @@ -261,7 +309,8 @@ import {
 | 
	
		
			
				|  |  |    removeGoods,
 | 
	
		
			
				|  |  |    pleaseCheck,
 | 
	
		
			
				|  |  |    saveAttached,
 | 
	
		
			
				|  |  | -  getAttachment} from "@/api/standAlone/handoverSheet";
 | 
	
		
			
				|  |  | +  getAttachment,
 | 
	
		
			
				|  |  | +  submitConfirm} from "@/api/standAlone/handoverSheet";
 | 
	
		
			
				|  |  |  import reportDialog from "@/components/report-dialog/main";
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  export default {
 | 
	
	
		
			
				|  | @@ -277,6 +326,13 @@ export default {
 | 
	
		
			
				|  |  |      reportDialog
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    data() {
 | 
	
		
			
				|  |  | +    const validateHandingUser = (rule, value, callback) => {
 | 
	
		
			
				|  |  | +      if (this.form.chargeStatus == 1 && !this.form.handingUser) {
 | 
	
		
			
				|  |  | +        callback(new Error('接手人不能为空'))
 | 
	
		
			
				|  |  | +      } else {
 | 
	
		
			
				|  |  | +        callback()
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  |      return {
 | 
	
		
			
				|  |  |        disabled: false,
 | 
	
		
			
				|  |  |        pageLoading: false,
 | 
	
	
		
			
				|  | @@ -331,6 +387,24 @@ export default {
 | 
	
		
			
				|  |  |              span: 8,
 | 
	
		
			
				|  |  |            },
 | 
	
		
			
				|  |  |            {
 | 
	
		
			
				|  |  | +            label: "是否收费",
 | 
	
		
			
				|  |  | +            prop: "chargeStatus",
 | 
	
		
			
				|  |  | +            span: 8,
 | 
	
		
			
				|  |  | +          },
 | 
	
		
			
				|  |  | +          {
 | 
	
		
			
				|  |  | +            label: "接手人",
 | 
	
		
			
				|  |  | +            prop: "handingUser",
 | 
	
		
			
				|  |  | +            span: 8,
 | 
	
		
			
				|  |  | +            rules: [
 | 
	
		
			
				|  |  | +              {validator: validateHandingUser, trigger: 'change'}
 | 
	
		
			
				|  |  | +            ]
 | 
	
		
			
				|  |  | +          },
 | 
	
		
			
				|  |  | +          {
 | 
	
		
			
				|  |  | +            label: "是否外部交接单",
 | 
	
		
			
				|  |  | +            prop: "external",
 | 
	
		
			
				|  |  | +            span: 8,
 | 
	
		
			
				|  |  | +          },
 | 
	
		
			
				|  |  | +          {
 | 
	
		
			
				|  |  |              label: "交接备注",
 | 
	
		
			
				|  |  |              prop: "remarks",
 | 
	
		
			
				|  |  |              type: "textarea",
 | 
	
	
		
			
				|  | @@ -374,6 +448,7 @@ export default {
 | 
	
		
			
				|  |  |        oldForm: {},
 | 
	
		
			
				|  |  |        oldDataList: [],
 | 
	
		
			
				|  |  |        checkDisabled: false, // 审核状态
 | 
	
		
			
				|  |  | +      confirmDisabled: false, // 提交状态
 | 
	
		
			
				|  |  |        checker: false,
 | 
	
		
			
				|  |  |        checkId: '',
 | 
	
		
			
				|  |  |        batchNo:'',
 | 
	
	
		
			
				|  | @@ -396,7 +471,7 @@ export default {
 | 
	
		
			
				|  |  |        this.userList = res.data.data;
 | 
	
		
			
				|  |  |      });
 | 
	
		
			
				|  |  |      getUserInfo().then(res => {
 | 
	
		
			
				|  |  | -      this.loginUser = res.data.data.realName;
 | 
	
		
			
				|  |  | +      this.loginUser = res.data.data.id;
 | 
	
		
			
				|  |  |      })
 | 
	
		
			
				|  |  |      getDeptTree().then(res => {
 | 
	
		
			
				|  |  |        this.dic = res.data.data
 | 
	
	
		
			
				|  | @@ -435,7 +510,8 @@ export default {
 | 
	
		
			
				|  |  |          this.oldForm = {...this.form};
 | 
	
		
			
				|  |  |          this.oldDataList = [...this.dataList];
 | 
	
		
			
				|  |  |          this.checkDisabled = this.form.status > 0? true: false;
 | 
	
		
			
				|  |  | -        if (this.form.status > 0) {
 | 
	
		
			
				|  |  | +        this.confirmDisabled = this.form.confirmStatus === 1? true: false;
 | 
	
		
			
				|  |  | +        if (this.form.status > 0 || this.form.confirmStatus === 1) {
 | 
	
		
			
				|  |  |            this.option.column.map(e => {
 | 
	
		
			
				|  |  |              this.$set(e, 'disabled', true)
 | 
	
		
			
				|  |  |            })
 | 
	
	
		
			
				|  | @@ -452,7 +528,7 @@ export default {
 | 
	
		
			
				|  |  |      openEdit() {
 | 
	
		
			
				|  |  |        this.disabled = false;
 | 
	
		
			
				|  |  |        this.option.column.map(e => {
 | 
	
		
			
				|  |  | -        if (this.checkDisabled) {
 | 
	
		
			
				|  |  | +        if (this.checkDisabled || this.confirmDisabled) {
 | 
	
		
			
				|  |  |            this.$set(e, 'disabled', true)
 | 
	
		
			
				|  |  |          } else {
 | 
	
		
			
				|  |  |            if (e.prop != 'serialNo') {
 | 
	
	
		
			
				|  | @@ -598,6 +674,7 @@ export default {
 | 
	
		
			
				|  |  |        if (this.verification()) {
 | 
	
		
			
				|  |  |          const data = {
 | 
	
		
			
				|  |  |            id : this.form.id,
 | 
	
		
			
				|  |  | +          serialNo: this.form.serialNo,
 | 
	
		
			
				|  |  |            checkType: 'jjd',
 | 
	
		
			
				|  |  |            url: '/workManagement/handoverSheet/index',
 | 
	
		
			
				|  |  |            pageStatus:"this.$store.getters.handOverStatus",
 | 
	
	
		
			
				|  | @@ -657,6 +734,30 @@ export default {
 | 
	
		
			
				|  |  |          })
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | +    // 是否收费选择触发
 | 
	
		
			
				|  |  | +    chargeStatusChange(data) {
 | 
	
		
			
				|  |  | +      if (data === 0) this.form.handingUser = null;
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    // 接手人选择触发
 | 
	
		
			
				|  |  | +    handingUserChange(data) {
 | 
	
		
			
				|  |  | +      this.$set(this.form, 'handingUserName', this.userList.find(item => data == item.id).realName);
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    // 提交确认
 | 
	
		
			
				|  |  | +    submitConfirm() {
 | 
	
		
			
				|  |  | +      this.$confirm("提交确认?", "提示", {
 | 
	
		
			
				|  |  | +        confirmButtonText: "确定",
 | 
	
		
			
				|  |  | +        cancelButtonText: "取消",
 | 
	
		
			
				|  |  | +        type: "warning"
 | 
	
		
			
				|  |  | +      }).then(() => {
 | 
	
		
			
				|  |  | +        this.btnLoading = true
 | 
	
		
			
				|  |  | +        submitConfirm({id: this.form.id}).then(res => {
 | 
	
		
			
				|  |  | +          console.log(res.data.data)
 | 
	
		
			
				|  |  | +          this.queryData(this.form.id)
 | 
	
		
			
				|  |  | +        }).finally(() => {
 | 
	
		
			
				|  |  | +          this.btnLoading = false;
 | 
	
		
			
				|  |  | +        })
 | 
	
		
			
				|  |  | +      })
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  </script>
 |