|
@@ -169,6 +169,14 @@
|
|
|
@click="handleDelete(scope.row,scope.index)"
|
|
|
>删除</el-button>
|
|
|
</span>
|
|
|
+ <span v-hasPermi="['ticketMr:ticketMr:copy']" style="display: inline-block;">
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ style="margin-left: 10px;"
|
|
|
+ @click="handleCopy(scope.row,scope.index)"
|
|
|
+ >复制</el-button>
|
|
|
+ </span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -190,12 +198,47 @@
|
|
|
<!-- 详情 -->
|
|
|
<details-dia ref="detailsDia"></details-dia>
|
|
|
</div>
|
|
|
+ <!-- 选择渠道 -->
|
|
|
+ <el-dialog
|
|
|
+ title="复制"
|
|
|
+ :visible.sync="dialogVisible"
|
|
|
+ width="30%"
|
|
|
+ :before-close="()=>dialogVisible = false">
|
|
|
+ <el-form
|
|
|
+ :loading="loading"
|
|
|
+ :model="formCopy"
|
|
|
+ :rules="formCopyRules"
|
|
|
+ ref="formCopy"
|
|
|
+ size="small"
|
|
|
+ :inline="true"
|
|
|
+ label-width="68px">
|
|
|
+ <el-form-item label="销售渠道" label-width="100" prop="channelType">
|
|
|
+ <el-select
|
|
|
+ v-model="formCopy.channelType"
|
|
|
+ placeholder="请选择销售渠道"
|
|
|
+ clearable
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ v-for="(item, index) in channelTypeList"
|
|
|
+ :key="index"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button :loading="loading" @click="dialogVisible = false">取 消</el-button>
|
|
|
+ <el-button :loading="loading" type="primary" @click="submitCopy()">提交</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
|
|
|
-import { pageList, deleteById, updateStatus,seatTypeList } from '@/api/ticketMr/ticketMr'
|
|
|
+import { pageList, deleteById, getSelectById, updateStatus,seatTypeList, saveAndEdit,} from '@/api/ticketMr/ticketMr'
|
|
|
import addAndEdit from "./dialog/addAndEdit";
|
|
|
import detailsDia from "./dialog/details.vue";
|
|
|
|
|
@@ -245,6 +288,12 @@ export default {
|
|
|
channelTypeList: [],
|
|
|
selectedChannel: '', // 当前选中的销售渠道
|
|
|
seatTypeListArr: [],
|
|
|
+
|
|
|
+ formCopy: {},
|
|
|
+ formCopyRules: {
|
|
|
+ channelType: [{ required: true, message: "请选择渠道", trigger: ["change","blur"] }]
|
|
|
+ },
|
|
|
+ dialogVisible: false,
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -312,11 +361,57 @@ export default {
|
|
|
handleUpdate(row) {
|
|
|
this.$refs["addAndEdit"].openDialog("修改数据", row);
|
|
|
},
|
|
|
+ /** 复制 */
|
|
|
+ async handleCopy(row) {
|
|
|
+ try {
|
|
|
+ let res = await getSelectById(row.id)
|
|
|
+ this.formCopy = {
|
|
|
+ ...res.data,
|
|
|
+ id: null,
|
|
|
+ channelType: null
|
|
|
+ }
|
|
|
+ this.dialogVisible = true
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs["formCopy"].clearValidate();
|
|
|
+ });
|
|
|
+ } catch (error) {
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
/** 详情按钮操作 */
|
|
|
openDetails(row) {
|
|
|
this.$refs["detailsDia"].openDialog("详情", row);
|
|
|
},
|
|
|
-
|
|
|
+ /** */
|
|
|
+ submitCopy(){
|
|
|
+ this.$refs["formCopy"].validate(async (valid,object) => {
|
|
|
+ if (valid) {
|
|
|
+ try {
|
|
|
+ this.loading = true;
|
|
|
+ const { code } = await saveAndEdit({ ...this.formCopy });
|
|
|
+ if (code === 200) {
|
|
|
+ this.$message.success("操作成功!");
|
|
|
+ this.dialogVisible = false
|
|
|
+ this.getList()
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ } finally {
|
|
|
+ this.loading = false;
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ // console.log('error submit!!',valid,object);
|
|
|
+ if(object&&JSON.stringify(object) != '{}'){
|
|
|
+ let str = ''
|
|
|
+ for(let key in object){
|
|
|
+ if(object.hasOwnProperty(key)){
|
|
|
+ str = str + `[${object[key][0].message}]}]`
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.$message.error(str);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
/** 发布或者取消发布按钮操作 */
|
|
|
ionlineApi(row) {
|
|
|
try {
|