yangfeng
2023-11-10 bad9393dc3c437248697963f44eaa3ef39800a77
src/views/sales/salesDetails/index.vue
@@ -40,12 +40,12 @@
            <template slot="tableButton">
              <el-table-column label="操作" width="180">
                <template slot-scope="scope">
                  <el-button @click="handleClick(scope.row, '查看')" type="text" size="small">查看</el-button>
                  <el-button @click.stop="handleClick(scope.row, '查看')" type="text" size="small">查看</el-button>
                  <template v-if="scope.row.status === 1">
                    <el-button @click="handleClick(scope.row, '编辑')" type="text" size="small">编辑</el-button>
                    <el-button @click="submitClick(scope.row)" type="text" size="small">确认提交</el-button>
                    <el-button @click.stop="handleClick(scope.row, '编辑')" type="text" size="small">编辑</el-button>
                    <el-button @click.stop="submitClick(scope.row)" type="text" size="small">确认提交</el-button>
                    <!-- <el-button @click="delClick(scope.row.id)" type="text" size="small">删除</el-button> -->
                    <el-button @click="closeClick(scope.row.id)" type="text" size="small">关闭</el-button>
                    <el-button @click.stop="closeClick(scope.row)" type="text" size="small">关闭</el-button>
                  </template>
                </template>
              </el-table-column>
@@ -123,7 +123,9 @@
  getSalesDetailsList,
  getDelSalesDetails,
  getProductInventoryInfo,
  getProductOrderInfo
  getProductOrderInfo,
  updateStatus,
  createOperation
} from "@/api/sales/salesDetails"
import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
import DetailSpecification from "@/views/sales/salesDetails/DetailSpecification"
@@ -365,8 +367,7 @@
                  ...item,
                  client_name: item.client.name,
                  member_name: item.Member.username,
                  source: "CRM同步",
                  status: 2
                  source: "CRM同步"
                }
              })
              this.tableList.tableInfomation = list || []
@@ -439,12 +440,36 @@
      }
    },
    // 确认提交
    submitClick(row) {
    async submitClick(row) {
      console.log(row, "确认提交")
      let params = {
        ...row,
        status: 2
      }
      await createOperation(params).then((res) => {
        if (res.code == 200) {
          this.$message.success("确认提交成功")
          this.getData()
        }
      })
    },
    // 关闭
    closeClick(row) {
      console.log(row, "关闭")
      this.updateStatus(row.id, 4)
    },
    // 修改状态
    async updateStatus(id, status) {
      await updateStatus({
        id: id,
        status: status
      }).then((res) => {
        console.log(res)
        if (res.code == 200) {
          this.$message.success("关闭成功")
          this.getData()
        }
      })
    },
    // 删除
    delClick(rowID) {