Commit 84aa90da authored by 张子雨's avatar 张子雨

Merge branch 'feat/sentry0616' into feature/meal-3.0

* feat/sentry0616:
  feat: 解决senty问题
  feat: 修改sentry
  feat: 解决sentry问题
  feat: 解决sentry问题
  feat: 修复sentry问题
parents 77ccf63b f932ffea
import RoleType, { isPlatForm } from './role.config'; import RoleType, { isPlatForm } from './role.config';
const isProduction = process.env.NODE_ENV === 'production'; const isProduction = process.env.NODE_ENV === 'production';
const isPre = process.env.PRE_ENV === 'pre'; const isPre = process.env.PRE_ENV === 'pre';
const environment = 'yxm2'; const environment = 'sc';
const envAPi = { const envAPi = {
api: `https://security-${environment}.liangkebang.net`, //'https://security-xyqb.liangkebang.net', api: `https://security-${environment}.liangkebang.net`, //'https://security-xyqb.liangkebang.net',
......
...@@ -17,12 +17,12 @@ const Model = { ...@@ -17,12 +17,12 @@ const Model = {
const productCategoryId = payload?.productCategoryId || []; const productCategoryId = payload?.productCategoryId || [];
params.productCategoryId = params.productCategoryId =
(productCategoryId.length && productCategoryId[productCategoryId.length - 1]) || ''; (productCategoryId.length && productCategoryId[productCategoryId.length - 1]) || '';
const { data } = yield call(api.searchList, params); const res = yield call(api.searchList, params);
if (!data) return; if (res && !res.data) return;
yield put({ yield put({
type: 'saveData', type: 'saveData',
payload: { payload: {
tableData: data, tableData: res.data,
}, },
}); });
}, },
......
...@@ -30,9 +30,13 @@ class toExamine extends Component { ...@@ -30,9 +30,13 @@ class toExamine extends Component {
if (err) { if (err) {
return; return;
} }
if (!values?.fileList[0]?.url) {
notification.error({ message: '请上传发票错误,请重新上传' });
return;
}
const params = { const params = {
filePath: values?.fileList[0].url, filePath: values?.fileList[0].url,
fileName: values?.fileList[0].name, fileName: values?.fileList[0]?.name || '',
id, id,
}; };
const data = await uploadBill(params); const data = await uploadBill(params);
......
...@@ -62,6 +62,10 @@ class PicturesWall extends React.Component { ...@@ -62,6 +62,10 @@ class PicturesWall extends React.Component {
const vm = this; const vm = this;
// eslint-disable-next-line new-cap // eslint-disable-next-line new-cap
const data = `${UUID.createUUID()}.${suffix}`; const data = `${UUID.createUUID()}.${suffix}`;
if (!token) {
message.error('上传失败,请刷新页面重试!');
return;
}
const observable = qiniu.upload(file, data, token); const observable = qiniu.upload(file, data, token);
const observer = { const observer = {
next() { next() {
...@@ -121,7 +125,9 @@ class PicturesWall extends React.Component { ...@@ -121,7 +125,9 @@ class PicturesWall extends React.Component {
customRequest={this.customRequest} customRequest={this.customRequest}
listType="text" listType="text"
fileList={fileList} fileList={fileList}
disabled={status !== 1}
onRemove={status === 1 ? this.clearFileList : ''} onRemove={status === 1 ? this.clearFileList : ''}
accept=".pdf,.doc,.docx,.zip,.rar,.png,.jpeg"
> >
{max && fileList.length >= max ? null : uploadButton} {max && fileList.length >= max ? null : uploadButton}
</Upload> </Upload>
......
...@@ -147,7 +147,7 @@ const FormAttr = forwardRef((props, ref) => { ...@@ -147,7 +147,7 @@ const FormAttr = forwardRef((props, ref) => {
if (typeof values[item] === 'string') { if (typeof values[item] === 'string') {
obj.productAttributeApplyValueList = JSON.parse(values[item]); obj.productAttributeApplyValueList = JSON.parse(values[item]);
} else { } else {
obj.productAttributeApplyValueList = values[item].map(v => JSON.parse(v)); obj.productAttributeApplyValueList = values[item]?.map(v => JSON.parse(v)) || [];
} }
return obj; return obj;
}); });
......
...@@ -10,7 +10,7 @@ const FormItem = Form.Item; ...@@ -10,7 +10,7 @@ const FormItem = Form.Item;
const { Option } = Select; const { Option } = Select;
const LogisticsForm = props => { const LogisticsForm = props => {
const { modalVisible, onCancel, companys = [], skuList, onSubmit } = props; const { modalVisible, onCancel, company = [], skuList, onSubmit } = props;
const { getFieldDecorator } = props.form; const { getFieldDecorator } = props.form;
const [result, setResult] = useState(() => props.value); const [result, setResult] = useState(() => props.value);
const formData = async (formDataList, fieldsValue, suffixes) => { const formData = async (formDataList, fieldsValue, suffixes) => {
...@@ -127,14 +127,14 @@ const LogisticsForm = props => { ...@@ -127,14 +127,14 @@ const LogisticsForm = props => {
], ],
})( })(
<Select showSearch placeholder="请选择物流公司"> <Select showSearch placeholder="请选择物流公司">
{companys.map(item => ( {company?.map(item => (
<Option <Option
value={`${item.expressCompanyCode}-${item.expressCompanyName}`} value={`${item.expressCompanyCode}-${item.expressCompanyName}`}
key={item.expressCompanyCode} key={item.expressCompanyCode}
> >
{item.expressCompanyName} {item.expressCompanyName}
</Option> </Option>
))} )) || []}
</Select>, </Select>,
)} )}
</FormItem> </FormItem>
......
...@@ -248,51 +248,54 @@ const UpdateStatusModal = (props, ref) => { ...@@ -248,51 +248,54 @@ const UpdateStatusModal = (props, ref) => {
const onOk = async () => { const onOk = async () => {
const submitApi = oldPackageList.length === 0 ? apiDeliveriesAdd : apiDeliveriesEdit; const submitApi = oldPackageList.length === 0 ? apiDeliveriesAdd : apiDeliveriesEdit;
formRef.current.form.validateFields().then(async values => { formRef.current.form
const packageList = onFilterParams(values.packageList); .validateFields()
.then(async values => {
const packageList = onFilterParams(values.packageList);
// 对比修改差异 // 对比修改差异
oldPackageList.forEach((item, index) => { oldPackageList.forEach((item, index) => {
if (!packageList[index]) return; if (!packageList[index]) return;
const updateAttr = () => { const updateAttr = () => {
packageList[index].preExpressCompanyCode = item.expressCompanyCode; packageList[index].preExpressCompanyCode = item.expressCompanyCode;
packageList[index].preExpressCompanyName = item.expressCompanyName; packageList[index].preExpressCompanyName = item.expressCompanyName;
packageList[index].preExpressNo = item.expressNo; packageList[index].preExpressNo = item.expressNo;
}; };
// eslint-disable-next-line no-restricted-syntax
// for (const key in item) {
// if (typeof item[key] !== 'object' && item[key] !== packageList[index][key]) {
// console.log('修改了物流信息');
// updateAttr();
// break;
// } else if (
// typeof item[key] === 'object' &&
// JSON.stringify(item[key]) !== JSON.stringify(packageList[index][key])
// ) {
// console.log('修改了选择的商品');
// updateAttr();
// break;
// }
// }
updateAttr();
});
const params = { // eslint-disable-next-line no-restricted-syntax
orderNo: record.orderNo, // for (const key in item) {
packageList, // if (typeof item[key] !== 'object' && item[key] !== packageList[index][key]) {
}; // console.log('修改了物流信息');
setConfirmLoading(true); // updateAttr();
const res = await submitApi(params); // break;
setConfirmLoading(false); // } else if (
if (res.code === '0000' && res.businessCode === '0000') { // typeof item[key] === 'object' &&
notification.success({ // JSON.stringify(item[key]) !== JSON.stringify(packageList[index][key])
message: '提交成功', // ) {
// console.log('修改了选择的商品');
// updateAttr();
// break;
// }
// }
updateAttr();
}); });
onCancel();
actionRef.current.reload(); const params = {
} orderNo: record.orderNo,
}); packageList,
};
setConfirmLoading(true);
const res = await submitApi(params);
setConfirmLoading(false);
if (res?.code === '0000' && res?.businessCode === '0000') {
notification.success({
message: '提交成功',
});
onCancel();
actionRef.current.reload();
}
})
.catch(err => {});
}; };
useImperativeHandle(ref, () => ({ useImperativeHandle(ref, () => ({
......
...@@ -591,7 +591,7 @@ const TableList = props => { ...@@ -591,7 +591,7 @@ const TableList = props => {
<LogisticsForm <LogisticsForm
onSubmit={reload} onSubmit={reload}
skuList={skuList} skuList={skuList}
companys={companys} company={companys}
onCancel={() => handleModalVisible(false)} onCancel={() => handleModalVisible(false)}
modalVisible={LogisticsModalVisible} modalVisible={LogisticsModalVisible}
value={LogisticsData} value={LogisticsData}
......
...@@ -12,7 +12,6 @@ class Socket extends EventEmitter { ...@@ -12,7 +12,6 @@ class Socket extends EventEmitter {
this.taskRemindInterval = null; this.taskRemindInterval = null;
this.connected = false; this.connected = false;
this.waitingSendData = []; this.waitingSendData = [];
this.reconnectCount = 0;
this.heartBeatTimer = null; this.heartBeatTimer = null;
return this; return this;
} }
...@@ -117,7 +116,9 @@ class Socket extends EventEmitter { ...@@ -117,7 +116,9 @@ class Socket extends EventEmitter {
return; return;
} }
const sendValue = typeof value === 'string' ? value : JSON.stringify(value); const sendValue = typeof value === 'string' ? value : JSON.stringify(value);
this.socket.send(sendValue); if (this.socket.readyState === this.socket.OPEN) {
this.socket.send(sendValue);
}
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment