|
@@ -146,28 +146,62 @@
|
|
<a-select-option :value="2">头条</a-select-option>
|
|
<a-select-option :value="2">头条</a-select-option>
|
|
</a-select>
|
|
</a-select>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
- <a-form-model-item label="选择项目名称" prop="name7">
|
|
|
|
|
|
+ <a-form-model-item label="选择项目名称" prop="name8">
|
|
<a-select v-model="policyOperationForm.name8" placeholder="请选择项目名称">
|
|
<a-select v-model="policyOperationForm.name8" placeholder="请选择项目名称">
|
|
<a-select-option :value="1">快手</a-select-option>
|
|
<a-select-option :value="1">快手</a-select-option>
|
|
<a-select-option :value="2">头条</a-select-option>
|
|
<a-select-option :value="2">头条</a-select-option>
|
|
</a-select>
|
|
</a-select>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
|
|
+ <a-form-model-item label="选择媒体">
|
|
|
|
+ <a-radio-group v-model="policyOperationForm.name9" button-style="solid">
|
|
|
|
+ <a-radio-button value="a">头条</a-radio-button>
|
|
|
|
+ <a-radio-button value="b">快手</a-radio-button>
|
|
|
|
+ </a-radio-group>
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ <a-form-model-item label="运营方式">
|
|
|
|
+ <a-radio-group v-model="policyOperationForm.name10" button-style="solid">
|
|
|
|
+ <a-radio-button value="a">自运营</a-radio-button>
|
|
|
|
+ <a-radio-button value="b">代运营</a-radio-button>
|
|
|
|
+ </a-radio-group>
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ <a-form-model-item label="附件上传">
|
|
|
|
+ <a-upload
|
|
|
|
+ name="file"
|
|
|
|
+ :file-list="fileList"
|
|
|
|
+ :before-upload="beforeUpload"
|
|
|
|
+ @change="handleChange"
|
|
|
|
+ >
|
|
|
|
+ <a-button><a-icon type="upload" />文件上传</a-button>
|
|
|
|
+ </a-upload>
|
|
|
|
+ <a class="file-down-title" @click="handleFileDownTitle">文件格式下载</a>
|
|
|
|
+ <p class="upload-txt-rules">支持扩展名:.xlxs</p>
|
|
|
|
+ </a-form-model-item>
|
|
</a-form-model>
|
|
</a-form-model>
|
|
</div>
|
|
</div>
|
|
</a-modal>
|
|
</a-modal>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
|
|
+import BMF from 'browser-md5-file';
|
|
|
|
+let COS = require('cos-js-sdk-v5');
|
|
|
|
+let cos = new COS({
|
|
|
|
+ SecretId: 'AKIDE6IpMi8fJQRCg1iuWzFajjRs43kbbets',
|
|
|
|
+ SecretKey: 'tXzuwMfplTTK3c9GFUyETilasvQfePu9'
|
|
|
|
+});
|
|
|
|
+
|
|
export default {
|
|
export default {
|
|
name: 'settlement-account',
|
|
name: 'settlement-account',
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ fileList: [],
|
|
labelCol: {span: 7},
|
|
labelCol: {span: 7},
|
|
wrapperCol: {span: 14},
|
|
wrapperCol: {span: 14},
|
|
policyOperationForm: {
|
|
policyOperationForm: {
|
|
name6: undefined,
|
|
name6: undefined,
|
|
name7: undefined,
|
|
name7: undefined,
|
|
name8: undefined,
|
|
name8: undefined,
|
|
|
|
+ name9: 'a',
|
|
|
|
+ name10: 'a',
|
|
},
|
|
},
|
|
policyOperationRules: {
|
|
policyOperationRules: {
|
|
name6: [{required: true, message: '请选择广告主公司名称', trigger: 'change'}],
|
|
name6: [{required: true, message: '请选择广告主公司名称', trigger: 'change'}],
|
|
@@ -276,18 +310,121 @@ export default {
|
|
this.searchForm = this.$form.createForm(this);
|
|
this.searchForm = this.$form.createForm(this);
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 文件格式下载
|
|
|
|
+ handleFileDownTitle() {
|
|
|
|
+ console.log('文件格式下载');
|
|
|
|
+ },
|
|
|
|
+ beforeUpload(file) {
|
|
|
|
+ this.cosUpload(file);
|
|
|
|
+ },
|
|
|
|
+ handleMd5(file) {
|
|
|
|
+ let bmf = new BMF();
|
|
|
|
+ let that = this;
|
|
|
|
+ return new Promise(function (resolve, reject) {
|
|
|
|
+ bmf.md5(file, (err, md5) => {
|
|
|
|
+ getAction('kuaishouPopulationPackage/checkPopulationPackage', {signature: md5}).then(result => {
|
|
|
|
+ if (result.code === 200) {
|
|
|
|
+ that.personNameDisabled = false;
|
|
|
|
+ that.personResourceDisabled = false;
|
|
|
|
+ resolve();
|
|
|
|
+ }
|
|
|
|
+ else if (result.code === 201) {
|
|
|
|
+ that.$message.error(result.message);
|
|
|
|
+ that.personForm.name = result.result.orientationName;
|
|
|
|
+ that.personForm.resource = result.result.type;
|
|
|
|
+ that.personNameDisabled = true;
|
|
|
|
+ that.personResourceDisabled = true;
|
|
|
|
+ reject();
|
|
|
|
+ }
|
|
|
|
+ }).catch(error => {
|
|
|
|
+ console.log(error, 'eeee');
|
|
|
|
+ reject();
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ handleChange(info) {
|
|
|
|
+ this.fileList = info.fileList;
|
|
|
|
+ },
|
|
|
|
+ cosUpload(file) {
|
|
|
|
+ let that = this;
|
|
|
|
+ let date = new Date();
|
|
|
|
+ let y = date.getFullYear();
|
|
|
|
+ let MM = date.getMonth() + 1;
|
|
|
|
+ MM = MM < 10 ? '0' + MM : MM;
|
|
|
|
+ let d = date.getDate();
|
|
|
|
+ d = d < 10 ? '0' + d : d;
|
|
|
|
+ let timeElse = new Date().getTime();
|
|
|
|
+ let arr = file.name.split('.');
|
|
|
|
+ let str = '';
|
|
|
|
+ for (let i = 0; i < arr.length; i++) {
|
|
|
|
+ if (i === arr.length - 1) {
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ if (i === arr.length - 2) {
|
|
|
|
+ str += arr[i];
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ str += arr[i] + '.';
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ cos.putObject(
|
|
|
|
+ {
|
|
|
|
+ Bucket: 'media-1301855440',
|
|
|
|
+ Region: 'ap-chongqing',
|
|
|
|
+ // 存储桶所在地域,必须字段
|
|
|
|
+ Key: that.uploadType + '/' + y + '-' + MM + '-' + d + '/' + str + '-' + timeElse + '.' + arr[arr.length - 1],
|
|
|
|
+ StorageClass: 'STANDARD',
|
|
|
|
+ Body: file // 上传文件对象
|
|
|
|
+ },
|
|
|
|
+ function (err, data) {
|
|
|
|
+ if (err) {
|
|
|
|
+ that.$message.error('上传失败!!!' + err);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ that.loadingElse = false;
|
|
|
|
+ that.fileList.push({
|
|
|
|
+ uid: file.name,
|
|
|
|
+ name: file.name,
|
|
|
|
+ status: 'done',
|
|
|
|
+ url: '//' + data.Location
|
|
|
|
+ });
|
|
|
|
+ if (that.fileList.length > 1) {
|
|
|
|
+ that.fileList = that.fileList.slice(-1);
|
|
|
|
+ }
|
|
|
|
+ const isZip = file.type.includes('xlxs');
|
|
|
|
+ const fileOvesize = file.size > (1024 * 1024 * 1024);
|
|
|
|
+ if (!isZip) {
|
|
|
|
+ that.$message.error('只能上传xlxs格式的文件');
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (fileOvesize) {
|
|
|
|
+ that.$message.error('文件大小不能超过1G');
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ // that.handleMd5(file);
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+ },
|
|
// 上传确定按钮操作
|
|
// 上传确定按钮操作
|
|
handlePolicyOperationSure() {
|
|
handlePolicyOperationSure() {
|
|
console.log('上传确定按钮操作');
|
|
console.log('上传确定按钮操作');
|
|
},
|
|
},
|
|
// 上传取消按钮操作
|
|
// 上传取消按钮操作
|
|
- handlePolicyOperationSure() {
|
|
|
|
|
|
+ handlePolicyOperationCancel() {
|
|
console.log('上传取消按钮操作');
|
|
console.log('上传取消按钮操作');
|
|
this.policyOperationStatus = false;
|
|
this.policyOperationStatus = false;
|
|
},
|
|
},
|
|
// 删除操作
|
|
// 删除操作
|
|
handleSettleDel(list) {
|
|
handleSettleDel(list) {
|
|
console.log(list, '删除操作');
|
|
console.log(list, '删除操作');
|
|
|
|
+ let that = this;
|
|
|
|
+ this.$confirm({
|
|
|
|
+ title: '提示',
|
|
|
|
+ content: '确认删除该条数据',
|
|
|
|
+ onOk() {}
|
|
|
|
+ });
|
|
},
|
|
},
|
|
// 分页操作按钮
|
|
// 分页操作按钮
|
|
onShowSizeChange(current, pageSize) {
|
|
onShowSizeChange(current, pageSize) {
|